registration

package
Version: v0.24.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 21, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileContent

type FileContent struct {
	// contains filtered or unexported fields
}

FileContent is a fully managed registration plugin for the choria server instance it reads a file and publishing it to the collective regularly

func NewFileContent

func NewFileContent(c *config.Config, _ ServerInfoSource, logger *logrus.Entry) (*FileContent, error)

NewFileContent creates a new fully managed registration plugin instance

func (*FileContent) Init

func (fc *FileContent) Init(c *config.Config, logger *logrus.Entry)

Init sets up the plugin

func (*FileContent) StartRegistration

func (fc *FileContent) StartRegistration(ctx context.Context, wg *sync.WaitGroup, interval int, output chan *data.RegistrationItem)

StartRegistration starts stats a publishing loop

type FileContentMessage

type FileContentMessage struct {
	Mtime    int64  `json:"mtime"`
	File     string `json:"file"`
	Updated  bool   `json:"updated"`
	Protocol string `json:"protocol"`
	Content  []byte `json:"content,omitempty"`
	ZContent []byte `json:"zcontent,omitempty"`
}

FileContentMessage contains message being published

type InventoryContent

type InventoryContent struct {
	// contains filtered or unexported fields
}

InventoryContent is a fully managed registration plugin for the choria server instance it reads the server inventory and publishing it to the collective regularly

func NewInventoryContent

func NewInventoryContent(c *config.Config, si ServerInfoSource, logger *logrus.Entry) (*InventoryContent, error)

NewInventoryContent creates a new fully managed registration plugin instance

func (*InventoryContent) Init

func (ic *InventoryContent) Init(c *config.Config, logger *logrus.Entry)

Init sets up the plugin

func (*InventoryContent) StartRegistration

func (ic *InventoryContent) StartRegistration(ctx context.Context, wg *sync.WaitGroup, interval int, output chan *data.RegistrationItem)

StartRegistration starts stats a publishing loop

type InventoryContentMessage

type InventoryContentMessage struct {
	Protocol string          `json:"protocol"`
	Content  json.RawMessage `json:"content,omitempty"`
	ZContent []byte          `json:"zcontent,omitempty"`
}

type InventoryData

type InventoryData struct {
	Agents      []agents.Metadata          `json:"agents"`
	Classes     []string                   `json:"classes"`
	Facts       json.RawMessage            `json:"facts"`
	Status      *statistics.InstanceStatus `json:"status"`
	Collectives []string                   `json:"collectives"`
}

type ServerInfoSource

type ServerInfoSource interface {
	Classes() []string
	Facts() json.RawMessage
	Identity() string
	KnownAgents() []string
	DataFuncMap() (ddl.FuncMap, error)
	Status() *statistics.InstanceStatus
	AgentMetadata(agent string) (agents.Metadata, bool)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL