Documentation
¶
Index ¶
- type Cluster
- type ClusterRepository
- type ClusterService
- type Config
- type ConfigListOption
- type Deploy
- type DeploymentStatus
- type HealthCheck
- type HealthCheckFilterOptions
- type HealthChecker
- type HealthCheckerRepository
- type Node
- type NodeListOptions
- type NodeRepository
- type Placement
- type PortInfo
- type RestartPolicy
- type Service
- type ServiceConfig
- type ServiceFilterOptions
- type ServiceGetOptions
- type ServiceLogResult
- type ServiceRepository
- type ServiceSecret
- type ServiceService
- type ServiceSpec
- type Task
- type TaskListOption
- type TaskService
- type TaskStatus
- type UpdateConfig
- type VolumeInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster struct {
ID string `json:"id" db:"id" bson:"_id"`
Name string `json:"name" db:"name" bson:"name"`
Host string `json:"host" db:"host" bson:"host"`
Sort int `json:"sort" db:"sort" bson:"sort"`
CreatedAt *time.Time `json:"created_at" db:"created_at" bson:"created_at"`
UpdatedAt *time.Time `json:"updated_at" db:"updated_at" bson:"updated_at"`
}
type ClusterRepository ¶
type ClusterService ¶
type ConfigListOption ¶
type ConfigListOption struct {
}
type Deploy ¶
type Deploy struct {
Mode string `json:"mode" bson:"mode"`
Replicas uint64 `json:"replicas" bson:"replicas"`
EndpointMode string `json:"endpoint_mode"`
UpdateConfig UpdateConfig `json:"update_config"`
RestartPolicy RestartPolicy `json:"restart_policy" bson:"restart_policy"`
Constraints []string `json:"constraints" bson:"constraints"`
}
type DeploymentStatus ¶
type DeploymentStatus struct {
ServiceName string `json:"-"`
Image string `json:"image"`
Mode string `json:"mode"`
AvailableReplicas int `json:"available_replicas"`
Replicas int `json:"replicas"`
UpdateState string `json:"update_state"`
}
DeploymentStatus stores the information about mode and replicas to be used by template
type HealthCheck ¶
type HealthCheck struct {
ID string `json:"id" db:"id" bson:"_id"`
ClusterID string `json:"cluster_id" db:"cluster_id" bson:"cluster_id"`
Name string `json:"name" db:"name" bson:"name"`
URL string `json:"url" db:"url"`
Interval int `json:"interval" db:"interval"`
Timeout int `json:"timeout" db:"timeout"`
Retries int `json:"retries" db:"retries"`
IsEnabled int `json:"is_enabled" db:"is_enabled"`
IsHealth bool `json:"-" db:"-"`
CreatedAt *time.Time `json:"created_at" db:"created_at" bson:"created_at"`
UpdatedAt *time.Time `json:"updated_at" db:"updated_at" bson:"updated_at"`
}
type HealthChecker ¶
type HealthChecker interface {
Create(ctx context.Context, entity *HealthCheck) error
List(ctx context.Context, opts HealthCheckFilterOptions) ([]*HealthCheck, error)
}
type HealthCheckerRepository ¶
type HealthCheckerRepository interface {
Insert(ctx context.Context, target *HealthCheck) error
Update(ctx context.Context, target *HealthCheck) error
Delete(ctx context.Context, id string) error
FindOne(ctx context.Context, opts HealthCheckFilterOptions) (*HealthCheck, error)
Find(ctx context.Context, opts HealthCheckFilterOptions) ([]*HealthCheck, error)
}
type Node ¶
type Node struct {
ID string `json:"id" bson:"_id"`
ClusterID string `json:"cluster_id" bson:"cluster_id"`
Name string `json:"name" bson:"name"`
Host string `json:"host" bson:"host"`
CreatedAt time.Time `json:"created_at" bson:"created_at"`
UpdatedAt time.Time `json:"updated_at" bson:"updated_at"`
}
type NodeListOptions ¶
type NodeListOptions struct {
}
type NodeRepository ¶
type RestartPolicy ¶
type Service ¶
type Service struct {
ID string `json:"id" db:"id" bson:"_id"`
ClusterID string `json:"cluster_id" db:"cluster_id" bson:"cluster_id"`
Name string `json:"name" db:"name" bson:"name"`
Spec ServiceSpec `json:"spec" db:"-" bson:"spec"`
SpecJSON sqlxTypes.JSONText `json:"-" db:"specJSON" bson:"-"`
DeploymentStatus DeploymentStatus `json:"deployment_status" db:"-" bson:"-"`
CreatedAt *time.Time `json:"created_at" db:"created_at" bson:"created_at"`
UpdatedAt *time.Time `json:"updated_at" db:"updated_at" bson:"updated_at"`
}
type ServiceConfig ¶
type ServiceFilterOptions ¶
type ServiceGetOptions ¶
type ServiceLogResult ¶
type ServiceLogResult struct {
Logs string `json:"logs"`
}
type ServiceRepository ¶
type ServiceRepository interface {
Insert(ctx context.Context, target *Service) error
Update(ctx context.Context, target *Service) error
Delete(ctx context.Context, id string) error
FindOne(ctx context.Context, opts ServiceFilterOptions) (*Service, error)
Find(ctx context.Context, opts ServiceFilterOptions) ([]*Service, error)
}
type ServiceSecret ¶
type ServiceService ¶
type ServiceService interface {
DockerClient() *client.Client
ServiceCreate(ctx context.Context, target *Service) error
ServiceGetByID(ctx context.Context, id string) (*Service, error)
ServiceRawByID(ctx context.Context, id string) (*swarm.Service, error)
ServiceLogsByID(ctx context.Context, id string) (string, error)
ServiceGetByName(ctx context.Context, name string) (*Service, error)
ServiceDelete(ctx context.Context, id string) error
ServiceUpdate(ctx context.Context, target *Service) error
ServiceStop(ctx context.Context, id string) error
Redeploy(ctx context.Context, serviceName string) error
List(ctx context.Context, opts ServiceFilterOptions) ([]*Service, error)
}
type ServiceSpec ¶
type ServiceSpec struct {
Image string `json:"image" db:"-" bson:"image"`
Ports []PortInfo `json:"ports" db:"-" bson:"ports"`
Volumes []VolumeInfo `json:"volumes" db:"-" bson:"volumes"`
Command []string `json:"command" db:"-" bson:"command"`
Environments []string `json:"environments" db:"-" bson:"environments"`
Configs []ServiceConfig `json:"configs" db:"-" bson:"configs"`
Secrets []ServiceSecret `json:"secrets" db:"-" bson:"secrets"`
Networks []string `json:"networks" db:"-" bson:"networks"`
Deploy Deploy `json:"deploy" db:"-" bson:"deploy"`
}
type Task ¶
type Task struct {
ID string `json:"id"`
Node string `json:"node"`
Slot int `json:"slot"`
Status TaskStatus `json:"status"`
}
type TaskListOption ¶
type TaskService ¶
type TaskStatus ¶
type UpdateConfig ¶
Click to show internal directories.
Click to hide internal directories.