provision

package
v0.0.0-...-9451de5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2019 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

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 ClusterHelpInfo struct {
	ProvisionerHelp string            `json:"provisioner_help"`
	CustomDataHelp  map[string]string `json:"custom_data_help"`
	CreateDataHelp  map[string]string `json:"create_data_help"`
}

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 ClusterStorage interface {
	Upsert(Cluster) error
	FindAll() ([]Cluster, error)
	FindByName(string) (*Cluster, error)
	FindByProvisioner(string) ([]Cluster, error)
	FindByPool(string, string) (*Cluster, error)
	Delete(Cluster) error
}

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 (m *MockClusterService) FindByPools(provisioner string, pool []string) (map[string]Cluster, error)

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 TsuruYamlKubernetesProcessPortConfig

type TsuruYamlKubernetesProcessPortConfig struct {
	Name       string `json:"name,omitempty"`
	Protocol   string `json:"protocol,omitempty"`
	Port       int    `json:"port,omitempty"`
	TargetPort int    `json:"target_port,omitempty"`
}

type TsuruYamlRestartHooks

type TsuruYamlRestartHooks struct {
	Before []string `json:"before" bson:",omitempty"`
	After  []string `json:"after" bson:",omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL