Documentation ¶
Index ¶
- Constants
- type ClusterRepository
- type ClusterService
- type ErrorCreateNamespace
- type EventEmitter
- type JobRepository
- type JobService
- type Namespace
- type NamespaceEvent
- type NamespaceRepository
- type NamespaceService
- type NamespaceStatus
- type Pod
- type PodRepository
- type PodService
- type Pods
- type Port
- type Service
- type ServiceRepository
- type ServiceService
- type Version
Constants ¶
const ( EventStatusUpdate string = "STATUS.UPDATE" EventStatusReady string = "STATUS.READY" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClusterRepository ¶ added in v0.4.3
type ClusterService ¶ added in v0.4.3
func NewClusterService ¶ added in v0.4.3
func NewClusterService(client ClusterRepository) ClusterService
type ErrorCreateNamespace ¶ added in v0.4.0
type ErrorCreateNamespace struct {
Msg string
}
ErrorCreateNamespace represents an error due to a namespace creation failure on kubernetes cluster
func (ErrorCreateNamespace) Error ¶ added in v0.4.0
func (err ErrorCreateNamespace) Error() string
Error returns the error message
type EventEmitter ¶ added in v0.4.0
type EventEmitter func(event NamespaceEvent)
type JobRepository ¶ added in v0.5.3
type JobService ¶ added in v0.5.3
func NewJobService ¶ added in v0.5.3
func NewJobService(job JobRepository) JobService
type NamespaceEvent ¶ added in v0.4.0
type NamespaceEvent struct { Type string `json:"type"` Namespace string `json:"namespace"` Phase string `json:"phase"` Status int `json:"status"` PodsStatus Pods `json:"pods_status"` }
NamespaceEvent represent a namespace event happened on kubernetes cluster
type NamespaceRepository ¶
type NamespaceRepository interface { Create(namespace string) error Get(namespace string) (*Namespace, error) ApplyConfig(namespace string, configPath string) error Delete(namespace string) error List() ([]Namespace, error) WatchPhase(emit EventEmitter) error }
NamespaceRepository defined the way namespace area actually managed.
type NamespaceService ¶
type NamespaceService interface { Create(namespace string) error ApplyConfig(namespace string, configPath string) error Delete(namespace string) error GetStatus(namespace string) (*NamespaceStatus, error) List() ([]Namespace, error) Events(listener string) chan NamespaceEvent AddListener(name string) RemoveListener(name string) error Emit(event NamespaceEvent) WatchNamespaces() }
NamespaceService defined the way namespace are managed.
func NewNamespaceService ¶
func NewNamespaceService(namespaces NamespaceRepository, pods PodRepository) NamespaceService
NewNamespaceService creates a new NamespaceService
type NamespaceStatus ¶ added in v0.4.0
NamespaceStatus represent namespace with percentage of pods running and status phase (Active or Terminating)
type Pod ¶
Pod represent a Kubernetes pod. The status is the pod phase status. It could be : * running * pending etc...
type PodRepository ¶
PodRepository represents the way Pods are managed
type PodService ¶
func NewPodService ¶
func NewPodService(pods PodRepository) PodService
NewPodService returns a new PodService
type Service ¶
type Service struct { Name string `json:"name"` Ports []Port `json:"ports"` Addr string `json:"addr"` }
Service represent a kubernetes service Name is the service name Addr is the domain name where the service can be reach from outside the kubernetes cluster. For ingress exposed services it is the domain name declared in the ingress configuration for node port exposed services it is the ip / domain name of the cluster.
type ServiceRepository ¶
type ServiceRepository interface { ListExternal(n string) ([]Service, error) ListIngress(n string) ([]Service, error) }
ServiceRepository defines the way to interact with Kubernetes
type ServiceService ¶
ServiceService defines the way kubernetes services are managed
func NewServiceService ¶
func NewServiceService(services ServiceRepository) ServiceService
NewServiceService returns a ServicesService