Documentation
¶
Overview ¶
Package source provides StateSource implementations for the Mokka Node Agent.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ControlPlaneSource ¶
type ControlPlaneSource struct{}
ControlPlaneSource will poll MEP-0001's Control Plane REST API for State updates. The REST contract is not yet defined; Watch blocks until ctx is cancelled. Replace the Watch body when MEP-0001 defines the endpoint.
func NewControlPlaneSource ¶
func NewControlPlaneSource() *ControlPlaneSource
NewControlPlaneSource returns a ControlPlaneSource skeleton.
func (*ControlPlaneSource) Close ¶
func (c *ControlPlaneSource) Close() error
Close is a no-op; the real implementation will close the REST connection.
type FileSource ¶
type FileSource struct {
// contains filtered or unexported fields
}
FileSource watches the profile and the cluster topology document and emits a State update when either changes. It watches the directories holding them: both a ConfigMap swap and an editor's save replace the file's inode, so a watch on the file would hold the one that was just replaced.
func NewFileSource ¶
func NewFileSource(configPath, topologyPath string, resyncInterval time.Duration, log *zap.Logger) *FileSource
NewFileSource returns a FileSource that watches configPath and topologyPath. resyncInterval re-reads both documents regardless of events, covering a host where inotify reports nothing — a profile on NFS, or a watch limit reached. Zero leaves reloads entirely to events.
func (*FileSource) Close ¶
func (f *FileSource) Close() error
Close is a no-op for FileSource; run owns the watcher, and ctx bounds run.