Documentation ¶
Index ¶
- Constants
- Variables
- func NewComponent(m map[string]interface{}) (component.Interface, error)
- func NewComponentFromJSON(data []byte) (component.Interface, error)
- type Container
- type ContainerBuild
- type ContainerBuildCommand
- type ContainerBuildSource
- type ContainerEnvironment
- type ContainerExec
- type ContainerHealthCheck
- type ContainerHealthCheckHTTP
- type ContainerPort
- type ContainerPortExternalAccess
- type ContainerResources
- type DockerImage
- type GitRepository
- type GitRepositoryReference
- type Job
- type NodePool
- type NodePoolOrReference
- type Reference
- type SecretRef
- type Service
- type System
- type ValueOrSecret
- type Workload
- type WorkloadContainers
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 ¶
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 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 DockerImage ¶
type GitRepository ¶
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 (*Job) UnmarshalJSON ¶
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 (*Reference) UnmarshalJSON ¶
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 (*Service) UnmarshalJSON ¶
type System ¶
type System struct { Description string Components map[string]component.Interface // FIXME: remove this NodePools map[string]NodePool }
func (*System) MarshalJSON ¶
func (*System) UnmarshalJSON ¶
type ValueOrSecret ¶
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 ¶
Click to show internal directories.
Click to hide internal directories.