key

package
v0.427.0 Latest Latest
Warning

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

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

type Subscription

func NewSubscriptionKey

func NewSubscriptionKey(module, name string) Subscription

func ParseSubscriptionKey

func ParseSubscriptionKey(key string) (Subscription, 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 Topic

func NewTopicKey

func NewTopicKey(module, name string) Topic

func ParseTopicKey

func ParseTopicKey(key string) (Topic, error)

type TopicEvent

func NewTopicEventKey

func NewTopicEventKey(module, topic string) TopicEvent

func ParseTopicEventKey

func ParseTopicEventKey(key string) (TopicEvent, 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 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