model

package
v0.412.3 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 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
}

type ControllerKey

type ControllerKey = KeyType[ControllerPayload, *ControllerPayload]

func NewControllerKey

func NewControllerKey(hostname, port string) ControllerKey

func NewLocalControllerKey

func NewLocalControllerKey(suffix int) ControllerKey

func ParseControllerKey

func ParseControllerKey(key string) (ControllerKey, error)

type ControllerPayload

type ControllerPayload struct {
	HostPortMixin
}

func (*ControllerPayload) Kind

func (c *ControllerPayload) Kind() string

type CronJob

type CronJob struct {
	Key           CronJobKey
	DeploymentKey DeploymentKey
	Verb          schema.Ref
	Schedule      string
	StartTime     time.Time
	NextExecution time.Time
	LastExecution optional.Option[time.Time]
}

type CronJobKey

type CronJobKey = KeyType[CronJobPayload, *CronJobPayload]

func NewCronJobKey

func NewCronJobKey(module, verb string) CronJobKey

func ParseCronJobKey

func ParseCronJobKey(key string) (CronJobKey, error)

type CronJobPayload

type CronJobPayload struct {
	Module string
	Verb   string
}

func (*CronJobPayload) Kind

func (d *CronJobPayload) Kind() string

func (*CronJobPayload) Parse

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

func (*CronJobPayload) RandomBytes

func (d *CronJobPayload) RandomBytes() int

func (*CronJobPayload) String

func (d *CronJobPayload) String() string

type Deployment

type Deployment struct {
	Module   string
	Language string
	Key      DeploymentKey
	Schema   *schema.Module
}

type DeploymentKey

type DeploymentKey = KeyType[DeploymentPayload, *DeploymentPayload]

func NewDeploymentKey

func NewDeploymentKey(module string) DeploymentKey

func ParseDeploymentKey

func ParseDeploymentKey(key string) (DeploymentKey, error)

type DeploymentPayload

type DeploymentPayload struct {
	Module string
}

func (*DeploymentPayload) Kind

func (d *DeploymentPayload) Kind() string

func (*DeploymentPayload) Parse

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

func (*DeploymentPayload) RandomBytes

func (d *DeploymentPayload) RandomBytes() int

func (*DeploymentPayload) String

func (d *DeploymentPayload) String() string

type HostPortMixin

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

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

func (*HostPortMixin) RandomBytes

func (h *HostPortMixin) RandomBytes() int

func (*HostPortMixin) String

func (h *HostPortMixin) String() string

type KeyPayload

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

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

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

func (KeyType[T, TP]) GoString

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

func (KeyType[T, TP]) IsZero

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

func (KeyType[T, TP]) Kind

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

func (KeyType[T, TP]) MarshalText

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

func (*KeyType[T, TP]) Scan

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

Scan from DB representation.

func (KeyType[T, TP]) String

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

func (*KeyType[T, TP]) UnmarshalText

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

func (KeyType[T, TP]) Value

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

A RequestKey represents an inbound request into the cluster.

func NewRequestKey

func NewRequestKey(origin Origin, key string) RequestKey

func ParseRequestKey

func ParseRequestKey(name string) (RequestKey, error)

type RequestKeyPayload

type RequestKeyPayload struct {
	Origin Origin
	Key    string
}

func (*RequestKeyPayload) Kind

func (r *RequestKeyPayload) Kind() string

func (*RequestKeyPayload) Parse

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

func (*RequestKeyPayload) RandomBytes

func (r *RequestKeyPayload) RandomBytes() int

func (*RequestKeyPayload) String

func (r *RequestKeyPayload) String() string

type RunnerKey

type RunnerKey = KeyType[RunnerPayload, *RunnerPayload]

func NewLocalRunnerKey

func NewLocalRunnerKey(suffix int) RunnerKey

func NewRunnerKey

func NewRunnerKey(hostname, port string) RunnerKey

func ParseRunnerKey

func ParseRunnerKey(key string) (RunnerKey, error)

type RunnerPayload

type RunnerPayload struct {
	HostPortMixin
}

func (*RunnerPayload) Kind

func (r *RunnerPayload) Kind() string

type SubscriberKey

type SubscriberKey = KeyType[SubscriberPayload, *SubscriberPayload]

func NewSubscriberKey

func NewSubscriberKey(module, subscription, sink string) SubscriberKey

func ParseSubscriberKey

func ParseSubscriberKey(key string) (SubscriberKey, error)

type SubscriberPayload

type SubscriberPayload struct {
	Module       string
	Subscription string
}

func (*SubscriberPayload) Kind

func (s *SubscriberPayload) Kind() string

func (*SubscriberPayload) Parse

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

func (*SubscriberPayload) RandomBytes

func (s *SubscriberPayload) RandomBytes() int

func (*SubscriberPayload) String

func (s *SubscriberPayload) String() string

type Subscription

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

type SubscriptionKey

type SubscriptionKey = KeyType[SubscriptionPayload, *SubscriptionPayload]

func NewSubscriptionKey

func NewSubscriptionKey(module, name string) SubscriptionKey

func ParseSubscriptionKey

func ParseSubscriptionKey(key string) (SubscriptionKey, error)

type SubscriptionPayload

type SubscriptionPayload struct {
	Module string
	Name   string
}

func (*SubscriptionPayload) Kind

func (s *SubscriptionPayload) Kind() string

func (*SubscriptionPayload) Parse

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

func (*SubscriptionPayload) RandomBytes

func (s *SubscriptionPayload) RandomBytes() int

func (*SubscriptionPayload) String

func (s *SubscriptionPayload) String() string

type TopicEventKey

type TopicEventKey = KeyType[TopicEventPayload, *TopicEventPayload]

func NewTopicEventKey

func NewTopicEventKey(module, topic string) TopicEventKey

func ParseTopicEventKey

func ParseTopicEventKey(key string) (TopicEventKey, error)

type TopicEventPayload

type TopicEventPayload struct {
	Module string
	Topic  string
}

func (*TopicEventPayload) Kind

func (t *TopicEventPayload) Kind() string

func (*TopicEventPayload) Parse

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

func (*TopicEventPayload) RandomBytes

func (t *TopicEventPayload) RandomBytes() int

func (*TopicEventPayload) String

func (t *TopicEventPayload) String() string

type TopicKey

type TopicKey = KeyType[TopicPayload, *TopicPayload]

func NewTopicKey

func NewTopicKey(module, name string) TopicKey

func ParseTopicKey

func ParseTopicKey(key string) (TopicKey, error)

type TopicPayload

type TopicPayload struct {
	Module string
	Name   string
}

func (*TopicPayload) Kind

func (t *TopicPayload) Kind() string

func (*TopicPayload) Parse

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

func (*TopicPayload) RandomBytes

func (t *TopicPayload) RandomBytes() int

func (*TopicPayload) String

func (t *TopicPayload) String() string

Jump to

Keyboard shortcuts

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