Documentation ¶
Index ¶
- Variables
- type CachedTargets
- func (ct *CachedTargets) Bytes() ([]byte, error)
- func (ct *CachedTargets) DebugString() string
- func (ct *CachedTargets) GetCellTenantByKey(key *CellTenantKey) (*CellTenant, bool)
- func (ct *CachedTargets) GetTargetByKey(key *TargetKey) (*Target, bool)
- func (ct *CachedTargets) Load() *TargetsConfig
- func (ct *CachedTargets) RangeAllTargets(f func(*Target) bool)
- func (ct *CachedTargets) RangeCellTenants(f func(*CellTenant) bool)
- func (ct *CachedTargets) Store(t *TargetsConfig)
- type CellTenant
- func (*CellTenant) Descriptor() ([]byte, []int)deprecated
- func (x *CellTenant) GetAddress() string
- func (x *CellTenant) GetDecoupleQueue() *Queue
- func (x *CellTenant) GetId() string
- func (x *CellTenant) GetName() string
- func (x *CellTenant) GetNamespace() string
- func (x *CellTenant) GetState() State
- func (x *CellTenant) GetTargets() map[string]*Target
- func (x *CellTenant) GetType() CellTenantType
- func (x *CellTenant) Key() *CellTenantKey
- func (*CellTenant) ProtoMessage()
- func (x *CellTenant) ProtoReflect() protoreflect.Message
- func (x *CellTenant) Reset()
- func (x *CellTenant) String() string
- type CellTenantKey
- func (k *CellTenantKey) CreateEmptyCellTenant() *CellTenant
- func (k *CellTenantKey) MetricsResource() resource.Resource
- func (k *CellTenantKey) PersistenceString() string
- func (k *CellTenantKey) SpanMessagingDestination() string
- func (k *CellTenantKey) SpanMessagingDestinationAttribute() trace.Attribute
- func (k *CellTenantKey) String() string
- type CellTenantMutation
- type CellTenantType
- func (CellTenantType) Descriptor() protoreflect.EnumDescriptor
- func (x CellTenantType) Enum() *CellTenantType
- func (CellTenantType) EnumDescriptor() ([]byte, []int)deprecated
- func (x CellTenantType) Number() protoreflect.EnumNumber
- func (x CellTenantType) String() string
- func (CellTenantType) Type() protoreflect.EnumType
- type Queue
- type ReadonlyTargets
- type State
- type Target
- func (*Target) Descriptor() ([]byte, []int)deprecated
- func (x *Target) GetAddress() string
- func (x *Target) GetCellTenantName() string
- func (x *Target) GetCellTenantType() CellTenantType
- func (x *Target) GetFilterAttributes() map[string]string
- func (x *Target) GetId() string
- func (x *Target) GetName() string
- func (x *Target) GetNamespace() string
- func (x *Target) GetReplyAddress() string
- func (x *Target) GetRetryQueue() *Queue
- func (x *Target) GetState() State
- func (x *Target) Key() *TargetKey
- func (*Target) ProtoMessage()
- func (x *Target) ProtoReflect() protoreflect.Message
- func (x *Target) Reset()
- func (x *Target) String() string
- type TargetKey
- type Targets
- type TargetsConfig
Constants ¶
This section is empty.
Variables ¶
var ( State_name = map[int32]string{ 0: "UNKNOWN", 1: "READY", } State_value = map[string]int32{ "UNKNOWN": 0, "READY": 1, } )
Enum value maps for State.
var ( CellTenantType_name = map[int32]string{ 0: "UNKNOWN_CELL_TENANT_TYPE", 1: "BROKER", 2: "CHANNEL", } CellTenantType_value = map[string]int32{ "UNKNOWN_CELL_TENANT_TYPE": 0, "BROKER": 1, "CHANNEL": 2, } )
Enum value maps for CellTenantType.
var File_pkg_broker_config_targets_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type CachedTargets ¶
CachedTargets provides a in-memory cached copy of targets.
func (*CachedTargets) Bytes ¶
func (ct *CachedTargets) Bytes() ([]byte, error)
Bytes serializes all the targets.
func (*CachedTargets) DebugString ¶ added in v0.20.0
func (ct *CachedTargets) DebugString() string
DebugString returns the text format of all the targets. It is for _debug_ purposes only. The output format is not guaranteed to be stable and may change at any time.
func (*CachedTargets) GetCellTenantByKey ¶ added in v0.21.0
func (ct *CachedTargets) GetCellTenantByKey(key *CellTenantKey) (*CellTenant, bool)
GetBrokerByKey returns a broker and its targets if it exists. Do not modify the returned Broker copy.
func (*CachedTargets) GetTargetByKey ¶ added in v0.15.0
func (ct *CachedTargets) GetTargetByKey(key *TargetKey) (*Target, bool)
GetTargetByKey returns a target by its trigger key. The format of trigger key is namespace/brokerName/targetName. Do not modify the returned Target copy.
func (*CachedTargets) Load ¶
func (ct *CachedTargets) Load() *TargetsConfig
Load atomically loads a stored TargetsConfig. If there was no TargetsConfig stored, nil will be returned.
func (*CachedTargets) RangeAllTargets ¶
func (ct *CachedTargets) RangeAllTargets(f func(*Target) bool)
RangeAllTargets ranges over all targets. Do not modify the given Target copy.
func (*CachedTargets) RangeCellTenants ¶ added in v0.21.0
func (ct *CachedTargets) RangeCellTenants(f func(*CellTenant) bool)
RangeBrokers ranges over all brokers. Do not modify the given Broker copy.
func (*CachedTargets) Store ¶
func (ct *CachedTargets) Store(t *TargetsConfig)
Store atomically stores a TargetsConfig.
type CellTenant ¶ added in v0.21.0
type CellTenant struct { // The type of this CellTenant (e.g. Broker, Channel, etc.). Type CellTenantType `protobuf:"varint,8,opt,name=type,proto3,enum=config.CellTenantType" json:"type,omitempty"` // The id of the object. E.g. UID of the resource. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // The name of the object. Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // The namespace of the object. Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"` // The object's subscriber's address. // Will we have more than one address? Address string `protobuf:"bytes,4,opt,name=address,proto3" json:"address,omitempty"` // The decouple queue for the cell tenant. DecoupleQueue *Queue `protobuf:"bytes,5,opt,name=decouple_queue,json=decoupleQueue,proto3" json:"decouple_queue,omitempty"` // All targets of the cell tenant. Key is defined by the CellTenant's type: // - Broker: Key is the name of the Trigger. Targets map[string]*Target `` /* 155-byte string literal not displayed */ // The CellTenant's state. State State `protobuf:"varint,7,opt,name=state,proto3,enum=config.State" json:"state,omitempty"` // contains filtered or unexported fields }
Represents a tenant of the Cell. E.g. Broker, Channel, etc.
func (*CellTenant) Descriptor
deprecated
added in
v0.21.0
func (*CellTenant) Descriptor() ([]byte, []int)
Deprecated: Use CellTenant.ProtoReflect.Descriptor instead.
func (*CellTenant) GetAddress ¶ added in v0.21.0
func (x *CellTenant) GetAddress() string
func (*CellTenant) GetDecoupleQueue ¶ added in v0.21.0
func (x *CellTenant) GetDecoupleQueue() *Queue
func (*CellTenant) GetId ¶ added in v0.21.0
func (x *CellTenant) GetId() string
func (*CellTenant) GetName ¶ added in v0.21.0
func (x *CellTenant) GetName() string
func (*CellTenant) GetNamespace ¶ added in v0.21.0
func (x *CellTenant) GetNamespace() string
func (*CellTenant) GetState ¶ added in v0.21.0
func (x *CellTenant) GetState() State
func (*CellTenant) GetTargets ¶ added in v0.21.0
func (x *CellTenant) GetTargets() map[string]*Target
func (*CellTenant) GetType ¶ added in v0.21.0
func (x *CellTenant) GetType() CellTenantType
func (*CellTenant) Key ¶ added in v0.21.0
func (x *CellTenant) Key() *CellTenantKey
Key returns the CellTenantKey for this Broker.
func (*CellTenant) ProtoMessage ¶ added in v0.21.0
func (*CellTenant) ProtoMessage()
func (*CellTenant) ProtoReflect ¶ added in v0.21.0
func (x *CellTenant) ProtoReflect() protoreflect.Message
func (*CellTenant) Reset ¶ added in v0.21.0
func (x *CellTenant) Reset()
func (*CellTenant) String ¶ added in v0.21.0
func (x *CellTenant) String() string
type CellTenantKey ¶ added in v0.21.0
type CellTenantKey struct {
// contains filtered or unexported fields
}
CellTenantKey uniquely identifies a single CellTenant, at a given point in time.
func CellTenantKeyFromPersistenceString ¶ added in v0.21.0
func CellTenantKeyFromPersistenceString(s string) (*CellTenantKey, error)
func KeyFromBroker ¶ added in v0.20.0
func KeyFromBroker(b *brokerv1.Broker) *CellTenantKey
KeyFromBroker creates a CellTenantKey from a K8s Broker object.
func KeyFromChannel ¶ added in v0.21.0
func KeyFromChannel(c *v1beta1.Channel) *CellTenantKey
KeyFromBroker creates a CellTenantKey from a K8s Broker object.
func TestOnlyBrokerKey ¶ added in v0.20.0
func TestOnlyBrokerKey(namespace, name string) *CellTenantKey
TestOnlyBrokerKey returns the key of a broker. This method exists to make tests that need a CellTenantKey, but do not need an actual Broker, easier to write.
func (*CellTenantKey) CreateEmptyCellTenant ¶ added in v0.21.0
func (k *CellTenantKey) CreateEmptyCellTenant() *CellTenant
CreateEmptyCellTenant creates an empty CellTenant that corresponds to this CellTenantKey. It is empty except for the portions known about by the CellTenantKey.
func (*CellTenantKey) MetricsResource ¶ added in v0.21.0
func (k *CellTenantKey) MetricsResource() resource.Resource
MetricsResource generates the Resource object that metrics will be associated with.
func (*CellTenantKey) PersistenceString ¶ added in v0.21.0
func (k *CellTenantKey) PersistenceString() string
PersistenceString is the string that is persisted as the key for this Broker in the protobuf. It is stable and can only change if all existing usage locations are made backwards compatible, supporting _both_ the old and the new format, for at least one release.
func (*CellTenantKey) SpanMessagingDestination ¶ added in v0.21.0
func (k *CellTenantKey) SpanMessagingDestination() string
SpanMessagingDestination is the Messaging Destination of requests sent to this CellTenantKey.
func (*CellTenantKey) SpanMessagingDestinationAttribute ¶ added in v0.21.0
func (k *CellTenantKey) SpanMessagingDestinationAttribute() trace.Attribute
SpanMessagingDestinationAttribute is the Messaging Destination attribute that should be attached to the tracing Span.
func (*CellTenantKey) String ¶ added in v0.21.0
func (k *CellTenantKey) String() string
String creates a human readable version of this key. It is for debug purposes only. It is free to change at any time.
type CellTenantMutation ¶ added in v0.21.0
type CellTenantMutation interface { // SetID sets the CellTenant's ID. SetID(id string) CellTenantMutation // SetAddress sets the CellTenant's subscriber's address. SetAddress(address string) CellTenantMutation // SetDecoupleQueue sets the CellTenant's decouple queue. SetDecoupleQueue(q *Queue) CellTenantMutation // SetState sets the CellTenant's state. SetState(s State) CellTenantMutation // UpsertTargets upserts Targets to the CellTenant. // The targets' namespace, CellTenantType, and CellTenantName will be set to the CellTenant's // value. UpsertTargets(...*Target) CellTenantMutation // DeleteTargets targets deletes Targets from the CellTenant. DeleteTargets(...*Target) CellTenantMutation // Delete deletes the CellTenant. Delete() }
CellTenantMutation provides functions to mutate a CellTenant. The changes made via the CellTenantMutation must be "committed" altogether.
type CellTenantType ¶ added in v0.21.0
type CellTenantType int32
CellTenantType is the type of the Cell Tenant.
const ( CellTenantType_UNKNOWN_CELL_TENANT_TYPE CellTenantType = 0 CellTenantType_BROKER CellTenantType = 1 CellTenantType_CHANNEL CellTenantType = 2 )
func (CellTenantType) Descriptor ¶ added in v0.21.0
func (CellTenantType) Descriptor() protoreflect.EnumDescriptor
func (CellTenantType) Enum ¶ added in v0.21.0
func (x CellTenantType) Enum() *CellTenantType
func (CellTenantType) EnumDescriptor
deprecated
added in
v0.21.0
func (CellTenantType) EnumDescriptor() ([]byte, []int)
Deprecated: Use CellTenantType.Descriptor instead.
func (CellTenantType) Number ¶ added in v0.21.0
func (x CellTenantType) Number() protoreflect.EnumNumber
func (CellTenantType) String ¶ added in v0.21.0
func (x CellTenantType) String() string
func (CellTenantType) Type ¶ added in v0.21.0
func (CellTenantType) Type() protoreflect.EnumType
type Queue ¶
type Queue struct { Topic string `protobuf:"bytes,1,opt,name=topic,proto3" json:"topic,omitempty"` Subscription string `protobuf:"bytes,2,opt,name=subscription,proto3" json:"subscription,omitempty"` State State `protobuf:"varint,3,opt,name=state,proto3,enum=config.State" json:"state,omitempty"` // contains filtered or unexported fields }
A pubsub "queue".
func (*Queue) Descriptor
deprecated
func (*Queue) GetSubscription ¶
func (*Queue) ProtoMessage ¶
func (*Queue) ProtoMessage()
func (*Queue) ProtoReflect ¶ added in v0.15.0
func (x *Queue) ProtoReflect() protoreflect.Message
type ReadonlyTargets ¶
type ReadonlyTargets interface { // RangeAllTargets ranges over all targets. // Do not modify the given Target copy. RangeAllTargets(func(*Target) bool) // GetTargetByKey returns a target by its trigger key, if it exists. // Do not modify the returned Target copy. GetTargetByKey(key *TargetKey) (*Target, bool) // GetCellTenantByKey returns a CellTenant and its Targets, if it exists. // Do not modify the returned CellTenant copy. GetCellTenantByKey(key *CellTenantKey) (*CellTenant, bool) // RangeCellTenants ranges over all CellTenants. // Do not modify the given CellTenant copy. RangeCellTenants(func(*CellTenant) bool) // Bytes serializes all the targets. Bytes() ([]byte, error) // DebugString returns the text format of all the targets. It is for _debug_ purposes only. The // output format is not guaranteed to be stable and may change at any time. DebugString() string }
ReadonlyTargets provides "read" functions for CellTenants and targets.
type State ¶
type State int32
The state of the object. We may add additional intermediate states if needed.
func (State) Descriptor ¶ added in v0.15.0
func (State) Descriptor() protoreflect.EnumDescriptor
func (State) EnumDescriptor
deprecated
func (State) Number ¶ added in v0.15.0
func (x State) Number() protoreflect.EnumNumber
func (State) Type ¶ added in v0.15.0
func (State) Type() protoreflect.EnumType
type Target ¶
type Target struct { // The id of the object. E.g. UID of the resource. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // The name of the object. Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // The namespace of the object. Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"` // The name of the CellTenant that this Target is associated with. CellTenantName string `protobuf:"bytes,4,opt,name=cell_tenant_name,json=cellTenantName,proto3" json:"cell_tenant_name,omitempty"` // The type of the CellTenant that this Target is associated with. CellTenantType CellTenantType `` /* 133-byte string literal not displayed */ // The resolved subscriber URI of the target. Address string `protobuf:"bytes,5,opt,name=address,proto3" json:"address,omitempty"` // Optional filters from the trigger. FilterAttributes map[string]string `` /* 197-byte string literal not displayed */ // The retry queue for the target. RetryQueue *Queue `protobuf:"bytes,7,opt,name=retry_queue,json=retryQueue,proto3" json:"retry_queue,omitempty"` // The target state. State State `protobuf:"varint,8,opt,name=state,proto3,enum=config.State" json:"state,omitempty"` // The resolved URI that replies are sent to. ReplyAddress string `protobuf:"bytes,10,opt,name=reply_address,json=replyAddress,proto3" json:"reply_address,omitempty"` // contains filtered or unexported fields }
Target defines the config schema for a CellTenant's subscription's target.
func (*Target) Descriptor
deprecated
func (*Target) GetAddress ¶
func (*Target) GetCellTenantName ¶ added in v0.21.0
func (*Target) GetCellTenantType ¶ added in v0.21.0
func (x *Target) GetCellTenantType() CellTenantType
func (*Target) GetFilterAttributes ¶
func (*Target) GetNamespace ¶
func (*Target) GetReplyAddress ¶ added in v0.21.0
func (*Target) GetRetryQueue ¶
func (*Target) ProtoMessage ¶
func (*Target) ProtoMessage()
func (*Target) ProtoReflect ¶ added in v0.15.0
func (x *Target) ProtoReflect() protoreflect.Message
type TargetKey ¶ added in v0.20.0
type TargetKey struct {
// contains filtered or unexported fields
}
TargetKey uniquely identifies a single Target, at a given point in time.
func (*TargetKey) ParentKey ¶ added in v0.20.0
func (k *TargetKey) ParentKey() *CellTenantKey
ParentKey is the key of the parent this Target corresponds to.
type Targets ¶
type Targets interface { ReadonlyTargets // MutateCellTenant mutates a CellTenant by its key. // If the CellTenant doesn't exist, it will be added (unless Delete() is called). MutateCellTenant(key *CellTenantKey, mutate func(CellTenantMutation)) }
Targets provides "read" and "write" functions for BrokerCell targets.
type TargetsConfig ¶
type TargetsConfig struct { // Keyed by the CellTenant's PersistenceString(). // Broker: "<ns>/<brokerName>" CellTenants map[string]*CellTenant `` /* 182-byte string literal not displayed */ // contains filtered or unexported fields }
TargetsConfig is the collection of all Targets.
func (*TargetsConfig) Descriptor
deprecated
func (*TargetsConfig) Descriptor() ([]byte, []int)
Deprecated: Use TargetsConfig.ProtoReflect.Descriptor instead.
func (*TargetsConfig) GetCellTenants ¶ added in v0.21.0
func (x *TargetsConfig) GetCellTenants() map[string]*CellTenant
func (*TargetsConfig) ProtoMessage ¶
func (*TargetsConfig) ProtoMessage()
func (*TargetsConfig) ProtoReflect ¶ added in v0.15.0
func (x *TargetsConfig) ProtoReflect() protoreflect.Message
func (*TargetsConfig) Reset ¶
func (x *TargetsConfig) Reset()
func (*TargetsConfig) String ¶
func (x *TargetsConfig) String() string