spec

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildUserAgent

func BuildUserAgent(version, revision string) string

BuildUserAgent creates User-Agent, also used in agent-name of host's meta

Types

type CPUGenerator added in v0.3.0

type CPUGenerator struct {
}

CPUGenerator collects CPU specs

func (*CPUGenerator) Generate added in v0.3.0

func (g *CPUGenerator) Generate(ctx context.Context) (any, error)

Generate CPU specs

type CloudHostname

type CloudHostname struct {
	Cloud    *mackerel.Cloud
	Hostname string
}

CloudHostname has mackerel.Cloud and host name

type Generator

type Generator interface {
	Generate(context.Context) (any, error)
}

Generator interface generates spec information

func NewMockGenerator

func NewMockGenerator(value any, errValue error) Generator

NewMockGenerator creates a new mock spec generator

type Manager

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

Manager in spec manager

func NewManager

func NewManager(generators []Generator, client api.Client) *Manager

NewManager creates spec manager instanace

func (*Manager) Get

Get collect specs

func (*Manager) Run

func (m *Manager) Run(ctx context.Context, initialInterval, interval time.Duration) error

Run collect and send specs

func (*Manager) SetChecks

func (m *Manager) SetChecks(checks []mackerel.CheckConfig)

SetChecks sets check configs

func (*Manager) SetHostID

func (m *Manager) SetHostID(hostID string)

SetHostID sets host id

func (*Manager) WithCustomIdentifier

func (m *Manager) WithCustomIdentifier(customIdentifier string) *Manager

WithCustomIdentifier sets platform customIdentifier

func (*Manager) WithVersion

func (m *Manager) WithVersion(version, revision string) *Manager

WithVersion sets agent version and revision

type MockGenerator

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

MockGenerator represents a mock spec generator

func (*MockGenerator) Generate

func (g *MockGenerator) Generate(context.Context) (any, error)

Generate generates spec values

Jump to

Keyboard shortcuts

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