types

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: Apache-2.0 Imports: 3 Imported by: 11 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Container added in v1.0.2

type Container struct {
	// If specified, overrides the arguments passed to the container entrypoint.
	Args []string `json:"args,omitempty" yaml:"args,omitempty" mapstructure:"args,omitempty"`

	// If specified, overrides the entrypoint defined in the container image.
	Command []string `json:"command,omitempty" yaml:"command,omitempty" mapstructure:"command,omitempty"`

	// The extra files to mount into the container.
	Files []ContainerFilesElem `json:"files,omitempty" yaml:"files,omitempty" mapstructure:"files,omitempty"`

	// The container 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 specification of a Container within the Workload.

func (*Container) UnmarshalJSON added in v1.0.2

func (j *Container) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ContainerFilesElem added in v1.0.2

type ContainerFilesElem struct {
	// The inline content for the file.
	Content *string `json:"content,omitempty" yaml:"content,omitempty" mapstructure:"content,omitempty"`

	// The optional file access mode in octal encoding. For example 0600.
	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 to expose in the container.
	Target string `json:"target" yaml:"target" mapstructure:"target"`
}

func (*ContainerFilesElem) UnmarshalJSON added in v1.0.2

func (j *ContainerFilesElem) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ContainerProbe added in v1.0.2

type ContainerProbe struct {
	// HttpGet corresponds to the JSON schema field "httpGet".
	HttpGet HttpProbe `json:"httpGet" yaml:"httpGet" mapstructure:"httpGet"`
}

func (*ContainerProbe) UnmarshalJSON added in v1.1.0

func (j *ContainerProbe) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ContainerResources added in v1.0.2

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 added in v1.0.2

type ContainerVariables map[string]string

The environment variables for the container.

type ContainerVolumesElem added in v1.0.2

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:"readOnly,omitempty" yaml:"readOnly,omitempty" mapstructure:"readOnly,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 added in v1.0.2

func (j *ContainerVolumesElem) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type HttpProbe added in v1.0.2

type HttpProbe struct {
	// Host name to connect to. Defaults to the workload IP. The is equivalent to a
	// Host HTTP header.
	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 to access on the HTTP server.
	Path string `json:"path" yaml:"path" mapstructure:"path"`

	// The port to access on the workload.
	Port int `json:"port" yaml:"port" mapstructure:"port"`

	// 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 added in v1.0.2

func (j *HttpProbe) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type HttpProbeHttpHeadersElem added in v1.0.2

type HttpProbeHttpHeadersElem struct {
	// The HTTP header name.
	Name string `json:"name" yaml:"name" mapstructure:"name"`

	// The HTTP header value.
	Value string `json:"value" yaml:"value" mapstructure:"value"`
}

func (*HttpProbeHttpHeadersElem) UnmarshalJSON added in v1.2.0

func (j *HttpProbeHttpHeadersElem) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type HttpProbeScheme added in v1.0.2

type HttpProbeScheme string
const HttpProbeSchemeHTTP HttpProbeScheme = "HTTP"
const HttpProbeSchemeHTTPS HttpProbeScheme = "HTTPS"

func (*HttpProbeScheme) UnmarshalJSON added in v1.0.2

func (j *HttpProbeScheme) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type Resource added in v1.0.2

type Resource struct {
	// An optional specialisation of the Resource type.
	Class *string `json:"class,omitempty" yaml:"class,omitempty" mapstructure:"class,omitempty"`

	// An optional Resource identifier. The id may be up to 63 characters, including
	// one or more labels of a-z, 0-9, '-' not starting or ending with '-' separated
	// by '.'. When two resources share the same type, class, and id, they are
	// considered the same resource when used across related Workloads.
	Id *string `json:"id,omitempty" yaml:"id,omitempty" mapstructure:"id,omitempty"`

	// The metadata for the Resource.
	Metadata ResourceMetadata `json:"metadata,omitempty" yaml:"metadata,omitempty" mapstructure:"metadata,omitempty"`

	// Optional parameters used to provision the Resource in the environment.
	Params ResourceParams `json:"params,omitempty" yaml:"params,omitempty" mapstructure:"params,omitempty"`

	// The Resource type. This should be a type supported by the Score implementations
	// being used.
	Type string `json:"type" yaml:"type" mapstructure:"type"`
}

The set of Resources associated with this Workload.

func (*Resource) UnmarshalJSON added in v1.0.2

func (j *Resource) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ResourceMetadata added in v1.0.2

type ResourceMetadata map[string]interface{}

The metadata for the Resource.

func (*ResourceMetadata) UnmarshalYAML added in v1.7.2

func (m *ResourceMetadata) UnmarshalYAML(unmarshal func(interface{}) error) error

type ResourceParams added in v1.0.2

type ResourceParams map[string]interface{}

Optional parameters used to provision the Resource in the environment.

type ResourcesLimits added in v1.0.2

type ResourcesLimits struct {
	// The CPU limit as whole or fractional CPUs. 'm' indicates milli-CPUs. For
	// example 2 or 125m.
	Cpu *string `json:"cpu,omitempty" yaml:"cpu,omitempty" mapstructure:"cpu,omitempty"`

	// The memory limit in bytes with optional unit specifier. For example 125M or
	// 1Gi.
	Memory *string `json:"memory,omitempty" yaml:"memory,omitempty" mapstructure:"memory,omitempty"`
}

The compute and memory resource limits.

type ServicePort added in v1.0.2

type ServicePort struct {
	// The public service port.
	Port int `json:"port" yaml:"port" mapstructure:"port"`

	// The transport level protocol. Defaults to TCP.
	Protocol *ServicePortProtocol `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 added in v1.0.2

func (j *ServicePort) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ServicePortProtocol added in v1.1.0

type ServicePortProtocol string
const ServicePortProtocolTCP ServicePortProtocol = "TCP"
const ServicePortProtocolUDP ServicePortProtocol = "UDP"

func (*ServicePortProtocol) UnmarshalJSON added in v1.1.0

func (j *ServicePortProtocol) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type Workload added in v1.0.2

type Workload struct {
	// The declared Score Specification version.
	ApiVersion string `json:"apiVersion" yaml:"apiVersion" mapstructure:"apiVersion"`

	// The set of named containers in the Workload. The container name must be a valid
	// RFC1123 Label Name of up to 63 characters, including a-z, 0-9, '-' but may not
	// start or end with '-'.
	Containers WorkloadContainers `json:"containers" yaml:"containers" mapstructure:"containers"`

	// The metadata description of the Workload.
	Metadata WorkloadMetadata `json:"metadata" yaml:"metadata" mapstructure:"metadata"`

	// The Resource dependencies needed by the Workload. The resource name must be a
	// valid RFC1123 Label Name of up to 63 characters, including a-z, 0-9, '-' but
	// may not start or end with '-'.
	Resources WorkloadResources `json:"resources,omitempty" yaml:"resources,omitempty" mapstructure:"resources,omitempty"`

	// The service that the workload provides.
	Service *WorkloadService `json:"service,omitempty" yaml:"service,omitempty" mapstructure:"service,omitempty"`
}

Score workload specification

func (*Workload) UnmarshalJSON added in v1.0.2

func (j *Workload) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type WorkloadContainers added in v1.0.2

type WorkloadContainers map[string]Container

The set of named containers in the Workload. The container name must be a valid RFC1123 Label Name of up to 63 characters, including a-z, 0-9, '-' but may not start or end with '-'.

type WorkloadMetadata added in v1.0.2

type WorkloadMetadata map[string]interface{}

The metadata description of the Workload.

func (*WorkloadMetadata) UnmarshalYAML added in v1.7.2

func (m *WorkloadMetadata) UnmarshalYAML(unmarshal func(interface{}) error) error

type WorkloadResources added in v1.0.2

type WorkloadResources map[string]Resource

The Resource dependencies needed by the Workload. The resource name must be a valid RFC1123 Label Name of up to 63 characters, including a-z, 0-9, '-' but may not start or end with '-'.

type WorkloadService added in v1.0.2

type WorkloadService struct {
	// The set of named network ports published by the service. The service name must
	// be a valid RFC1123 Label Name of up to 63 characters, including a-z, 0-9, '-'
	// but may not start or end with '-'.
	Ports WorkloadServicePorts `json:"ports,omitempty" yaml:"ports,omitempty" mapstructure:"ports,omitempty"`
}

The service that the workload provides.

type WorkloadServicePorts added in v1.0.2

type WorkloadServicePorts map[string]ServicePort

The set of named network ports published by the service. The service name must be a valid RFC1123 Label Name of up to 63 characters, including a-z, 0-9, '-' but may not start or end with '-'.

Jump to

Keyboard shortcuts

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