mirror of
https://github.com/docker/compose.git
synced 2026-09-01 07:11:06 +00:00
API Metrics : send context type, not context name
Signed-off-by: Guillaume Tardif <guillaume.tardif@docker.com>
This commit is contained in:
parent
fbe505f27f
commit
7807fb33cc
6 changed files with 45 additions and 23 deletions
|
|
@ -44,10 +44,16 @@ func New(ctx context.Context) (*Client, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
return &Client{
|
||||
backendType: cc.Type(),
|
||||
client := NewClient(cc.Type(), service)
|
||||
return &client, nil
|
||||
}
|
||||
|
||||
// NewClient returns new client
|
||||
func NewClient(backendType string, service backend.Service) Client {
|
||||
return Client{
|
||||
backendType: backendType,
|
||||
bs: service,
|
||||
}, nil
|
||||
}
|
||||
}
|
||||
|
||||
// GetCloudService returns a backend CloudService (typically login, create context)
|
||||
|
|
@ -61,6 +67,11 @@ type Client struct {
|
|||
bs backend.Service
|
||||
}
|
||||
|
||||
// ContextType the context type associated with backend
|
||||
func (c *Client) ContextType() string {
|
||||
return c.backendType
|
||||
}
|
||||
|
||||
// ContainerService returns the backend service for the current context
|
||||
func (c *Client) ContainerService() containers.Service {
|
||||
if cs := c.bs.ContainerService(); cs != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue