model

package
v0.185.7 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	CronJobStateIdle      = "idle"
	CronJobStateExecuting = "executing"
)

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 CronJob added in v0.170.0

type CronJob struct {
	Key           CronJobKey
	DeploymentKey DeploymentKey
	Verb          VerbRef
	Schedule      string
	StartTime     time.Time
	NextExecution time.Time
	State         CronJobState
}

type CronJobKey added in v0.167.0

type CronJobKey = KeyType[CronJobPayload, *CronJobPayload]

func NewCronJobKey added in v0.167.0

func NewCronJobKey(module, verb string) CronJobKey

func ParseCronJobKey added in v0.167.0

func ParseCronJobKey(key string) (CronJobKey, error)

type CronJobPayload added in v0.167.0

type CronJobPayload struct {
	Ref string
}

func (*CronJobPayload) Kind added in v0.167.0

func (d *CronJobPayload) Kind() string

func (*CronJobPayload) Parse added in v0.167.0

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

func (*CronJobPayload) RandomBytes added in v0.167.0

func (d *CronJobPayload) RandomBytes() int

func (*CronJobPayload) String added in v0.167.0

func (d *CronJobPayload) String() string

type CronJobState added in v0.170.0

type CronJobState 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

type VerbRef added in v0.170.0

type VerbRef struct {
	Module string
	Name   string
}

func (VerbRef) String added in v0.170.0

func (v VerbRef) String() string

Jump to

Keyboard shortcuts

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