Documentation
¶
Overview ¶
Package create provides the container config for the wrapped client. it is built to be created in a declarative way.
Index ¶
- Variables
- func IsContainerConfigError(err error) bool
- func IsHostConfigError(err error) bool
- func IsNetworkConfigError(err error) bool
- func IsPlatformConfigError(err error) bool
- func IsProjectConfigError(err error) bool
- func IsServiceConfigError(err error) bool
- type Container
- func (c *Container) GetWarnings() string
- func (c *Container) Validate() error
- func (c *Container) WithContainerConfig(setters ...SetContainerConfig) *Container
- func (c *Container) WithHostConfig(setters ...SetHostConfig) *Container
- func (c *Container) WithNetworkConfig(setters ...SetNetworkConfig) *Container
- func (c *Container) WithPlatformConfig(setters ...SetPlatformConfig) *Container
- type ContainerConfig
- type ContainerConfigError
- type HostConfig
- type HostConfigError
- type NetworkConfig
- type NetworkConfigError
- type PlatformConfig
- type PlatformConfigError
- type Project
- func (p *Project) Export(file string, perm os.FileMode) error
- func (p *Project) ForEachService(fn func(name string, service *types.ServiceConfig) error) error
- func (p *Project) Marshal() ([]byte, error)
- func (p *Project) Unwrap() *types.Project
- func (p *Project) Validate() error
- func (p *Project) WithNetwork(name string, setters ...network.SetNetworkProjectConfig) *Project
- func (p *Project) WithSecret(key string, setters ...projectsecret.SetProjectSecretConfig) *Project
- func (p *Project) WithService(name string, service *Container, setters ...SetServiceConfig) *Project
- func (p *Project) WithVolume(name string, setters ...volume.SetVolumeProjectConfig) *Project
- type ProjectConfigError
- type ServiceConfigError
- type SetContainerConfig
- type SetHostConfig
- type SetNetworkConfig
- type SetPlatformConfig
- type SetServiceConfig
Constants ¶
This section is empty.
Variables ¶
var ( ErrContainerConfig = errors.New("container config has errors") ErrHostConfig = errors.New("host config has errors") ErrNetworkConfig = errors.New("network config has errors") ErrPlatformConfig = errors.New("platform config has errors") ErrServiceConfig = errors.New("service config has errors") ErrProjectConfig = errors.New("project config has errors") ErrValidation = errors.New("container has errors") )
Functions ¶
func IsContainerConfigError ¶
func IsHostConfigError ¶
func IsNetworkConfigError ¶
func IsPlatformConfigError ¶
func IsProjectConfigError ¶
func IsServiceConfigError ¶
Types ¶
type Container ¶
func NewContainer ¶
func (*Container) GetWarnings ¶
func (*Container) Validate ¶
Validate validates the container config. It will return an error if the container has errors.
func (*Container) WithContainerConfig ¶
func (c *Container) WithContainerConfig(setters ...SetContainerConfig) *Container
WithContainerConfig sets the container config via the setter functions. It will return a container with the container config set. If any of the setters return an error, that setter will be skipped and an error will be appended to the container's error slice. parameters:
- setters: the setters to set the container config
func (*Container) WithHostConfig ¶
func (c *Container) WithHostConfig(setters ...SetHostConfig) *Container
WithHostConfig sets the host config via the setter functions. It will return a container with the host config set. If any of the setters return an error, that setter will be skipped and an error will be appended to the container's error slice. parameters:
- setters: the setters to set the host config
func (*Container) WithNetworkConfig ¶
func (c *Container) WithNetworkConfig(setters ...SetNetworkConfig) *Container
WithNetworkConfig sets the network config via the setter functions. It will return a container with the network config set. If any of the setters return an error, that setter will be skipped and an error will be appended to the container's error slice. parameters:
- setters: the setters to set the network config
func (*Container) WithPlatformConfig ¶
func (c *Container) WithPlatformConfig(setters ...SetPlatformConfig) *Container
WithPlatformConfig sets the platform config via the setter functions. It will return a container with the platform config set. If any of the setters return an error, that setter will be skipped and an error will be appended to the container's error slice. parameters:
- setters: the setters to set the platform config
type ContainerConfig ¶
type ContainerConfigError ¶
func NewContainerConfigError ¶
func NewContainerConfigError(field, message string) *ContainerConfigError
func (*ContainerConfigError) Error ¶
func (e *ContainerConfigError) Error() string
func (*ContainerConfigError) Unwrap ¶
func (e *ContainerConfigError) Unwrap() error
type HostConfig ¶
type HostConfig struct {
*c.HostConfig
}
type HostConfigError ¶
func NewHostConfigError ¶
func NewHostConfigError(field, message string) *HostConfigError
func (*HostConfigError) Error ¶
func (e *HostConfigError) Error() string
func (*HostConfigError) Unwrap ¶
func (e *HostConfigError) Unwrap() error
type NetworkConfig ¶
type NetworkConfig struct {
*n.NetworkingConfig
}
type NetworkConfigError ¶
func NewNetworkConfigError ¶
func NewNetworkConfigError(field, message string) *NetworkConfigError
func (*NetworkConfigError) Error ¶
func (e *NetworkConfigError) Error() string
func (*NetworkConfigError) Unwrap ¶
func (e *NetworkConfigError) Unwrap() error
type PlatformConfig ¶
type PlatformConfigError ¶
func NewPlatformConfigError ¶
func NewPlatformConfigError(field, message string) *PlatformConfigError
func (*PlatformConfigError) Error ¶
func (e *PlatformConfigError) Error() string
func (*PlatformConfigError) Unwrap ¶
func (e *PlatformConfigError) Unwrap() error
type Project ¶
type Project struct {
// contains filtered or unexported fields
}
Project is a wrapper around types.Project It provides methods to create and manage a docker Compose project.
func NewProject ¶
NewProject creates a new project with the given name. It initializes the project with an empty service list. The name is used as the project name in the compose file.
func (*Project) Export ¶
Export exports the project to a file parameters:
- file: the file path to export the project to
- perm: the permission of the file
func (*Project) ForEachService ¶
func (*Project) Validate ¶
Validate validates the project returns an error if the project has errors
func (*Project) WithNetwork ¶
func (p *Project) WithNetwork(name string, setters ...network.SetNetworkProjectConfig) *Project
WithNetwork defines a new network in the project
func (*Project) WithSecret ¶
func (p *Project) WithSecret(key string, setters ...projectsecret.SetProjectSecretConfig) *Project
WithSecret defines a new secret in the project
func (*Project) WithService ¶
func (p *Project) WithService(name string, service *Container, setters ...SetServiceConfig) *Project
WithService defines a new service in the project parameters:
- name: the name of the service
- service: the container to create the service from
- setters: the setters to apply to the service
func (*Project) WithVolume ¶
func (p *Project) WithVolume(name string, setters ...volume.SetVolumeProjectConfig) *Project
WithVolume defines a new volume in the project parameters:
- name: the name of the volume
- volume: the volume to create the volume from
type ProjectConfigError ¶
func NewProjectConfigError ¶
func NewProjectConfigError(field, message string) *ProjectConfigError
func (*ProjectConfigError) Error ¶
func (e *ProjectConfigError) Error() string
func (*ProjectConfigError) Unwrap ¶
func (e *ProjectConfigError) Unwrap() error
type ServiceConfigError ¶
func NewServiceConfigError ¶
func NewServiceConfigError(field, message string) *ServiceConfigError
func (*ServiceConfigError) Error ¶
func (e *ServiceConfigError) Error() string
func (*ServiceConfigError) Unwrap ¶
func (e *ServiceConfigError) Unwrap() error
type SetContainerConfig ¶
type SetContainerConfig func(config *ContainerConfig) error
SetContainerConfig is a function that sets the container config
type SetHostConfig ¶
type SetHostConfig func(config *HostConfig) error
SetHostConfig is a function that sets the host config
type SetNetworkConfig ¶
type SetNetworkConfig func(config *NetworkConfig) error
SetNetworkConfig is a function that sets the network config
type SetPlatformConfig ¶
type SetPlatformConfig func(config *PlatformConfig) error
SetPlatformConfig is a function that sets the platform config
type SetServiceConfig ¶
type SetServiceConfig func(service *types.ServiceConfig) error
SetServiceConfig is a function that sets the service config
Directories
¶
| Path | Synopsis |
|---|---|
|
config
|
|
|
cc
Package cc provides the options for the container config.
|
Package cc provides the options for the container config. |
|
hc
Package hc provides the options for the host config.
|
Package hc provides the options for the host config. |
|
hc/mount
Package mount provides the options for the mount config in the host config.
|
Package mount provides the options for the mount config in the host config. |
|
nc
Package nc provides the options for the network config.
|
Package nc provides the options for the network config. |
|
nc/endpoint
Package endpoint provides the options for the endpoint config in the network config.
|
Package endpoint provides the options for the endpoint config in the network config. |
|
nc/endpoint/ipam
Package ipam provides the options for the IPAM config in the endpoint config.
|
Package ipam provides the options for the IPAM config in the endpoint config. |
|
pc
Package pc provides the options for the platform config.
|
Package pc provides the options for the platform config. |
|
sc
Package sc provides functions to set the service config
|
Package sc provides functions to set the service config |
|
sc/build
Package build provides functions to set the build config for a service
|
Package build provides functions to set the build config for a service |
|
sc/build/ulimit
Package ulimit provides a set of functions to configure the ulimits for the build
|
Package ulimit provides a set of functions to configure the ulimits for the build |
|
sc/deploy
Package deploy provides functions to set the deploy configuration for a service
|
Package deploy provides functions to set the deploy configuration for a service |
|
sc/deploy/resource
Package resource provides functions to set the resource configuration for a service deploy
|
Package resource provides functions to set the resource configuration for a service deploy |
|
sc/deploy/resource/device
Package device provides functions to set the device configuration for a service deploys resource
|
Package device provides functions to set the device configuration for a service deploys resource |
|
sc/deploy/update
Package update provides functions to set the update configuration for a service deploy
|
Package update provides functions to set the update configuration for a service deploy |
|
sc/network
Package network provides functions to set the network configuration for a project
|
Package network provides functions to set the network configuration for a project |
|
sc/network/pool
Package pool provides functions to set the ipam pool configuration for a project
|
Package pool provides functions to set the ipam pool configuration for a project |
|
sc/secrets/projectsecret
Package projectsecret provides a set of functions to configure the secret for the project
|
Package projectsecret provides a set of functions to configure the secret for the project |
|
sc/secrets/secretservice
Package secretservice provides a set of functions to configure the secrets for the service
|
Package secretservice provides a set of functions to configure the secrets for the service |
|
sc/volume
Package volume provides functions to set the volume configuration for a project
|
Package volume provides functions to set the volume configuration for a project |