Documentation ¶
Index ¶
- Variables
- type Cluster
- type ClusterHelpInfo
- type ClusterService
- type ClusterStorage
- type MockClusterService
- func (m *MockClusterService) Create(c Cluster) error
- func (m *MockClusterService) Delete(c Cluster) error
- func (m *MockClusterService) FindByName(name string) (*Cluster, error)
- func (m *MockClusterService) FindByPool(prov, pool string) (*Cluster, error)
- func (m *MockClusterService) FindByPools(provisioner string, pool []string) (map[string]Cluster, error)
- func (m *MockClusterService) FindByProvisioner(prov string) ([]Cluster, error)
- func (m *MockClusterService) List() ([]Cluster, error)
- func (m *MockClusterService) Update(c Cluster) error
- type MockClusterStorage
- func (m *MockClusterStorage) Delete(c Cluster) error
- func (m *MockClusterStorage) FindAll() ([]Cluster, error)
- func (m *MockClusterStorage) FindByName(name string) (*Cluster, error)
- func (m *MockClusterStorage) FindByPool(provisioner, pool string) (*Cluster, error)
- func (m *MockClusterStorage) FindByProvisioner(provisionerName string) ([]Cluster, error)
- func (m *MockClusterStorage) Upsert(c Cluster) error
- 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") )
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"` CreateData map[string]string `json:"create_data"` Default bool `json:"default"` Writer io.Writer `json:"-"` }
Cluster represents a cluster of nodes.
type ClusterHelpInfo ¶
type ClusterService ¶
type ClusterService interface { Create(Cluster) error Update(Cluster) error List() ([]Cluster, error) FindByName(string) (*Cluster, error) FindByProvisioner(string) ([]Cluster, error) FindByPool(string, string) (*Cluster, error) FindByPools(string, []string) (map[string]Cluster, error) Delete(Cluster) error }
type ClusterStorage ¶
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(c Cluster) error
func (*MockClusterService) Delete ¶
func (m *MockClusterService) Delete(c Cluster) error
func (*MockClusterService) FindByName ¶
func (m *MockClusterService) FindByName(name string) (*Cluster, error)
func (*MockClusterService) FindByPool ¶
func (m *MockClusterService) FindByPool(prov, pool string) (*Cluster, error)
func (*MockClusterService) FindByPools ¶
func (*MockClusterService) FindByProvisioner ¶
func (m *MockClusterService) FindByProvisioner(prov string) ([]Cluster, error)
func (*MockClusterService) List ¶
func (m *MockClusterService) List() ([]Cluster, error)
func (*MockClusterService) Update ¶
func (m *MockClusterService) Update(c Cluster) error
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(c Cluster) error
func (*MockClusterStorage) FindAll ¶
func (m *MockClusterStorage) FindAll() ([]Cluster, error)
func (*MockClusterStorage) FindByName ¶
func (m *MockClusterStorage) FindByName(name string) (*Cluster, error)
func (*MockClusterStorage) FindByPool ¶
func (m *MockClusterStorage) FindByPool(provisioner, pool string) (*Cluster, error)
func (*MockClusterStorage) FindByProvisioner ¶
func (m *MockClusterStorage) FindByProvisioner(provisionerName string) ([]Cluster, error)
func (*MockClusterStorage) Upsert ¶
func (m *MockClusterStorage) Upsert(c Cluster) error
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"` 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"` }
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) 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.