Versions in this module Expand all Collapse all v3 v3.13.1 Sep 21, 2022 Changes in this version + const EventNamespaceCreated + const EventNamespaceDeleted + const EventNetworkPolicyCreated + const EventNetworkPolicyDeleted + const EventNetworkPolicyUpdated + const EventResourceQuotaCreated + const EventResourceQuotaDeleted + const EventResourceQuotaUpdated + const EventServiceCreated + const EventServiceDeleted + const EventServiceUpdated + const EventTopic + const TypeNamespace + const TypeNetworkPolicy + const TypeResourceQuota + const TypeService + var DefaultRuntime Runtime + var ErrAlreadyExists = errors.New("already exists") + var ErrInvalidResource = errors.New("invalid resource") + var ErrNotFound = errors.New("not found") + func Create(resource Resource, opts ...CreateOption) error + func Delete(resource Resource, opts ...DeleteOption) error + func Update(resource Resource, opts ...UpdateOption) error + type CreateOption func(o *CreateOptions) + func CreateContext(ctx context.Context) CreateOption + func CreateEntrypoint(e string) CreateOption + func CreateImage(img string) CreateOption + func CreateInstances(v int) 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 WithForce(f bool) 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 + Force bool + Image string + Instances int + 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 EventPayload struct + Namespace string + Service *Service + Type string + type EventResourcePayload struct + Name string + Namespace string + NetworkPolicy *NetworkPolicy + ResourceQuota *ResourceQuota + Service *Service + Type string + type EventType int + const CreateEvent + const DeleteEvent + const UpdateEvent + func (t EventType) String() string + type Log struct + Message string + Metadata map[string]string + type LogStream interface + Chan func() chan Log + Error func() error + Stop func() error + func Logs(resource Resource, opts ...LogsOption) (LogStream, 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 + Context context.Context + 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 ResourceQuota struct + Limits *Resources + Name string + Namespace string + Requests *Resources + func NewResourceQuota(name, namespace string, requests, limits *Resources) (*ResourceQuota, error) + func (*ResourceQuota) Type() string + func (r *ResourceQuota) String() 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) (LogStream, 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 Read(opts ...ReadOption) ([]*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 + func (s ServiceStatus) String() string + type UpdateOption func(o *UpdateOptions) + func UpdateContext(ctx context.Context) UpdateOption + func UpdateEntrypoint(e string) UpdateOption + func UpdateInstances(v int) UpdateOption + func UpdateNamespace(ns string) UpdateOption + func UpdateSecret(key, value string) UpdateOption + type UpdateOptions struct + Context context.Context + Entrypoint string + Instances int + Namespace string + Secrets map[string]string