resource

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

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 Deployment added in v0.8.0

type Deployment struct {
	Name   string
	Status DeploymentStatus
}

type DeploymentRepository added in v0.8.0

type DeploymentRepository interface {
	List(namespace string) (Deployments, error)
}

type DeploymentStatus added in v0.8.0

type DeploymentStatus string
const (
	DeploymentReady    DeploymentStatus = "Ready"
	DeploymentNotReady DeploymentStatus = "NotReady"
)

type Deployments added in v0.8.0

type Deployments []Deployment

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 Job added in v0.8.0

type Job struct {
	Name   string
	Status JobStatus
}

type JobRepository added in v0.5.3

type JobRepository interface {
	Delete(namespace, resourceName string) error
	List(namespace string) (Jobs, 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 JobStatus added in v0.8.0

type JobStatus string
const (
	JobReady    JobStatus = "Ready"
	JobNotReady JobStatus = "NotReady"
)

type Jobs added in v0.8.0

type Jobs []Job

type Namespace

type Namespace struct {
	Name   string
	Phase  string
	Status int
}

type NamespaceEvent added in v0.4.0

type NamespaceEvent struct {
	Namespace string
	Type      string
}

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)
	Watch(events chan<- NamespaceEvent) 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)
	Watch(events chan NamespaceEvent)
}

NamespaceService defined the way namespace are managed.

func NewNamespaceService

func NewNamespaceService(
	namespaces NamespaceRepository,
	pods PodRepository,
	deployments DeploymentRepository,
	statefulsets StatefulsetRepository,
	jobs JobRepository,
) 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 Statefulset added in v0.8.0

type Statefulset struct {
	Name   string
	Status StatefulsetStatus
}

type StatefulsetRepository added in v0.8.0

type StatefulsetRepository interface {
	List(namespace string) (Statefulsets, error)
}

type StatefulsetStatus added in v0.8.0

type StatefulsetStatus string
const (
	StatefulsetReady    StatefulsetStatus = "Ready"
	StatefulsetNotReady StatefulsetStatus = "NotReady"
)

type Statefulsets added in v0.8.0

type Statefulsets []Statefulset

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