extended URL scheme
This commit is contained in:
parent
249d7c6844
commit
0994baf5b0
4 changed files with 39 additions and 18 deletions
7
pool.go
7
pool.go
|
|
@ -12,6 +12,7 @@ import (
|
|||
var (
|
||||
ErrPoolExists = errors.New("pool already exists")
|
||||
ErrPoolNotExists = errors.New("pool does not exist")
|
||||
ErrEmptyPoolName = errors.New("pool name is empty")
|
||||
)
|
||||
|
||||
func MakePoolName(namespace, name string) string {
|
||||
|
|
@ -78,6 +79,10 @@ type pool struct {
|
|||
}
|
||||
|
||||
func (c *PoolClient) List(ctx context.Context, name string) (sl ServerList, err error) {
|
||||
if name == "" {
|
||||
err = ErrEmptyPoolName
|
||||
return
|
||||
}
|
||||
var p pool
|
||||
req, err := c.client.NewRequest(ctx, "GET", fmt.Sprintf("/pools/%s", name), nil)
|
||||
if err != nil {
|
||||
|
|
@ -113,7 +118,7 @@ func (c *PoolClient) FindServerByID(ctx context.Context, poolname, id string) (s
|
|||
}
|
||||
|
||||
func (c *PoolClient) FindServerByURL(ctx context.Context, url string) (s *Server, err error) {
|
||||
pool, id, err := ParseURL(url)
|
||||
pool, _, id, err := ParseURL(url)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue