Documentation ¶
Index ¶
- Variables
- type Config
- type Distributor
- type InMemoryDistributor
- type InMemorySource
- func (s *InMemorySource) Delete(k resource.Key)
- func (s *InMemorySource) Get(key resource.Key) (resource.Entry, error)
- func (s *InMemorySource) Set(k resource.Key, metadata resource.Metadata, item proto.Message)
- func (s *InMemorySource) Start(handler resource.EventHandler) error
- func (s *InMemorySource) Stop()
- type ListenerFn
- type Processor
- type Source
- type State
Constants ¶
This section is empty.
Variables ¶
var CollectionTag tag.Key
CollectionTag holds the type URL for the context.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Cached mesh config Mesh meshconfig.Cache // Domain suffix to use DomainSuffix string }
Config used by the runtime
type Distributor ¶
type Distributor interface { SetSnapshot(name string, snapshot sn.Snapshot) ClearSnapshot(name string) }
Distributor interface allows processor to distribute snapshots of configuration.
type InMemoryDistributor ¶
type InMemoryDistributor struct {
// contains filtered or unexported fields
}
InMemoryDistributor is an in-memory distributor implementation.
func NewInMemoryDistributor ¶
func NewInMemoryDistributor() *InMemoryDistributor
NewInMemoryDistributor returns a new instance of InMemoryDistributor
func (*InMemoryDistributor) ClearSnapshot ¶
func (d *InMemoryDistributor) ClearSnapshot(name string)
ClearSnapshot is an implementation of Distributor.ClearSnapshot
func (*InMemoryDistributor) GetSnapshot ¶
func (d *InMemoryDistributor) GetSnapshot(name string) sn.Snapshot
GetSnapshot get the snapshot of the specified name
func (*InMemoryDistributor) ListenChanges ¶
func (d *InMemoryDistributor) ListenChanges(cancel chan bool, fn ListenerFn)
ListenChanges registered listener and start listening snapshot changes in the distributor
func (*InMemoryDistributor) SetSnapshot ¶
func (d *InMemoryDistributor) SetSnapshot(name string, snapshot sn.Snapshot)
SetSnapshot is an implementation of Distributor.SetSnapshot
type InMemorySource ¶
type InMemorySource struct {
// contains filtered or unexported fields
}
InMemorySource is an implementation of source.Interface.
func NewInMemorySource ¶
func NewInMemorySource() *InMemorySource
NewInMemorySource returns a new instance of InMemorySource.
func (*InMemorySource) Delete ¶
func (s *InMemorySource) Delete(k resource.Key)
Delete a value in the in-memory store.
func (*InMemorySource) Start ¶
func (s *InMemorySource) Start(handler resource.EventHandler) error
Start implements source.Interface.Start
type ListenerFn ¶
ListenerFn is used by listeners for defining listen action
type Processor ¶
type Processor struct {
// contains filtered or unexported fields
}
Processor is the main control-loop for processing incoming config events and translating them into component configuration
func NewProcessor ¶
func NewProcessor(src Source, distributor Distributor, cfg *Config) *Processor
NewProcessor returns a new instance of a Processor
type Source ¶
type Source interface { // Start the source interface, provided the EventHandler. The initial state of the underlying // config store should be reflected as a series of Added events, followed by a FullSync event. Start(handler resource.EventHandler) error // Stop the source interface. Upon return from this method, the channel should not be accumulating any // more events. Stop() }
Source to be implemented by a source configuration provider.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package resource contains core abstract types for representing configuration resources.
|
Package resource contains core abstract types for representing configuration resources. |