Documentation ¶
Index ¶
- func APIVersionFlag(v *viper.Viper, f *pflag.FlagSet)
- func GetAPIVersion(v *viper.Viper) string
- func GetHost(v *viper.Viper) string
- func GetPortBindings(port string, container *dockertypes.ContainerJSON) ([]nat.PortBinding, error)
- func HostFlag(v *viper.Viper, f *pflag.FlagSet)
- func NewClient(cfg *ClientConfig) (*docker.Client, error)
- func ParseVolumes(specs ...string) (volumes map[string]struct{}, binds []string, err error)
- type ClientConfig
- type Compose
- func (c *Compose) Down(ctx context.Context) error
- func (c *Compose) GetContainer(ctx context.Context, name string) (*dockertypes.ContainerJSON, error)
- func (c *Compose) Name(name string) string
- func (c *Compose) RegisterNetwork(name string, cfg *dockertypes.NetworkCreate)
- func (c *Compose) RegisterService(name string, cfg *ServiceConfig)
- func (c *Compose) RegisterVolume(name string, cfg dockervolume.VolumeCreateBody)
- func (c *Compose) SetLogger(logger logrus.FieldLogger)
- func (c *Compose) Up(ctx context.Context) error
- func (c *Compose) WaitContainer(ctx context.Context, name string, timeout time.Duration) error
- type ComposeConfig
- type PostgresServiceOpts
- type ServiceConfig
- type TraefikServiceOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func APIVersionFlag ¶
APIVersionFlag register flag for docker API version
func GetAPIVersion ¶
func GetPortBindings ¶
func GetPortBindings(port string, container *dockertypes.ContainerJSON) ([]nat.PortBinding, error)
GetPortBindings returns the list of port binding to access container on given port
Types ¶
type ClientConfig ¶
type ClientConfig struct { Host string Version string Client *kilnhttp.ClientConfig }
func ClientConfigFromViper ¶
func ClientConfigFromViper(v *viper.Viper) *ClientConfig
func (*ClientConfig) SetDefault ¶
func (cfg *ClientConfig) SetDefault() *ClientConfig
type Compose ¶
type Compose struct {
// contains filtered or unexported fields
}
func NewCompose ¶
func NewCompose(cfg *ComposeConfig) (*Compose, error)
func (*Compose) GetContainer ¶
func (c *Compose) GetContainer(ctx context.Context, name string) (*dockertypes.ContainerJSON, error)
func (*Compose) RegisterNetwork ¶
func (c *Compose) RegisterNetwork(name string, cfg *dockertypes.NetworkCreate)
func (*Compose) RegisterService ¶
func (c *Compose) RegisterService(name string, cfg *ServiceConfig)
func (*Compose) RegisterVolume ¶
func (c *Compose) RegisterVolume(name string, cfg dockervolume.VolumeCreateBody)
func (*Compose) SetLogger ¶
func (c *Compose) SetLogger(logger logrus.FieldLogger)
type ComposeConfig ¶
type ComposeConfig struct { Client *ClientConfig Namespace string }
func (*ComposeConfig) SetDefault ¶
func (cfg *ComposeConfig) SetDefault() *ComposeConfig
type PostgresServiceOpts ¶
type PostgresServiceOpts struct {
Version, Port, User, Password string
}
func (*PostgresServiceOpts) SQLConfig ¶
func (opts *PostgresServiceOpts) SQLConfig(container *dockertypes.ContainerJSON) (*kilnsql.Config, error)
SQLConfig returns an SQL config to connect to the postgres container from the host
func (*PostgresServiceOpts) SetDefault ¶
func (opts *PostgresServiceOpts) SetDefault() *PostgresServiceOpts
type ServiceConfig ¶
type ServiceConfig struct { Name string Container *dockercontainer.Config Host *dockercontainer.HostConfig Networking *dockernetwork.NetworkingConfig IsReady func(context.Context, *dockertypes.ContainerJSON) error DependsOn []string }
func NewPostgresServiceConfig ¶
func NewPostgresServiceConfig(opts *PostgresServiceOpts) (*ServiceConfig, error)
func NewTreafikServiceConfig ¶
func NewTreafikServiceConfig(opts *TraefikServiceOpts) (*ServiceConfig, error)
type TraefikServiceOpts ¶
type TraefikServiceOpts struct {
Version, Port string
}
func (*TraefikServiceOpts) Addr ¶
func (opts *TraefikServiceOpts) Addr(container *dockertypes.ContainerJSON) (string, error)
Addr returns address to connect to the traefik container from the host
func (*TraefikServiceOpts) SetDefault ¶
func (opts *TraefikServiceOpts) SetDefault() *TraefikServiceOpts
Click to show internal directories.
Click to hide internal directories.