Documentation
¶
Index ¶
- type Container
- type ContainerFilesElem
- type ContainerProbe
- type ContainerResources
- type ContainerVariables
- type ContainerVolumesElem
- type HttpProbe
- type HttpProbeHttpHeadersElem
- type HttpProbeScheme
- type Resource
- type ResourceMetadata
- type ResourceParams
- type ResourceProperties
- type ResourcesLimits
- type ServicePort
- type WorkloadSpec
- type WorkloadSpecContainers
- type WorkloadSpecMetadata
- type WorkloadSpecResources
- type WorkloadSpecService
- type WorkloadSpecServicePorts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Container ¶
type Container struct { // If specified, overrides container entry point arguments. Args []string `json:"args,omitempty" yaml:"args,omitempty" mapstructure:"args,omitempty"` // If specified, overrides container entry point. Command []string `json:"command,omitempty" yaml:"command,omitempty" mapstructure:"command,omitempty"` // The extra files to mount. Files []ContainerFilesElem `json:"files,omitempty" yaml:"files,omitempty" mapstructure:"files,omitempty"` // The image name and tag. Image string `json:"image" yaml:"image" mapstructure:"image"` // The liveness probe for the container. LivenessProbe *ContainerProbe `json:"livenessProbe,omitempty" yaml:"livenessProbe,omitempty" mapstructure:"livenessProbe,omitempty"` // The readiness probe for the container. ReadinessProbe *ContainerProbe `json:"readinessProbe,omitempty" yaml:"readinessProbe,omitempty" mapstructure:"readinessProbe,omitempty"` // The compute resources for the container. Resources *ContainerResources `json:"resources,omitempty" yaml:"resources,omitempty" mapstructure:"resources,omitempty"` // The environment variables for the container. Variables ContainerVariables `json:"variables,omitempty" yaml:"variables,omitempty" mapstructure:"variables,omitempty"` // The volumes to mount. Volumes []ContainerVolumesElem `json:"volumes,omitempty" yaml:"volumes,omitempty" mapstructure:"volumes,omitempty"` }
The container name.
func (*Container) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type ContainerFilesElem ¶
type ContainerFilesElem struct { // The inline content for the file. Content interface{} `json:"content,omitempty" yaml:"content,omitempty" mapstructure:"content,omitempty"` // The file access mode. Mode *string `json:"mode,omitempty" yaml:"mode,omitempty" mapstructure:"mode,omitempty"` // If set to true, the placeholders expansion will not occur in the contents of // the file. NoExpand *bool `json:"noExpand,omitempty" yaml:"noExpand,omitempty" mapstructure:"noExpand,omitempty"` // The relative or absolute path to the content file. Source *string `json:"source,omitempty" yaml:"source,omitempty" mapstructure:"source,omitempty"` // The file path and name. Target string `json:"target" yaml:"target" mapstructure:"target"` }
func (*ContainerFilesElem) UnmarshalJSON ¶
func (j *ContainerFilesElem) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ContainerProbe ¶
type ContainerProbe struct { // HttpGet corresponds to the JSON schema field "httpGet". HttpGet *HttpProbe `json:"httpGet,omitempty" yaml:"httpGet,omitempty" mapstructure:"httpGet,omitempty"` }
type ContainerResources ¶
type ContainerResources struct { // The maximum allowed resources for the container. Limits *ResourcesLimits `json:"limits,omitempty" yaml:"limits,omitempty" mapstructure:"limits,omitempty"` // The minimal resources required for the container. Requests *ResourcesLimits `json:"requests,omitempty" yaml:"requests,omitempty" mapstructure:"requests,omitempty"` }
The compute resources for the container.
type ContainerVariables ¶
The environment variables for the container.
type ContainerVolumesElem ¶
type ContainerVolumesElem struct { // An optional sub path in the volume. Path *string `json:"path,omitempty" yaml:"path,omitempty" mapstructure:"path,omitempty"` // Indicates if the volume should be mounted in a read-only mode. ReadOnly *bool `json:"read_only,omitempty" yaml:"read_only,omitempty" mapstructure:"read_only,omitempty"` // The external volume reference. Source string `json:"source" yaml:"source" mapstructure:"source"` // The target mount on the container. Target string `json:"target" yaml:"target" mapstructure:"target"` }
func (*ContainerVolumesElem) UnmarshalJSON ¶
func (j *ContainerVolumesElem) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type HttpProbe ¶
type HttpProbe struct { // Host name to connect to. Defaults to the container IP. Host *string `json:"host,omitempty" yaml:"host,omitempty" mapstructure:"host,omitempty"` // Additional HTTP headers to send with the request HttpHeaders []HttpProbeHttpHeadersElem `json:"httpHeaders,omitempty" yaml:"httpHeaders,omitempty" mapstructure:"httpHeaders,omitempty"` // The path of the HTTP probe endpoint. Path string `json:"path" yaml:"path" mapstructure:"path"` // The path of the HTTP probe endpoint. Port *int `json:"port,omitempty" yaml:"port,omitempty" mapstructure:"port,omitempty"` // Scheme to use for connecting to the host (HTTP or HTTPS). Defaults to HTTP. Scheme *HttpProbeScheme `json:"scheme,omitempty" yaml:"scheme,omitempty" mapstructure:"scheme,omitempty"` }
An HTTP probe details.
func (*HttpProbe) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type HttpProbeScheme ¶
type HttpProbeScheme string
const HttpProbeSchemeHTTP HttpProbeScheme = "HTTP"
const HttpProbeSchemeHTTPS HttpProbeScheme = "HTTPS"
func (*HttpProbeScheme) UnmarshalJSON ¶
func (j *HttpProbeScheme) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type Resource ¶
type Resource struct { // A specialisation of the resource type. Class *string `json:"class,omitempty" yaml:"class,omitempty" mapstructure:"class,omitempty"` // The metadata for the resource. Metadata ResourceMetadata `json:"metadata,omitempty" yaml:"metadata,omitempty" mapstructure:"metadata,omitempty"` // The parameters used to validate or provision the resource in the environment. Params ResourceParams `json:"params,omitempty" yaml:"params,omitempty" mapstructure:"params,omitempty"` // DEPRECATED: The properties that can be referenced in other places in the Score // Specification file. Properties ResourceProperties `json:"properties,omitempty" yaml:"properties,omitempty" mapstructure:"properties,omitempty"` // The resource in the target environment. Type string `json:"type" yaml:"type" mapstructure:"type"` }
The resource name.
func (*Resource) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type ResourceParams ¶
type ResourceParams map[string]interface{}
The parameters used to validate or provision the resource in the environment.
type ResourceProperties ¶
type ResourceProperties map[string]interface{}
DEPRECATED: The properties that can be referenced in other places in the Score Specification file.
type ResourcesLimits ¶
type ResourcesLimits struct { // The CPU limit. Cpu *string `json:"cpu,omitempty" yaml:"cpu,omitempty" mapstructure:"cpu,omitempty"` // The memory limit. Memory *string `json:"memory,omitempty" yaml:"memory,omitempty" mapstructure:"memory,omitempty"` }
The compute resources limits.
type ServicePort ¶
type ServicePort struct { // The public service port. Port int `json:"port" yaml:"port" mapstructure:"port"` // The transport level protocol. Defaults to TCP. Protocol *string `json:"protocol,omitempty" yaml:"protocol,omitempty" mapstructure:"protocol,omitempty"` // The internal service port. This will default to 'port' if not provided. TargetPort *int `json:"targetPort,omitempty" yaml:"targetPort,omitempty" mapstructure:"targetPort,omitempty"` }
The network port description.
func (*ServicePort) UnmarshalJSON ¶
func (j *ServicePort) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type WorkloadSpec ¶
type WorkloadSpec struct { // The declared Score Specification version. ApiVersion string `json:"apiVersion" yaml:"apiVersion" mapstructure:"apiVersion"` // The declared Score Specification version. Containers WorkloadSpecContainers `json:"containers" yaml:"containers" mapstructure:"containers"` // The metadata description of the Workload. Metadata WorkloadSpecMetadata `json:"metadata" yaml:"metadata" mapstructure:"metadata"` // The dependencies needed by the Workload. Resources WorkloadSpecResources `json:"resources,omitempty" yaml:"resources,omitempty" mapstructure:"resources,omitempty"` // The service that the workload provides. Service *WorkloadSpecService `json:"service,omitempty" yaml:"service,omitempty" mapstructure:"service,omitempty"` }
Score workload specification
func ParseAndValidate ¶
func ParseAndValidate(content []byte) (*WorkloadSpec, error)
func (*WorkloadSpec) UnmarshalJSON ¶
func (j *WorkloadSpec) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type WorkloadSpecContainers ¶
The declared Score Specification version.
type WorkloadSpecMetadata ¶
type WorkloadSpecMetadata map[string]interface{}
The metadata description of the Workload.
type WorkloadSpecResources ¶
The dependencies needed by the Workload.
type WorkloadSpecService ¶
type WorkloadSpecService struct { // List of network ports published by the service. Ports WorkloadSpecServicePorts `json:"ports,omitempty" yaml:"ports,omitempty" mapstructure:"ports,omitempty"` }
The service that the workload provides.
type WorkloadSpecServicePorts ¶
type WorkloadSpecServicePorts map[string]ServicePort
List of network ports published by the service.