Documentation ¶
Index ¶
- Variables
- func BrokerKey(namespace, name string) string
- type Broker
- func (*Broker) Descriptor() ([]byte, []int)
- func (m *Broker) GetAddress() string
- func (m *Broker) GetDecoupleQueue() *Queue
- func (m *Broker) GetId() string
- func (m *Broker) GetName() string
- func (m *Broker) GetNamespace() string
- func (m *Broker) GetState() State
- func (m *Broker) GetTargets() map[string]*Target
- func (*Broker) ProtoMessage()
- func (m *Broker) Reset()
- func (m *Broker) String() string
- func (m *Broker) XXX_DiscardUnknown()
- func (m *Broker) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Broker) XXX_Merge(src proto.Message)
- func (m *Broker) XXX_Size() int
- func (m *Broker) XXX_Unmarshal(b []byte) error
- type BrokerMutation
- type CachedTargets
- func (ct *CachedTargets) Bytes() ([]byte, error)
- func (ct *CachedTargets) EqualsBytes(b []byte) bool
- func (ct *CachedTargets) EqualsString(s string) bool
- func (ct *CachedTargets) GetBroker(namespace, name string) (*Broker, bool)
- func (ct *CachedTargets) GetBrokerByKey(key string) (*Broker, bool)
- func (ct *CachedTargets) Load() *TargetsConfig
- func (ct *CachedTargets) RangeAllTargets(f func(*Target) bool)
- func (ct *CachedTargets) RangeBrokers(f func(*Broker) bool)
- func (ct *CachedTargets) Store(t *TargetsConfig)
- func (ct *CachedTargets) String() string
- type Queue
- func (*Queue) Descriptor() ([]byte, []int)
- func (m *Queue) GetSubscription() string
- func (m *Queue) GetTopic() string
- func (*Queue) ProtoMessage()
- func (m *Queue) Reset()
- func (m *Queue) String() string
- func (m *Queue) XXX_DiscardUnknown()
- func (m *Queue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Queue) XXX_Merge(src proto.Message)
- func (m *Queue) XXX_Size() int
- func (m *Queue) XXX_Unmarshal(b []byte) error
- type ReadonlyTargets
- type State
- type Target
- func (*Target) Descriptor() ([]byte, []int)
- func (m *Target) GetAddress() string
- func (m *Target) GetBroker() string
- func (m *Target) GetFilterAttributes() map[string]string
- func (m *Target) GetId() string
- func (m *Target) GetName() string
- func (m *Target) GetNamespace() string
- func (m *Target) GetRetryQueue() *Queue
- func (m *Target) GetState() State
- func (*Target) ProtoMessage()
- func (m *Target) Reset()
- func (m *Target) String() string
- func (m *Target) XXX_DiscardUnknown()
- func (m *Target) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Target) XXX_Merge(src proto.Message)
- func (m *Target) XXX_Size() int
- func (m *Target) XXX_Unmarshal(b []byte) error
- type Targets
- type TargetsConfig
- func (*TargetsConfig) Descriptor() ([]byte, []int)
- func (m *TargetsConfig) GetBrokers() map[string]*Broker
- func (*TargetsConfig) ProtoMessage()
- func (m *TargetsConfig) Reset()
- func (m *TargetsConfig) String() string
- func (m *TargetsConfig) XXX_DiscardUnknown()
- func (m *TargetsConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *TargetsConfig) XXX_Merge(src proto.Message)
- func (m *TargetsConfig) XXX_Size() int
- func (m *TargetsConfig) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
var State_name = map[int32]string{
0: "UNKNOWN",
1: "READY",
}
var State_value = map[string]int32{
"UNKNOWN": 0,
"READY": 1,
}
Functions ¶
Types ¶
type Broker ¶
type Broker 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 broker 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 broker. DecoupleQueue *Queue `protobuf:"bytes,5,opt,name=decouple_queue,json=decoupleQueue,proto3" json:"decouple_queue,omitempty"` // All targets of the broker. Targets map[string]*Target `` /* 155-byte string literal not displayed */ // The broker state. State State `protobuf:"varint,7,opt,name=state,proto3,enum=config.State" json:"state,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Represents a broker.
func (*Broker) Descriptor ¶
func (*Broker) GetAddress ¶
func (*Broker) GetDecoupleQueue ¶
func (*Broker) GetNamespace ¶
func (*Broker) GetTargets ¶
func (*Broker) ProtoMessage ¶
func (*Broker) ProtoMessage()
func (*Broker) XXX_DiscardUnknown ¶
func (m *Broker) XXX_DiscardUnknown()
func (*Broker) XXX_Marshal ¶
func (*Broker) XXX_Unmarshal ¶
type BrokerMutation ¶
type BrokerMutation interface { // SetID sets the broker ID. SetID(id string) BrokerMutation // SetAddress sets the broker address. SetAddress(address string) BrokerMutation // SetDecoupleQueue sets the broker decouple queue. SetDecoupleQueue(q *Queue) BrokerMutation // SetState sets the broker state. SetState(s State) BrokerMutation // UpsertTargets upserts Targets to the broker. // The targets' namespace and broker will be forced to be // the same as the broker's namespace and name. UpsertTargets(...*Target) BrokerMutation // DeleteTargets targets deletes Targets from the broker. DeleteTargets(...*Target) BrokerMutation // Delete deletes the broker. Delete() }
BrokerMutation provides functions to mutate a Broker. The changes made via the BrokerMutation must be "committed" altogether.
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) EqualsBytes ¶
func (ct *CachedTargets) EqualsBytes(b []byte) bool
EqualsBytes checks if the current targets config equals the given targets config in bytes.
func (*CachedTargets) EqualsString ¶
func (ct *CachedTargets) EqualsString(s string) bool
EqualsString checks if the current targets config equals the given targets config in string.
func (*CachedTargets) GetBroker ¶
func (ct *CachedTargets) GetBroker(namespace, name string) (*Broker, bool)
GetBroker returns a broker and its targets if it exists. Do not modify the returned Broker copy.
func (*CachedTargets) GetBrokerByKey ¶
func (ct *CachedTargets) GetBrokerByKey(key string) (*Broker, bool)
GetBrokerByKey returns a broker and its targets if it exists. Do not modify the returned Broker 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) RangeBrokers ¶
func (ct *CachedTargets) RangeBrokers(f func(*Broker) 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.
func (*CachedTargets) String ¶
func (ct *CachedTargets) String() string
String returns the text format of all the targets.
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"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
A pubsub "queue".
func (*Queue) Descriptor ¶
func (*Queue) GetSubscription ¶
func (*Queue) ProtoMessage ¶
func (*Queue) ProtoMessage()
func (*Queue) XXX_DiscardUnknown ¶
func (m *Queue) XXX_DiscardUnknown()
func (*Queue) XXX_Marshal ¶
func (*Queue) XXX_Unmarshal ¶
type ReadonlyTargets ¶
type ReadonlyTargets interface { // RangeAllTargets ranges over all targets. // Do not modify the given Target copy. RangeAllTargets(func(*Target) bool) // GetBroker returns a broker and its targets if it exists. // Do not modify the returned Broker copy. GetBroker(namespace, name string) (*Broker, bool) // GetBroker by its key (namespace/name). GetBrokerByKey(key string) (*Broker, bool) // RangeBrokers ranges over all brokers. // Do not modify the given Broker copy. RangeBrokers(func(*Broker) bool) // Bytes serializes all the targets. Bytes() ([]byte, error) // String returns the text format of all the targets. String() string // EqualsBytes checks if the current targets config equals the given // targets config in bytes. EqualsBytes([]byte) bool // EqualsString checks if the current targets config equals the given // targets config in string. EqualsString(string) bool }
ReadonlyTargets provides "read" functions for brokers and targets.
type State ¶
type State int32
The state of the object. We may add additional intermediate states if needed.
func (State) EnumDescriptor ¶
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 broker name that the trigger is referencing. Broker string `protobuf:"bytes,4,opt,name=broker,proto3" json:"broker,omitempty"` // 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"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Target defines the config schema for a broker subscription target.
func (*Target) Descriptor ¶
func (*Target) GetAddress ¶
func (*Target) GetFilterAttributes ¶
func (*Target) GetNamespace ¶
func (*Target) GetRetryQueue ¶
func (*Target) ProtoMessage ¶
func (*Target) ProtoMessage()
func (*Target) XXX_DiscardUnknown ¶
func (m *Target) XXX_DiscardUnknown()
func (*Target) XXX_Marshal ¶
func (*Target) XXX_Unmarshal ¶
type Targets ¶
type Targets interface { ReadonlyTargets // MutateBroker mutates a broker by namespace and name. // If the broker doesn't exist, it will be added (unless Delete() is called). MutateBroker(namespace, name string, mutate func(BrokerMutation)) }
Targets provides "read" and "write" functions for broker targets.
type TargetsConfig ¶
type TargetsConfig struct { // Keybed by broker namespace/name. Brokers map[string]*Broker `` /* 155-byte string literal not displayed */ XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
TargetsConfig is the collection of all Targets.
func (*TargetsConfig) Descriptor ¶
func (*TargetsConfig) Descriptor() ([]byte, []int)
func (*TargetsConfig) GetBrokers ¶
func (m *TargetsConfig) GetBrokers() map[string]*Broker
func (*TargetsConfig) ProtoMessage ¶
func (*TargetsConfig) ProtoMessage()
func (*TargetsConfig) Reset ¶
func (m *TargetsConfig) Reset()
func (*TargetsConfig) String ¶
func (m *TargetsConfig) String() string
func (*TargetsConfig) XXX_DiscardUnknown ¶
func (m *TargetsConfig) XXX_DiscardUnknown()
func (*TargetsConfig) XXX_Marshal ¶
func (m *TargetsConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*TargetsConfig) XXX_Merge ¶
func (m *TargetsConfig) XXX_Merge(src proto.Message)
func (*TargetsConfig) XXX_Size ¶
func (m *TargetsConfig) XXX_Size() int
func (*TargetsConfig) XXX_Unmarshal ¶
func (m *TargetsConfig) XXX_Unmarshal(b []byte) error