Documentation
¶
Index ¶
- func FixedDirName(name string) string
- func PersistentDirName(name string) string
- func PubDirName(name string) string
- func PublishToDir(dirName string, key string, item interface{}) error
- func SockName(name string) string
- func TypeToName(something interface{}) string
- func WriteRename(fileName string, b []byte) error
- type LockedStringMap
- type Publication
- func (pub *Publication) ClearRestarted() error
- func (pub *Publication) Get(key string) (interface{}, error)
- func (pub *Publication) GetAll() map[string]interface{}
- func (pub *Publication) Publish(key string, item interface{}) error
- func (pub *Publication) SignalRestarted() error
- func (pub *Publication) Unpublish(key string) error
- type SubDeleteHandler
- type SubModifyHandler
- type SubRestartHandler
- type Subscription
- func Subscribe(agentName string, topicType interface{}, activate bool, ctx interface{}) (*Subscription, error)
- func SubscribePersistent(agentName string, topicType interface{}, activate bool, ctx interface{}) (*Subscription, error)
- func SubscribeScope(agentName string, agentScope string, topicType interface{}, activate bool, ...) (*Subscription, error)
- func (sub *Subscription) Activate() error
- func (sub *Subscription) Get(key string) (interface{}, error)
- func (sub *Subscription) GetAll() map[string]interface{}
- func (sub *Subscription) ProcessChange(change string)
- func (sub *Subscription) Restarted() bool
- func (sub *Subscription) Synchronized() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FixedDirName ¶
func PersistentDirName ¶
func PubDirName ¶
func PublishToDir ¶
One shot create directory and publish one key in that directory
func TypeToName ¶
func TypeToName(something interface{}) string
func WriteRename ¶
Types ¶
type LockedStringMap ¶
func NewLockedStringMap ¶
func NewLockedStringMap() *LockedStringMap
func (*LockedStringMap) Delete ¶
func (sm *LockedStringMap) Delete(key string)
func (*LockedStringMap) Load ¶
func (sm *LockedStringMap) Load(key string) (value interface{}, ok bool)
func (*LockedStringMap) Range ¶
func (sm *LockedStringMap) Range(callback fn)
func (*LockedStringMap) Store ¶
func (sm *LockedStringMap) Store(key string, value interface{})
type Publication ¶
type Publication struct {
// contains filtered or unexported fields
}
func Publish ¶
func Publish(agentName string, topicType interface{}) (*Publication, error)
func PublishPersistent ¶
func PublishPersistent(agentName string, topicType interface{}) (*Publication, error)
func PublishScope ¶
func PublishScope(agentName string, agentScope string, topicType interface{}) (*Publication, error)
func (*Publication) ClearRestarted ¶
func (pub *Publication) ClearRestarted() error
func (*Publication) Get ¶
func (pub *Publication) Get(key string) (interface{}, error)
func (*Publication) GetAll ¶
func (pub *Publication) GetAll() map[string]interface{}
Enumerate all the key, value for the collection
func (*Publication) Publish ¶
func (pub *Publication) Publish(key string, item interface{}) error
func (*Publication) SignalRestarted ¶
func (pub *Publication) SignalRestarted() error
func (*Publication) Unpublish ¶
func (pub *Publication) Unpublish(key string) error
type SubDeleteHandler ¶
type SubDeleteHandler func(ctx interface{}, key string, status interface{})
type SubModifyHandler ¶
type SubModifyHandler func(ctx interface{}, key string, status interface{})
type SubRestartHandler ¶
type SubRestartHandler func(ctx interface{}, restarted bool)
type Subscription ¶
type Subscription struct {
C <-chan string
ModifyHandler SubModifyHandler
DeleteHandler SubDeleteHandler
RestartHandler SubRestartHandler
SynchronizedHandler SubRestartHandler
// contains filtered or unexported fields
}
func Subscribe ¶
func Subscribe(agentName string, topicType interface{}, activate bool, ctx interface{}) (*Subscription, error)
Init function for Subscribe; returns a context. Assumption is that agent with call Get(key) later or specify handleModify and/or handleDelete functions watch ensures that any restart/restarted notification is after any other notifications from ReadDir
func SubscribePersistent ¶
func SubscribePersistent(agentName string, topicType interface{}, activate bool, ctx interface{}) (*Subscription, error)
func SubscribeScope ¶
func SubscribeScope(agentName string, agentScope string, topicType interface{}, activate bool, ctx interface{}) (*Subscription, error)
func (*Subscription) Activate ¶
func (sub *Subscription) Activate() error
If the agentName is empty we interpret that as being dir /var/tmp/zededa
func (*Subscription) Get ¶
func (sub *Subscription) Get(key string) (interface{}, error)
func (*Subscription) GetAll ¶
func (sub *Subscription) GetAll() map[string]interface{}
Enumerate all the key, value for the collection
func (*Subscription) ProcessChange ¶
func (sub *Subscription) ProcessChange(change string)
We handle both subscribeFromDir and subscribeFromSock Note that change filename includes .json for subscribeFromDir. That is removed by HandleStatusEvent.
func (*Subscription) Restarted ¶
func (sub *Subscription) Restarted() bool
func (*Subscription) Synchronized ¶
func (sub *Subscription) Synchronized() bool
Click to show internal directories.
Click to hide internal directories.