resource

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
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 ClusterRepository interface {
	GetVersion() (*Version, error)
}

type ClusterService added in v0.4.3

type ClusterService interface {
	GetVersion() (*Version, error)
}

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 JobRepository interface {
	Delete(namespace, resourceName string) error
}

type JobService added in v0.5.3

type JobService interface {
	Delete(namespace, resourceName string) error
}

func NewJobService added in v0.5.3

func NewJobService(job JobRepository) JobService

type Namespace

type Namespace struct {
	Name   string
	Phase  string
	Status int
}

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

type NamespaceStatus struct {
	Status int    `json:"status"`
	Phase  string `json:"phase"`
}

NamespaceStatus represent namespace with percentage of pods running and status phase (Active or Terminating)

type Pod

type Pod struct {
	Name   string
	Status v1.PodPhase
}

Pod represent a Kubernetes pod. The status is the pod phase status. It could be : * running * pending etc...

type PodRepository

type PodRepository interface {
	List(string) (Pods, error)
}

PodRepository represents the way Pods are managed

type PodService

type PodService interface {
	List(string) (Pods, error)
}

func NewPodService

func NewPodService(pods PodRepository) PodService

NewPodService returns a new PodService

type Pods

type Pods []Pod

Pods represent a list of pods.

type Port

type Port struct {
	Port        int32 `json:"port"`
	ExposedPort int32 `json:"exposedPort"`
}

Port represent a kubernetes service port. This mean an internal port and a exposed port

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

type ServiceService interface {
	ListExposed(namespace string) ([]Service, error)
}

ServiceService defines the way kubernetes services are managed

func NewServiceService

func NewServiceService(services ServiceRepository) ServiceService

NewServiceService returns a ServicesService

type Version added in v0.4.3

type Version struct {
	ClientVersion struct {
		Major string `json:"major"`
		Minor string `json:"minor"`
	} `json:"clientVersion"`
	ServerVersion struct {
		Major string `json:"major"`
		Minor string `json:"minor"`
	} `json:"serverVersion"`
}

Jump to

Keyboard shortcuts

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