key

package
v0.435.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Changeset added in v0.435.0

func NewChangesetKey added in v0.435.0

func NewChangesetKey() Changeset

func ParseChangesetKey added in v0.435.0

func ParseChangesetKey(key string) (Changeset, error)

type ChangesetPayload added in v0.435.0

type ChangesetPayload struct {
	// Content is just included to make the payload non-empty.
	// Non empty payloads do not work with go2proto
	Content string
}

func (*ChangesetPayload) Kind added in v0.435.0

func (c *ChangesetPayload) Kind() string

func (*ChangesetPayload) Parse added in v0.435.0

func (c *ChangesetPayload) Parse(parts []string) error

func (*ChangesetPayload) RandomBytes added in v0.435.0

func (c *ChangesetPayload) RandomBytes() int

func (*ChangesetPayload) String added in v0.435.0

func (c *ChangesetPayload) String() string

type Controller

func NewControllerKey

func NewControllerKey(hostname, port string) Controller

func NewLocalControllerKey

func NewLocalControllerKey(suffix int) Controller

func ParseControllerKey

func ParseControllerKey(key string) (Controller, error)

type ControllerPayload

type ControllerPayload struct {
	HostPortMixin
}

func (*ControllerPayload) Kind

func (c *ControllerPayload) Kind() string

type CronJob

func NewCronJobKey

func NewCronJobKey(module, verb string) CronJob

func ParseCronJobKey

func ParseCronJobKey(key string) (CronJob, 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

func NewDeploymentKey

func NewDeploymentKey(module string) Deployment

func ParseDeploymentKey

func ParseDeploymentKey(key string) (Deployment, 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 comparable, TP keyPayloadConstraint[T]] struct {
	Payload T
	Suffix  string
}

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 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 Request

A Request represents an inbound request into the cluster.

func NewRequestKey

func NewRequestKey(origin Origin, key string) Request

func ParseRequestKey

func ParseRequestKey(name string) (Request, 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 Runner

func NewLocalRunnerKey

func NewLocalRunnerKey(suffix int) Runner

func NewRunnerKey

func NewRunnerKey(hostname, port string) Runner

func ParseRunnerKey

func ParseRunnerKey(key string) (Runner, 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

Jump to

Keyboard shortcuts

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