model

package
v0.166.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Artefact

type Artefact struct {
	Path       string
	Executable bool
	Digest     sha256.SHA256
	// ~Zero-cost on-demand reader.
	Content io.ReadCloser
}

type ControllerKey

type ControllerKey = KeyType[ControllerPayload, *ControllerPayload]

func NewControllerKey

func NewControllerKey(hostname, port string) ControllerKey

func NewLocalControllerKey added in v0.148.0

func NewLocalControllerKey(suffix int) ControllerKey

func ParseControllerKey

func ParseControllerKey(key string) (ControllerKey, error)

type ControllerPayload added in v0.165.1

type ControllerPayload struct {
	HostPortMixin
}

func (*ControllerPayload) Kind added in v0.165.1

func (c *ControllerPayload) Kind() string

type Deployment

type Deployment struct {
	Module    string
	Language  string
	Key       DeploymentKey
	Schema    *schema.Module
	Artefacts []*Artefact
}

func (*Deployment) Close

func (d *Deployment) Close() error

Close is a convenience function to close all artefacts.

type DeploymentKey added in v0.151.0

type DeploymentKey = KeyType[DeploymentPayload, *DeploymentPayload]

func NewDeploymentKey added in v0.151.0

func NewDeploymentKey(module string) DeploymentKey

func ParseDeploymentKey added in v0.151.0

func ParseDeploymentKey(key string) (DeploymentKey, error)

type DeploymentPayload added in v0.165.1

type DeploymentPayload struct {
	Module string
}

func (*DeploymentPayload) Kind added in v0.165.1

func (d *DeploymentPayload) Kind() string

func (*DeploymentPayload) Parse added in v0.165.1

func (d *DeploymentPayload) Parse(parts []string) error

func (*DeploymentPayload) RandomBytes added in v0.165.1

func (d *DeploymentPayload) RandomBytes() int

func (*DeploymentPayload) String added in v0.165.1

func (d *DeploymentPayload) String() string

type HostPortMixin added in v0.165.1

type HostPortMixin struct {
	Hostname optional.Option[string]
	Port     string
}

HostPortMixin is a mixin for keys that have an (optional) hostname and a port.

func (*HostPortMixin) Parse added in v0.165.1

func (h *HostPortMixin) Parse(parts []string) error

func (*HostPortMixin) RandomBytes added in v0.165.1

func (h *HostPortMixin) RandomBytes() int

func (*HostPortMixin) String added in v0.165.1

func (h *HostPortMixin) String() string

type KeyPayload added in v0.165.1

type KeyPayload interface {
	Kind() string
	String() string
	// Parse the hyphen-separated parts of the payload
	Parse(parts []string) error
	// RandomBytes determines the number of random bytes the key should include.
	RandomBytes() int
}

KeyPayload is an interface that all key payloads must implement.

type KeyType added in v0.165.1

type KeyType[T any, TP keyPayloadConstraint[T]] struct {
	Payload T
	Suffix  []byte
}

KeyType is a helper type to avoid having to write a bunch of boilerplate.

func (KeyType[T, TP]) Equal added in v0.165.1

func (d KeyType[T, TP]) Equal(other KeyType[T, TP]) bool

func (KeyType[T, TP]) IsZero added in v0.165.1

func (d KeyType[T, TP]) IsZero() bool

func (KeyType[T, TP]) Kind added in v0.165.1

func (d KeyType[T, TP]) Kind() string

func (KeyType[T, TP]) MarshalText added in v0.165.1

func (d KeyType[T, TP]) MarshalText() ([]byte, error)

func (*KeyType[T, TP]) Scan added in v0.165.1

func (d *KeyType[T, TP]) Scan(src any) error

Scan from DB representation.

func (KeyType[T, TP]) String added in v0.165.1

func (d KeyType[T, TP]) String() string

func (*KeyType[T, TP]) UnmarshalText added in v0.165.1

func (d *KeyType[T, TP]) UnmarshalText(bytes []byte) error

func (KeyType[T, TP]) Value added in v0.165.1

func (d KeyType[T, TP]) Value() (driver.Value, error)

type Labels

type Labels map[string]any

func (Labels) String

func (l Labels) String() string

type Origin

type Origin string

Origin of a request.

const (
	OriginIngress Origin = "ingress"
	OriginCron    Origin = "cron"
	OriginPubsub  Origin = "pubsub"
)

func ParseOrigin

func ParseOrigin(origin string) (Origin, error)

type RequestKey added in v0.165.1

A RequestKey represents an inbound request into the cluster.

func NewRequestKey added in v0.165.1

func NewRequestKey(origin Origin, key string) RequestKey

func ParseRequestKey added in v0.165.1

func ParseRequestKey(name string) (RequestKey, error)

type RequestKeyPayload added in v0.165.1

type RequestKeyPayload struct {
	Origin Origin
	Key    string
}

func (*RequestKeyPayload) Kind added in v0.165.1

func (r *RequestKeyPayload) Kind() string

func (*RequestKeyPayload) Parse added in v0.165.1

func (r *RequestKeyPayload) Parse(parts []string) error

func (*RequestKeyPayload) RandomBytes added in v0.165.1

func (r *RequestKeyPayload) RandomBytes() int

func (*RequestKeyPayload) String added in v0.165.1

func (r *RequestKeyPayload) String() string

type RunnerKey

type RunnerKey = KeyType[RunnerPayload, *RunnerPayload]

func NewLocalRunnerKey added in v0.148.0

func NewLocalRunnerKey(suffix int) RunnerKey

func NewRunnerKey

func NewRunnerKey(hostname, port string) RunnerKey

func ParseRunnerKey

func ParseRunnerKey(key string) (RunnerKey, error)

type RunnerPayload added in v0.165.1

type RunnerPayload struct {
	HostPortMixin
}

func (*RunnerPayload) Kind added in v0.165.1

func (r *RunnerPayload) Kind() string

Jump to

Keyboard shortcuts

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