Documentation
¶
Index ¶
- Constants
- Variables
- func ErrorConnectionFailed(host string) error
- func IsErrConnectionFailed(err error) bool
- func IsErrNotFound(err error) bool
- func IsErrNotImplemented(err error) bool
- func IsErrPluginPermissionDenied(err error) bool
- func IsErrUnauthorized(err error) bool
- type Client
- func (cli *Client) NewVersionError(APIrequired, feature string) error
- func (cli *Client) StackCreate(ctx context.Context, spec types.StackSpec, options types.StackCreateOptions) (types.StackCreateResponse, error)
- func (cli *Client) StackDelete(ctx context.Context, id string) error
- func (cli *Client) StackInspect(ctx context.Context, id string) (types.Stack, error)
- func (cli *Client) StackList(ctx context.Context, options types.StackListOptions) ([]types.Stack, error)
- func (cli *Client) StackUpdate(ctx context.Context, id string, version types.Version, spec types.StackSpec, ...) error
- type Settings
- type StackAPIClient
Constants ¶
const DefaultDockerHost = "unix:///var/run/docker.sock"
DefaultDockerHost defines os specific default if DOCKER_HOST is unset
Variables ¶
var ErrRedirect = errors.New("unexpected redirect in response")
ErrRedirect returned when unexpected redirects encountered
Functions ¶
func ErrorConnectionFailed ¶
ErrorConnectionFailed returns an error with host in the error message when connection to docker daemon failed.
func IsErrConnectionFailed ¶
IsErrConnectionFailed returns true if the error is caused by connection failed.
func IsErrNotFound ¶
IsErrNotFound returns true if the error is a NotFound error, which is returned by the API when some object is not found.
func IsErrNotImplemented ¶
IsErrNotImplemented returns true if the error is a NotImplemented error. This is returned by the API when a requested feature has not been implemented.
func IsErrPluginPermissionDenied ¶
IsErrPluginPermissionDenied returns true if the error is caused when a user denies a plugin's permissions
func IsErrUnauthorized ¶
IsErrUnauthorized returns true if the error is caused when a remote registry authentication fails
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is designed to augment the existing Docker API Client with Stacks support
func NewClientWithSettings ¶
NewClientWithSettings creates a new Stack client with settings
func (*Client) NewVersionError ¶
NewVersionError returns an error if the APIVersion required if less than the current supported version
func (*Client) StackCreate ¶
func (cli *Client) StackCreate(ctx context.Context, spec types.StackSpec, options types.StackCreateOptions) (types.StackCreateResponse, error)
StackCreate creates a new Stack
func (*Client) StackDelete ¶
StackDelete returns the details of a Stack
func (*Client) StackInspect ¶
StackInspect returns the details of a Stack
type Settings ¶
type Settings struct { // scheme sets the scheme for the client Scheme string // host holds the server address to connect to Host string // proto holds the client protocol i.e. unix. Proto string // addr holds the client address. Addr string // basePath holds the path to prepend to the requests. BasePath string // client used to send and receive http requests. Client *http.Client // version of the server to talk to. Version string // custom http headers configured by users. CustomHTTPHeaders map[string]string }
Settings stores the settings in use by this client
TODO this should move to a common pkg for sub-client implementations to leverage.
func SettingsFromEnv ¶
SettingsFromEnv creates a Settings based on the standard Docker env vars
type StackAPIClient ¶
type StackAPIClient interface { StackCreate(ctx context.Context, stack types.StackSpec, options types.StackCreateOptions) (types.StackCreateResponse, error) StackInspect(ctx context.Context, id string) (types.Stack, error) StackList(ctx context.Context, options types.StackListOptions) ([]types.Stack, error) StackUpdate(ctx context.Context, id string, version types.Version, spec types.StackSpec, options types.StackUpdateOptions) error StackDelete(ctx context.Context, id string) error }
StackAPIClient defines the client interface for managing Stacks