Documentation ¶
Index ¶
- Variables
- type Cluster
- type ClusterHelpInfo
- type ClusterService
- type ClusterStorage
- type DeployKind
- type DeployOptions
- type KubeConfig
- type MockClusterService
- func (m *MockClusterService) Create(ctx context.Context, c Cluster) error
- func (m *MockClusterService) Delete(ctx context.Context, c Cluster) error
- func (m *MockClusterService) FindByName(ctx context.Context, name string) (*Cluster, error)
- func (m *MockClusterService) FindByPool(ctx context.Context, prov, pool string) (*Cluster, error)
- func (m *MockClusterService) FindByPools(ctx context.Context, provisioner string, pool []string) (map[string]Cluster, error)
- func (m *MockClusterService) FindByProvisioner(ctx context.Context, prov string) ([]Cluster, error)
- func (m *MockClusterService) List(context.Context) ([]Cluster, error)
- func (m *MockClusterService) Update(ctx context.Context, c Cluster) error
- type MockClusterStorage
- func (m *MockClusterStorage) Delete(ctx context.Context, c Cluster) error
- func (m *MockClusterStorage) FindAll(context.Context) ([]Cluster, error)
- func (m *MockClusterStorage) FindByName(ctx context.Context, name string) (*Cluster, error)
- func (m *MockClusterStorage) FindByPool(ctx context.Context, provisioner, pool string) (*Cluster, error)
- func (m *MockClusterStorage) FindByProvisioner(ctx context.Context, provisionerName string) ([]Cluster, error)
- func (m *MockClusterStorage) Upsert(ctx context.Context, c Cluster) error
- type MockPoolService
- type MockPoolStorage
- type Pool
- type PoolService
- type PoolStorage
- type TsuruYamlData
- type TsuruYamlHealthcheck
- type TsuruYamlHooks
- type TsuruYamlKubernetesConfig
- type TsuruYamlKubernetesGroup
- type TsuruYamlKubernetesProcessConfig
- type TsuruYamlKubernetesProcessPortConfig
- type TsuruYamlRestartHooks
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrClusterNotFound = errors.New("cluster not found") ErrNoCluster = errors.New("no cluster") )
View Source
var ( ErrPoolNotFound = errors.New("pool does not exist") ErrTooManyPoolsFound = errors.New("too many pools found") )
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster struct { Name string `json:"name"` Addresses []string `json:"addresses"` Provisioner string `json:"provisioner"` CaCert []byte `json:"cacert"` ClientCert []byte `json:"clientcert"` ClientKey []byte `json:"clientkey"` Pools []string `json:"pools"` CustomData map[string]string `json:"custom_data"` Local bool `json:"local"` Default bool `json:"default"` KubeConfig *KubeConfig `json:"kubeConfig,omitempty"` HTTPProxy string `json:"httpProxy,omitempty"` Writer io.Writer `json:"-"` }
Cluster represents a cluster of nodes.
func (*Cluster) CleanUpSensitive ¶
func (c *Cluster) CleanUpSensitive()
type ClusterHelpInfo ¶
type ClusterService ¶
type ClusterService interface { Create(context.Context, Cluster) error Update(context.Context, Cluster) error List(context.Context) ([]Cluster, error) FindByName(context.Context, string) (*Cluster, error) FindByProvisioner(context.Context, string) ([]Cluster, error) FindByPool(ctx context.Context, provisioner, pool string) (*Cluster, error) FindByPools(ctx context.Context, provisioner string, pools []string) (map[string]Cluster, error) Delete(context.Context, Cluster) error }
type ClusterStorage ¶
type ClusterStorage interface { Upsert(context.Context, Cluster) error FindAll(context.Context) ([]Cluster, error) FindByName(context.Context, string) (*Cluster, error) FindByProvisioner(context.Context, string) ([]Cluster, error) FindByPool(context.Context, string, string) (*Cluster, error) Delete(context.Context, Cluster) error }
type DeployKind ¶
type DeployKind string
const ( DeployArchiveURL DeployKind = "archive-url" DeployGit DeployKind = "git" DeployImage DeployKind = "image" DeployBuildedImage DeployKind = "imagebuild" DeployRollback DeployKind = "rollback" DeployUpload DeployKind = "upload" DeployUploadBuild DeployKind = "uploadbuild" DeployRebuild DeployKind = "rebuild" DeployDockerfile DeployKind = "dockerfile" )
type DeployOptions ¶
type DeployOptions interface {
GetKind() (kind DeployKind)
}
type KubeConfig ¶
type KubeConfig struct { Cluster clientcmdapi.Cluster `json:"cluster"` AuthInfo clientcmdapi.AuthInfo `json:"user"` }
type MockClusterService ¶
type MockClusterService struct { OnCreate func(Cluster) error OnUpdate func(Cluster) error OnList func() ([]Cluster, error) OnFindByName func(string) (*Cluster, error) OnFindByProvisioner func(string) ([]Cluster, error) OnFindByPool func(string, string) (*Cluster, error) OnFindByPools func(string, []string) (map[string]Cluster, error) OnDelete func(Cluster) error }
func (*MockClusterService) Create ¶
func (m *MockClusterService) Create(ctx context.Context, c Cluster) error
func (*MockClusterService) Delete ¶
func (m *MockClusterService) Delete(ctx context.Context, c Cluster) error
func (*MockClusterService) FindByName ¶
func (*MockClusterService) FindByPool ¶
func (*MockClusterService) FindByPools ¶
func (*MockClusterService) FindByProvisioner ¶
type MockClusterStorage ¶
type MockClusterStorage struct { OnUpsert func(Cluster) error OnFindAll func() ([]Cluster, error) OnFindByName func(string) (*Cluster, error) OnFindByProvisioner func(string) ([]Cluster, error) OnFindByPool func(string, string) (*Cluster, error) OnDelete func(Cluster) error }
MockClusterStorage implements ClusterStorage interface
func (*MockClusterStorage) Delete ¶
func (m *MockClusterStorage) Delete(ctx context.Context, c Cluster) error
func (*MockClusterStorage) FindAll ¶
func (m *MockClusterStorage) FindAll(context.Context) ([]Cluster, error)
func (*MockClusterStorage) FindByName ¶
func (*MockClusterStorage) FindByPool ¶
func (*MockClusterStorage) FindByProvisioner ¶
type MockPoolService ¶
type MockPoolService struct { OnList func() ([]Pool, error) OnFindByName func(string) (*Pool, error) OnServices func(pool string) ([]string, error) }
func (*MockPoolService) FindByName ¶
type MockPoolStorage ¶
type MockPoolStorage struct { OnFindAll func() ([]Pool, error) OnFindByName func(string) (*Pool, error) }
func (*MockPoolStorage) FindAll ¶
func (m *MockPoolStorage) FindAll(ctx context.Context) ([]Pool, error)
func (*MockPoolStorage) FindByName ¶
type PoolService ¶
type PoolStorage ¶
type TsuruYamlData ¶
type TsuruYamlData struct { Hooks *TsuruYamlHooks `json:"hooks,omitempty" bson:",omitempty"` Healthcheck *TsuruYamlHealthcheck `json:"healthcheck,omitempty" bson:",omitempty"` Kubernetes *TsuruYamlKubernetesConfig `json:"kubernetes,omitempty" bson:",omitempty"` }
func (TsuruYamlData) ToRouterHC ¶
func (y TsuruYamlData) ToRouterHC() router.HealthcheckData
type TsuruYamlHealthcheck ¶
type TsuruYamlHealthcheck struct { Path string `json:"path"` Method string `json:"method"` Status int `json:"status"` Scheme string `json:"scheme"` Command []string `json:"command,omitempty" bson:",omitempty"` Headers map[string]string `json:"headers,omitempty" bson:",omitempty"` Match string `json:"match,omitempty" bson:",omitempty"` RouterBody string `json:"router_body,omitempty" yaml:"router_body" bson:"router_body,omitempty"` UseInRouter bool `json:"use_in_router,omitempty" yaml:"use_in_router" bson:"use_in_router,omitempty"` ForceRestart bool `json:"force_restart,omitempty" yaml:"force_restart" bson:"force_restart,omitempty"` AllowedFailures int `json:"allowed_failures,omitempty" yaml:"allowed_failures" bson:"allowed_failures,omitempty"` IntervalSeconds int `json:"interval_seconds,omitempty" yaml:"interval_seconds" bson:"interval_seconds,omitempty"` TimeoutSeconds int `json:"timeout_seconds,omitempty" yaml:"timeout_seconds" bson:"timeout_seconds,omitempty"` DeployTimeoutSeconds int `json:"deploy_timeout_seconds,omitempty" yaml:"deploy_timeout_seconds" bson:"deploy_timeout_seconds,omitempty"` }
type TsuruYamlHooks ¶
type TsuruYamlHooks struct { Restart TsuruYamlRestartHooks `json:"restart" bson:",omitempty"` Build []string `json:"build" bson:",omitempty"` }
type TsuruYamlKubernetesConfig ¶
type TsuruYamlKubernetesConfig struct {
Groups map[string]TsuruYamlKubernetesGroup `json:"groups,omitempty"`
}
func (*TsuruYamlKubernetesConfig) DeepCopy ¶
func (in *TsuruYamlKubernetesConfig) DeepCopy() *TsuruYamlKubernetesConfig
func (*TsuruYamlKubernetesConfig) DeepCopyInto ¶
func (in *TsuruYamlKubernetesConfig) DeepCopyInto(out *TsuruYamlKubernetesConfig)
func (*TsuruYamlKubernetesConfig) GetProcessConfigs ¶
func (y *TsuruYamlKubernetesConfig) GetProcessConfigs(procName string) *TsuruYamlKubernetesProcessConfig
type TsuruYamlKubernetesGroup ¶
type TsuruYamlKubernetesGroup map[string]TsuruYamlKubernetesProcessConfig
type TsuruYamlKubernetesProcessConfig ¶
type TsuruYamlKubernetesProcessConfig struct {
Ports []TsuruYamlKubernetesProcessPortConfig `json:"ports"`
}
type TsuruYamlRestartHooks ¶
Click to show internal directories.
Click to hide internal directories.