model

package
v0.272.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 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          schema.Ref
	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 {
	Module string
	Verb   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 SubscriberKey added in v0.233.0

type SubscriberKey = KeyType[SubscriberPayload, *SubscriberPayload]

func NewSubscriberKey added in v0.233.0

func NewSubscriberKey(module, subscription, sink string) SubscriberKey

func ParseSubscriberKey added in v0.233.0

func ParseSubscriberKey(key string) (SubscriberKey, error)

type SubscriberPayload added in v0.233.0

type SubscriberPayload struct {
	Module       string
	Subscription string
}

func (*SubscriberPayload) Kind added in v0.233.0

func (s *SubscriberPayload) Kind() string

func (*SubscriberPayload) Parse added in v0.233.0

func (s *SubscriberPayload) Parse(parts []string) error

func (*SubscriberPayload) RandomBytes added in v0.233.0

func (s *SubscriberPayload) RandomBytes() int

func (*SubscriberPayload) String added in v0.233.0

func (s *SubscriberPayload) String() string

type Subscription added in v0.241.0

type Subscription struct {
	Name   string
	Key    SubscriptionKey
	Topic  TopicKey
	Cursor optional.Option[TopicEventKey]
}

type SubscriptionKey added in v0.233.0

type SubscriptionKey = KeyType[SubscriptionPayload, *SubscriptionPayload]

func NewSubscriptionKey added in v0.233.0

func NewSubscriptionKey(module, name string) SubscriptionKey

func ParseSubscriptionKey added in v0.233.0

func ParseSubscriptionKey(key string) (SubscriptionKey, error)

type SubscriptionPayload added in v0.233.0

type SubscriptionPayload struct {
	Module string
	Name   string
}

func (*SubscriptionPayload) Kind added in v0.233.0

func (s *SubscriptionPayload) Kind() string

func (*SubscriptionPayload) Parse added in v0.233.0

func (s *SubscriptionPayload) Parse(parts []string) error

func (*SubscriptionPayload) RandomBytes added in v0.233.0

func (s *SubscriptionPayload) RandomBytes() int

func (*SubscriptionPayload) String added in v0.233.0

func (s *SubscriptionPayload) String() string

type TopicEventKey added in v0.239.0

type TopicEventKey = KeyType[TopicEventPayload, *TopicEventPayload]

func NewTopicEventKey added in v0.239.0

func NewTopicEventKey(module, topic string) TopicEventKey

func ParseTopicEventKey added in v0.239.0

func ParseTopicEventKey(key string) (TopicEventKey, error)

type TopicEventPayload added in v0.239.0

type TopicEventPayload struct {
	Module string
	Topic  string
}

func (*TopicEventPayload) Kind added in v0.239.0

func (t *TopicEventPayload) Kind() string

func (*TopicEventPayload) Parse added in v0.239.0

func (t *TopicEventPayload) Parse(parts []string) error

func (*TopicEventPayload) RandomBytes added in v0.239.0

func (t *TopicEventPayload) RandomBytes() int

func (*TopicEventPayload) String added in v0.239.0

func (t *TopicEventPayload) String() string

type TopicKey added in v0.233.0

type TopicKey = KeyType[TopicPayload, *TopicPayload]

func NewTopicKey added in v0.233.0

func NewTopicKey(module, name string) TopicKey

func ParseTopicKey added in v0.233.0

func ParseTopicKey(key string) (TopicKey, error)

type TopicPayload added in v0.233.0

type TopicPayload struct {
	Module string
	Name   string
}

func (*TopicPayload) Kind added in v0.233.0

func (t *TopicPayload) Kind() string

func (*TopicPayload) Parse added in v0.233.0

func (t *TopicPayload) Parse(parts []string) error

func (*TopicPayload) RandomBytes added in v0.233.0

func (t *TopicPayload) RandomBytes() int

func (*TopicPayload) String added in v0.233.0

func (t *TopicPayload) String() string

Jump to

Keyboard shortcuts

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