content

package
v0.0.0-...-4786a4a Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StoneTpl = `` /* 4124-byte string literal not displayed */

	DeploymentTpl = `` /* 2394-byte string literal not displayed */

	ServiceTpl = `` /* 481-byte string literal not displayed */

)
View Source
const (
	TCP Protocol = "tcp"
	UDP Protocol = "udp"

	IfNotPresent ImagePullPolicy = "IfNotPresent"
	Always       ImagePullPolicy = "Always"

	ClusterIP ServiceType = "ClusterIP"
	NodePort  ServiceType = "NodePort"
)

Variables

This section is empty.

Functions

func Render

func Render(data interface{}, tpl string) (*unstructured.Unstructured, error)

Types

type ContainerModel

type ContainerModel interface {
	AddCommand(commands ...string) ContainerModel
	AddArgs(args ...string) ContainerModel
	AddEnvironment(name, value string) ContainerModel
	AddResourceLimits(cpuLimit int64, memoryLimit int64, cpuRequest int64, memoryRequest int64) ContainerModel
	AddResourceLimits2(cpuLimit, memoryLimit, cpuRequest, memoryRequest string) ContainerModel
	AddVolumeMounts(name, mountPath, subPath string) ContainerModel
	SetImagePullPolicy(policy ImagePullPolicy) ContainerModel
	Set(name, image string)
	GetName() string
}

type ContainerModelImpl

type ContainerModelImpl map[string]interface{}

func NewContainerModelImpl

func NewContainerModelImpl() ContainerModelImpl

func (ContainerModelImpl) AddArgs

func (c ContainerModelImpl) AddArgs(args ...string) ContainerModel

func (ContainerModelImpl) AddCommand

func (c ContainerModelImpl) AddCommand(commands ...string) ContainerModel

func (ContainerModelImpl) AddEnvironment

func (c ContainerModelImpl) AddEnvironment(name, value string) ContainerModel

func (ContainerModelImpl) AddResourceLimits

func (c ContainerModelImpl) AddResourceLimits(cpuLimit int64, memoryLimit int64, cpuRequest int64, memoryRequest int64) ContainerModel

func (ContainerModelImpl) AddResourceLimits2

func (c ContainerModelImpl) AddResourceLimits2(cpuLimit string, memoryLimit string, cpuRequest string, memoryRequest string) ContainerModel

func (ContainerModelImpl) AddVolumeMounts

func (c ContainerModelImpl) AddVolumeMounts(name, mountPath, subPath string) ContainerModel

func (ContainerModelImpl) GetName

func (c ContainerModelImpl) GetName() string

func (ContainerModelImpl) Set

func (c ContainerModelImpl) Set(name, image string)

func (ContainerModelImpl) SetImagePullPolicy

func (c ContainerModelImpl) SetImagePullPolicy(policy ImagePullPolicy) ContainerModel

type ContainerModels

type ContainerModels []ContainerModel

func (ContainerModels) Get

func (cs ContainerModels) Get(name string) ContainerModel

func (ContainerModels) Index

func (cs ContainerModels) Index(c ContainerModel) int

func (*ContainerModels) Set

func (cs *ContainerModels) Set(c ContainerModel)

type CoordinateModel

type CoordinateModel interface {
	AddReplicas(n int) CoordinateModel
	AddZoneSet(zone, rack, host string) CoordinateModel
	GetName() string
	Set(name string)
}

func NewCoordinateModel

func NewCoordinateModel() CoordinateModel

type CoordinateModelImpl

type CoordinateModelImpl map[string]interface{}

func (CoordinateModelImpl) AddReplicas

func (c CoordinateModelImpl) AddReplicas(n int) CoordinateModel

func (CoordinateModelImpl) AddZoneSet

func (c CoordinateModelImpl) AddZoneSet(zone, rack, host string) CoordinateModel

func (CoordinateModelImpl) GetName

func (c CoordinateModelImpl) GetName() string

func (CoordinateModelImpl) Set

func (c CoordinateModelImpl) Set(name string)

type CoordinateModels

type CoordinateModels []CoordinateModel

func (CoordinateModels) Get

func (CoordinateModels) Index

func (*CoordinateModels) Set

type Environments

type Environments []map[string]string

func (*Environments) Set

func (e *Environments) Set(name, value string)

type ImagePullPolicy

type ImagePullPolicy = string

type Output

type Output struct{ Data []byte }

func (*Output) Write

func (o *Output) Write(p []byte) (n int, err error)

type Protocol

type Protocol = string

type ServiceModel

type ServiceModel interface {
	AddServiceSpec2(protocol Protocol, port, targetPort string)
	AddServiceSpec(protocol Protocol, port int, targetPort int)
	AddServiceType(serviceType ServiceType)
	GetName() string
}

func NewServiceModel

func NewServiceModel() ServiceModel

type ServiceModelImpl

type ServiceModelImpl map[string]string

func (ServiceModelImpl) AddServiceSpec

func (s ServiceModelImpl) AddServiceSpec(protocol Protocol, port int, targetPort int)

func (ServiceModelImpl) AddServiceSpec2

func (s ServiceModelImpl) AddServiceSpec2(protocol Protocol, port, targetPort string)

func (ServiceModelImpl) AddServiceType

func (s ServiceModelImpl) AddServiceType(serviceType ServiceType)

func (ServiceModelImpl) GetName

func (s ServiceModelImpl) GetName() string

type ServiceModels

type ServiceModels []ServiceModel

func (ServiceModels) Get

func (s ServiceModels) Get(name string) ServiceModel

func (ServiceModels) Index

func (s ServiceModels) Index(name string) int

func (*ServiceModels) Set

func (s *ServiceModels) Set(name string, c ServiceModel)

type ServiceType

type ServiceType = string

type TemplateModel

type TemplateModel interface {
	AddMetadata(namespace, name, uuid string) TemplateModel
	AddContainer(name, image string) ContainerModel
	AddVolumes(name string) VolumeModel
	AddService(name string, serviceType ServiceType) ServiceModel
	AddCoordinate(group string) CoordinateModel
	AddImagePullSecrets(names ...string)
	AddVolumeClaimTemplate(metadataName, storageClass string, size int64)
}

func NewTemplateModel

func NewTemplateModel() TemplateModel

type TemplateModelImpl

type TemplateModelImpl map[string]interface{}

func (TemplateModelImpl) AddContainer

func (d TemplateModelImpl) AddContainer(name, image string) ContainerModel

func (TemplateModelImpl) AddCoordinate

func (d TemplateModelImpl) AddCoordinate(group string) CoordinateModel

func (TemplateModelImpl) AddImagePullSecrets

func (d TemplateModelImpl) AddImagePullSecrets(names ...string)

func (TemplateModelImpl) AddMetadata

func (d TemplateModelImpl) AddMetadata(namespace, name, uuid string) TemplateModel

func (TemplateModelImpl) AddService

func (d TemplateModelImpl) AddService(name string, serviceType ServiceType) ServiceModel

func (TemplateModelImpl) AddVolumeClaimTemplate

func (d TemplateModelImpl) AddVolumeClaimTemplate(metadataName, storageClass string, size int64)

func (TemplateModelImpl) AddVolumes

func (d TemplateModelImpl) AddVolumes(name string) VolumeModel

type VolumeClaimTemplateModel

type VolumeClaimTemplateModel interface {
	AddVolumeClaimTemplate(metadataName, storageClass string, size int64)
	GetName() string
}

func NewVolumeClaimTemplateModel

func NewVolumeClaimTemplateModel() VolumeClaimTemplateModel

type VolumeClaimTemplateModelImpl

type VolumeClaimTemplateModelImpl map[string]string

func (VolumeClaimTemplateModelImpl) AddVolumeClaimTemplate

func (v VolumeClaimTemplateModelImpl) AddVolumeClaimTemplate(metadataName, storageClass string, size int64)

func (VolumeClaimTemplateModelImpl) GetName

type VolumeClaimTemplateModels

type VolumeClaimTemplateModels []VolumeClaimTemplateModel

func (VolumeClaimTemplateModels) Get

func (VolumeClaimTemplateModels) Index

func (*VolumeClaimTemplateModels) Set

type VolumeModel

type VolumeModel interface {
	AddConfigMap(itemName, itemKey, itemPath string)
	AddSecret(itemName, itemKey, itemPath string)
	SetName(string) VolumeModel
	GetName() string
}

func NewVolumeModel

func NewVolumeModel() VolumeModel

type VolumeModelImpl

type VolumeModelImpl map[string]interface{}

func (VolumeModelImpl) AddConfigMap

func (v VolumeModelImpl) AddConfigMap(itemName, itemKey, itemPath string)

func (VolumeModelImpl) AddSecret

func (v VolumeModelImpl) AddSecret(itemName, itemKey, itemPath string)

func (VolumeModelImpl) GetName

func (v VolumeModelImpl) GetName() string

func (VolumeModelImpl) SetName

func (v VolumeModelImpl) SetName(name string) VolumeModel

type VolumeModels

type VolumeModels []VolumeModel

func (VolumeModels) Get

func (v VolumeModels) Get(name string) VolumeModel

func (VolumeModels) Index

func (v VolumeModels) Index(c VolumeModel) int

func (*VolumeModels) Set

func (v *VolumeModels) Set(c VolumeModel)

type VolumeMounts

type VolumeMounts []map[string]string

func (*VolumeMounts) Set

func (e *VolumeMounts) Set(name, mountPath, subPath string)

Jump to

Keyboard shortcuts

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