Versions in this module Expand all Collapse all v1 v1.18.2 Oct 16, 2020 Changes in this version + const TypeNamespace + const TypeNetworkPolicy + const TypeService + var ErrAlreadyExists = errors.New("already exists") + var ErrInvalidResource = errors.New("invalid resource") + var ErrNotFound = errors.New("not found") + type CreateOption func(o *CreateOptions) + func CreateContext(ctx context.Context) CreateOption + func CreateEntrypoint(e string) CreateOption + func CreateImage(img string) CreateOption + func CreateNamespace(ns string) CreateOption + func CreateType(t string) CreateOption + func ResourceLimits(r *Resources) CreateOption + func WithArgs(args ...string) CreateOption + func WithCommand(cmd ...string) CreateOption + func WithEnv(env []string) CreateOption + func WithOutput(out io.Writer) CreateOption + func WithPort(p string) CreateOption + func WithRetries(retries int) CreateOption + func WithSecret(key, value string) CreateOption + func WithServiceAccount(s string) CreateOption + func WithVolume(name, path string) CreateOption + type CreateOptions struct + Args []string + Command []string + Context context.Context + Entrypoint string + Env []string + Image string + Namespace string + Output io.Writer + Port string + Resources *Resources + Retries int + Secrets map[string]string + ServiceAccount string + Type string + Volumes map[string]string + type DeleteOption func(o *DeleteOptions) + func DeleteContext(ctx context.Context) DeleteOption + func DeleteNamespace(ns string) DeleteOption + type DeleteOptions struct + Context context.Context + Namespace string + type Event struct + ID string + Options *CreateOptions + Service *Service + Timestamp time.Time + Type EventType + type EventType int + const Create + const Delete + const Update + func (t EventType) String() string + type Log struct + Message string + Metadata map[string]string + type Logs interface + Chan func() chan Log + Error func() error + Stop func() error + type LogsOption func(o *LogsOptions) + func LogsContext(ctx context.Context) LogsOption + func LogsCount(count int64) LogsOption + func LogsNamespace(ns string) LogsOption + func LogsStream(stream bool) LogsOption + type LogsOptions struct + Context context.Context + Count int64 + Namespace string + Stream bool + type Namespace struct + Name string + func NewNamespace(name string) (*Namespace, error) + func (*Namespace) Type() string + func (r *Namespace) String() string + type NetworkPolicy struct + AllowedLabels map[string]string + Name string + Namespace string + func NewNetworkPolicy(name, namespace string, allowedLabels map[string]string) (*NetworkPolicy, error) + func (*NetworkPolicy) Type() string + func (r *NetworkPolicy) String() string + type Option func(o *Options) + func WithClient(c client.Client) Option + func WithImage(t string) Option + func WithSource(src string) Option + func WithType(t string) Option + type Options struct + Client client.Client + Image string + Source string + Type string + type ReadOption func(o *ReadOptions) + func ReadContext(ctx context.Context) ReadOption + func ReadNamespace(ns string) ReadOption + func ReadService(service string) ReadOption + func ReadType(t string) ReadOption + func ReadVersion(version string) ReadOption + type ReadOptions struct + Context context.Context + Namespace string + Service string + Type string + Version string + type Resource interface + String func() string + Type func() string + type Resources struct + CPU int + Disk int + Mem int + type Runtime interface + Create func(Resource, ...CreateOption) error + Delete func(Resource, ...DeleteOption) error + Init func(...Option) error + Logs func(Resource, ...LogsOption) (Logs, error) + Read func(...ReadOption) ([]*Service, error) + Start func() error + Stop func() error + String func() string + Update func(Resource, ...UpdateOption) error + type Service struct + Metadata map[string]string + Name string + Source string + Status ServiceStatus + Version string + func NewService(name, version string) (*Service, error) + func (*Service) Type() string + func (r *Service) String() string + type ServiceStatus int + const Building + const Error + const Pending + const Running + const Starting + const Stopped + const Stopping + const Unknown + type UpdateOption func(o *UpdateOptions) + func UpdateContext(ctx context.Context) UpdateOption + func UpdateEntrypoint(e string) UpdateOption + func UpdateNamespace(ns string) UpdateOption + func UpdateSecret(key, value string) UpdateOption + type UpdateOptions struct + Context context.Context + Entrypoint string + Namespace string + Secrets map[string]string