Documentation
¶
Index ¶
- func GetBuffer() ([]byte, func())
- type Publisher
- func (s *Publisher) CheckMaxSize(key string, val []byte) error
- func (s *Publisher) LargeDirName() string
- func (s *Publisher) Load() (map[string][]byte, int, error)
- func (s *Publisher) Publish(key string, item []byte) error
- func (s *Publisher) Restart(restartCounter int) error
- func (s *Publisher) Start() error
- func (s *Publisher) Stop() error
- func (s *Publisher) Unpublish(key string) error
- type SocketDriver
- func (s *SocketDriver) DefaultName() string
- func (s *SocketDriver) Publisher(global bool, name, topic string, persistent bool, updaterList *pubsub.Updaters, ...) (pubsub.DriverPublisher, error)
- func (s *SocketDriver) Subscriber(global bool, name, topic string, persistent bool, C chan pubsub.Change) (pubsub.DriverSubscriber, error)
- type Subscriber
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Publisher ¶
type Publisher struct {
// contains filtered or unexported fields
}
Publisher implementation of `pubsub.DriverPublisher` for `SocketDriver`. Implements Unix-domain socket or directory publication, and directory-based persistence.
func (*Publisher) CheckMaxSize ¶
CheckMaxSize returns an error if too large
func (*Publisher) LargeDirName ¶
LargeDirName where to put large fields Note that this is in /persist to avoid using overlayfs aka memory for content which might be Megabytes in size, but there is no assumption that it is persisted across reboots. In fact, the directory should be cleaned up on boot since we do not garbage collect old files from here.
type SocketDriver ¶
type SocketDriver struct { Logger *logrus.Logger Log *base.LogObject RootDir string // Default is "/"; tests can override }
SocketDriver driver for pubsub using local unix-domain socket and files
func (*SocketDriver) DefaultName ¶
func (s *SocketDriver) DefaultName() string
DefaultName default name for an agent when none is provided
func (*SocketDriver) Publisher ¶
func (s *SocketDriver) Publisher(global bool, name, topic string, persistent bool, updaterList *pubsub.Updaters, restarted pubsub.Restarted, differ pubsub.Differ) (pubsub.DriverPublisher, error)
Publisher return an implementation of `pubsub.DriverPublisher` for `SocketDriver`
func (*SocketDriver) Subscriber ¶
func (s *SocketDriver) Subscriber(global bool, name, topic string, persistent bool, C chan pubsub.Change) (pubsub.DriverSubscriber, error)
Subscriber return an implementation of `pubsub.DriverSubscriber` for `SocketDriver`
type Subscriber ¶
Subscriber implementation of `pubsub.DriverSubscriber` for `SocketDriver`. Implements Unix-domain socket or directory subscription, and directory-based persistence.
func (*Subscriber) LargeDirName ¶
func (s *Subscriber) LargeDirName() string
LargeDirName where to put large fields
func (*Subscriber) Load ¶
func (s *Subscriber) Load() (map[string][]byte, int, error)
Load load entire persisted data set into a map
func (*Subscriber) Start ¶
func (s *Subscriber) Start() error
Start start the subscriber listening on the given name and topic internally, will watch for changes on either the socket or the file, and then send the change summary to s.C
func (*Subscriber) Stop ¶
func (s *Subscriber) Stop() error
Stop the subscriber listening on the given name and topic