registration

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2024 License: Apache-2.0 Imports: 18 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 InventoryBuildInfo added in v0.26.0

type InventoryBuildInfo struct {
	Version string `json:"version"`
	SHA     string `json:"sha"`
}

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"`
	BuildInfo   *InventoryBuildInfo        `json:"build_info"`
	AutoAgents  []*InventoryMachineState   `json:"machines"`
}

type InventoryMachineState added in v0.26.0

type InventoryMachineState struct {
	Name    string `json:"name"`
	Version string `json:"version"`
	State   string `json:"state"`
}

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)
	BuildInfo() *build.Info
	MachinesStatus() ([]aagent.MachineState, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL