Documentation
¶
Index ¶
- type Cluster
- type ClusterBuilder
- type Container
- func (c *Container) Args() []string
- func (c *Container) Build() Container
- func (c *Container) Command() []string
- func (c *Container) Image() string
- func (c *Container) Name() string
- func (c *Container) Ports() []Port
- func (c *Container) PullPolicy() string
- func (c *Container) SetArgs(args ...string) ContainerBuilder
- func (c *Container) SetCommand(command ...string) ContainerBuilder
- func (c *Container) SetImage(image string) ContainerBuilder
- func (c *Container) SetName(name string) ContainerBuilder
- func (c *Container) SetPorts(ports ...Port) ContainerBuilder
- func (c *Container) SetPullPolicy(pullPolicy string) ContainerBuilder
- type ContainerBuilder
- type Deployment
- func (d *Deployment) Build() Deployment
- func (d *Deployment) Labels() map[string]string
- func (d *Deployment) Name() string
- func (d *Deployment) Pod() Pod
- func (d *Deployment) Replicas() int32
- func (d *Deployment) SetLabels(labels map[string]string) DeploymentBuilder
- func (d *Deployment) SetName(name string) DeploymentBuilder
- func (d *Deployment) SetPods(pod Pod) DeploymentBuilder
- func (d *Deployment) SetReplicas(replicas int32) DeploymentBuilder
- type DeploymentBuilder
- type Pod
- type PodBuilder
- type Port
- type PullPolicy
- type ServiceBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster struct { Pods []Pod Deployments []Deployment // contains filtered or unexported fields }
Cluster k8s cluster type
func (*Cluster) CreateCluster ¶
func (*Cluster) SetDeployments ¶
func (c *Cluster) SetDeployments(deployments ...Deployment) ClusterBuilder
SetDeployments sets cluster deployments
func (*Cluster) SetPods ¶
func (c *Cluster) SetPods(pods ...Pod) ClusterBuilder
SetPods set cluster pods
type ClusterBuilder ¶
type ClusterBuilder interface { SetPods(...Pod) ClusterBuilder SetDeployments(...Deployment) ClusterBuilder Build() Cluster }
func NewCluster ¶
func NewCluster(namespace string) ClusterBuilder
NewCluster creates a new cluster builder
type Container ¶
type Container struct {
// contains filtered or unexported fields
}
Container container type defines an abstraction for containers
func (*Container) PullPolicy ¶
PullPolicy returns the pull policy
func (*Container) SetArgs ¶
func (c *Container) SetArgs(args ...string) ContainerBuilder
SetArgs sets a container arguments
func (*Container) SetCommand ¶
func (c *Container) SetCommand(command ...string) ContainerBuilder
SetCommand sets a container command
func (*Container) SetImage ¶
func (c *Container) SetImage(image string) ContainerBuilder
SetImage sets a container image
func (*Container) SetName ¶
func (c *Container) SetName(name string) ContainerBuilder
SetName sets a container name
func (*Container) SetPorts ¶
func (c *Container) SetPorts(ports ...Port) ContainerBuilder
SetPorts sets a container ports
func (*Container) SetPullPolicy ¶
func (c *Container) SetPullPolicy(pullPolicy string) ContainerBuilder
SetPullPolicy sets pull policy for a container
type ContainerBuilder ¶
type ContainerBuilder interface { SetName(string) ContainerBuilder SetImage(string) ContainerBuilder SetArgs(...string) ContainerBuilder SetCommand(...string) ContainerBuilder SetPullPolicy(string) ContainerBuilder SetPorts(...Port) ContainerBuilder Build() Container }
ContainerBuilder container builder interface
func NewContainer ¶
func NewContainer() ContainerBuilder
NewContainer creates a new container builder
type Deployment ¶
type Deployment struct {
// contains filtered or unexported fields
}
Deployment deployment abstraction
func (*Deployment) Labels ¶
func (d *Deployment) Labels() map[string]string
Labels return deployment labels
func (*Deployment) Replicas ¶
func (d *Deployment) Replicas() int32
Replicas returns the number of deployment replicas
func (*Deployment) SetLabels ¶
func (d *Deployment) SetLabels(labels map[string]string) DeploymentBuilder
SetLabels sets the labels for the service
func (*Deployment) SetName ¶
func (d *Deployment) SetName(name string) DeploymentBuilder
SetName sets a deployment name
func (*Deployment) SetPods ¶
func (d *Deployment) SetPods(pod Pod) DeploymentBuilder
SetPods sets deployment pod
func (*Deployment) SetReplicas ¶
func (d *Deployment) SetReplicas(replicas int32) DeploymentBuilder
SetReplicas sets deployment replicas
type DeploymentBuilder ¶
type DeploymentBuilder interface { SetName(string) DeploymentBuilder SetPods(Pod) DeploymentBuilder SetReplicas(int32) DeploymentBuilder SetLabels(map[string]string) DeploymentBuilder Build() Deployment }
type Pod ¶
type Pod struct {
// contains filtered or unexported fields
}
Pod defines a pod object
func (*Pod) SetContainers ¶
func (p *Pod) SetContainers(containers ...Container) PodBuilder
func (*Pod) SetName ¶
func (p *Pod) SetName(name string) PodBuilder
type PodBuilder ¶
type PodBuilder interface { SetName(string) PodBuilder SetContainers(...Container) PodBuilder Build() Pod }
PodBuilder pod builder interface
type PullPolicy ¶
type PullPolicy int
PullPolicy pull policy type
const ( Always PullPolicy = iota IfNotPresent Never )
func (PullPolicy) String ¶
func (p PullPolicy) String() string
type ServiceBuilder ¶
type ServiceBuilder interface { }