v1

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ComponentTypeContainer        = "container"
	ContainerBuildTypeCommand     = "command_build"
	ContainerBuildTypeDockerImage = "docker_image"
)
View Source
const APIVersion = "v1"
View Source
const ComponentTypeJob = "job"
View Source
const ComponentTypeReference = "reference"
View Source
const ComponentTypeService = "service"
View Source
const ComponentTypeSystem = "system"
View Source
const (
	SystemDefinitionRootPathDefault = "system.json"
)

Variables

View Source
var ContainerType = component.Type{
	APIVersion: APIVersion,
	Type:       ComponentTypeContainer,
}
View Source
var JobType = component.Type{
	APIVersion: APIVersion,
	Type:       ComponentTypeJob,
}
View Source
var ReferenceType = component.Type{
	APIVersion: APIVersion,
	Type:       ComponentTypeReference,
}
View Source
var ServiceType = component.Type{
	APIVersion: APIVersion,
	Type:       ComponentTypeService,
}
View Source
var SystemType = component.Type{
	APIVersion: APIVersion,
	Type:       ComponentTypeSystem,
}

Functions

func NewComponent

func NewComponent(m map[string]interface{}) (component.Interface, error)

func NewComponentFromJSON

func NewComponentFromJSON(data []byte) (component.Interface, error)

Types

type Container

type Container struct {
	Build *ContainerBuild `json:"build,omitempty"`
	Exec  *ContainerExec  `json:"exec,omitempty"`

	Ports map[int32]ContainerPort `json:"ports,omitempty"`

	HealthCheck *ContainerHealthCheck `json:"health_check,omitempty"`

	Resources *ContainerResources `json:"resources,omitempty"`
}

type ContainerBuild

type ContainerBuild struct {
	CommandBuild *ContainerBuildCommand
	DockerImage  *DockerImage
}

func (*ContainerBuild) MarshalJSON

func (b *ContainerBuild) MarshalJSON() ([]byte, error)

func (*ContainerBuild) UnmarshalJSON

func (b *ContainerBuild) UnmarshalJSON(data []byte) error

type ContainerBuildCommand

type ContainerBuildCommand struct {
	Source      *ContainerBuildSource `json:"source,omitempty"`
	BaseImage   DockerImage           `json:"base_image"`
	Command     []string              `json:"command,omitempty"`
	Environment ContainerEnvironment  `json:"environment,omitempty"`
}

type ContainerBuildSource

type ContainerBuildSource struct {
	GitRepository *GitRepository `json:"git_repository"`
}

type ContainerEnvironment

type ContainerEnvironment map[string]ValueOrSecret

type ContainerExec

type ContainerExec struct {
	Command     []string             `json:"command"`
	Environment ContainerEnvironment `json:"environment,omitempty"`
}

type ContainerHealthCheck

type ContainerHealthCheck struct {
	HTTP *ContainerHealthCheckHTTP `json:"http,omitempty"`
}

type ContainerHealthCheckHTTP

type ContainerHealthCheckHTTP struct {
	Path string `json:"path"`
	Port int32  `json:"port"`
}

type ContainerPort

type ContainerPort struct {
	Protocol       string                       `json:"protocol"`
	ExternalAccess *ContainerPortExternalAccess `json:"external_access,omitempty"`
}

func (ContainerPort) Public

func (c ContainerPort) Public() bool

type ContainerPortExternalAccess

type ContainerPortExternalAccess struct {
	Public bool `json:"public"`
}

type ContainerResources

type ContainerResources struct {
	Memory string `json:"memory"`
	CPU    string `json:"cpu"`
}

type DockerImage

type DockerImage struct {
	Registry   string `json:"registry,omitempty"`
	Repository string `json:"repository"`
	Tag        string `json:"tag"`
}

type GitRepository

type GitRepository struct {
	URL string `json:"url"`

	Branch  *string `json:"branch,omitempty"`
	Commit  *string `json:"commit,omitempty"`
	Tag     *string `json:"tag,omitempty"`
	Version *string `json:"version,omitempty"`

	SSHKey *SecretRef `json:"ssh_key,omitempty"`
}

type GitRepositoryReference

type GitRepositoryReference struct {
	File *string `json:"file"`
	*GitRepository
}

type Job

type Job struct {
	Description string

	Container
	Sidecars map[string]Container

	// FIXME: remove these
	NodePool tree.PathSubcomponent `json:"node_pool"`
}

func (*Job) Containers

func (j *Job) Containers() *WorkloadContainers

func (*Job) MarshalJSON

func (j *Job) MarshalJSON() ([]byte, error)

func (*Job) Type

func (j *Job) Type() component.Type

func (*Job) UnmarshalJSON

func (j *Job) UnmarshalJSON(data []byte) error

type NodePool

type NodePool struct {
	NumInstances int32  `json:"num_instances"`
	InstanceType string `json:"instance_type"`
}

type NodePoolOrReference

type NodePoolOrReference struct {
	NodePool     *NodePool
	NodePoolPath *tree.PathSubcomponent
}

func (*NodePoolOrReference) MarshalJSON

func (np *NodePoolOrReference) MarshalJSON() ([]byte, error)

func (*NodePoolOrReference) UnmarshalJSON

func (np *NodePoolOrReference) UnmarshalJSON(data []byte) error

type Reference

type Reference struct {
	GitRepository *GitRepositoryReference
	File          *string

	Parameters map[string]interface{}
}

func (*Reference) MarshalJSON

func (r *Reference) MarshalJSON() ([]byte, error)

func (*Reference) Type

func (r *Reference) Type() component.Type

func (*Reference) UnmarshalJSON

func (r *Reference) UnmarshalJSON(data []byte) error

type SecretRef

type SecretRef struct {
	Value tree.PathSubcomponent `json:"$secret_ref"`
}

type Service

type Service struct {
	Description string

	Container
	Sidecars map[string]Container

	// FIXME: remove these
	NumInstances int32
	NodePool     *NodePoolOrReference
	InstanceType *string
}

func (*Service) ContainerPorts

func (s *Service) ContainerPorts() map[int32]ContainerPort

func (*Service) Containers

func (s *Service) Containers() *WorkloadContainers

func (*Service) MarshalJSON

func (s *Service) MarshalJSON() ([]byte, error)

func (*Service) Type

func (s *Service) Type() component.Type

func (*Service) UnmarshalJSON

func (s *Service) UnmarshalJSON(data []byte) error

type System

type System struct {
	Description string

	Components map[string]component.Interface
	// FIXME: remove this
	NodePools map[string]NodePool
}

func (*System) MarshalJSON

func (s *System) MarshalJSON() ([]byte, error)

func (*System) Type

func (s *System) Type() component.Type

func (*System) UnmarshalJSON

func (s *System) UnmarshalJSON(data []byte) error

type ValueOrSecret

type ValueOrSecret struct {
	Value     *string
	SecretRef *SecretRef
}

ValueOrSecret contains either a value (i.e. just a string value), or a Secret.

func (ValueOrSecret) MarshalJSON

func (v ValueOrSecret) MarshalJSON() ([]byte, error)

func (*ValueOrSecret) UnmarshalJSON

func (v *ValueOrSecret) UnmarshalJSON(data []byte) error

type Workload

type Workload interface {
	Containers() *WorkloadContainers
}

type WorkloadContainers

type WorkloadContainers struct {
	Main     Container            `json:"main"`
	Sidecars map[string]Container `json:"sidecars"`
}

Jump to

Keyboard shortcuts

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