state

package
v0.0.0-...-888c057 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckState

type CheckState struct {
	ID           string `json:"id"`
	StateFiles   []byte `json:"stateFiles,omitempty"` // JSON data
	LatestStatus string `json:"latestReport,omitempty"`
}

CheckState is check plugin state.

type HostState

type HostState struct {
	ID           string `json:"id"` // Primary key ( m.Org + "-" + m.Hostname
	Organization string `json:"organization"`
	Hostname     string `json:"hostname"`
	HostID       string `json:"hostId" dynamodbav:",omitempty"`
	HostCheckSum string `json:"hostCheckSum" dynamodbav:",omitempty"`
}

HostState is dynamodb table of hostID.

type Manager

type Manager struct {
	TTLDays  int
	Org      string
	Hostname string
	store.Store
}

Manager struct.

func (*Manager) GetCheckState

func (m *Manager) GetCheckState(name string) (*CheckState, error)

GetCheckState Extract checkState from pluginState.

func (*Manager) GetHostState

func (m *Manager) GetHostState() (*HostState, error)

GetHostState is get hostID from dynamodb.

func (*Manager) GetPluginState

func (m *Manager) GetPluginState(name string) (*PluginState, error)

GetPluginState is get plugin state from dynamodb.

func (*Manager) PutCheckState

func (m *Manager) PutCheckState(name string, in *CheckState) error

PutCheckState Extract checkState from pluginState.

func (*Manager) PutHostState

func (m *Manager) PutHostState(in HostState) error

PutHostState put host id.

func (*Manager) PutPluginState

func (m *Manager) PutPluginState(name string, in *PluginState) error

PutPluginState put plugin state.

type PluginState

type PluginState struct {
	ID    string `json:"id"`                            // Primary key (HostID:hostname
	State []byte `json:"state" dynamodbav:",omitempty"` // State data
	TTL   int    `json:"ttl" dynamodbav:",omitempty"`
}

PluginState is dynamodb table of check Plugin state.

Jump to

Keyboard shortcuts

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