agent

package
v0.1.16-beta1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2020 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AuthToken string

AuthToken is the authorization token that will be used for API calls

View Source
var ConfigFilePath string

ConfigFilePath is where the agent will try to load the configuration from

View Source
var CredentialsPath string

CredentialsPath is where the agent will try to loads the credentials. (Experimental)

View Source
var Period uint

Period is the number of seconds between scans

Functions

func Run

func Run(cmd *cobra.Command, args []string)

Run starts the agent process

Types

type Config

type Config struct {
	Schedule      string         `yaml:"schedule"`
	Token         string         `yaml:"token"`
	Endpoint      Endpoint       `yaml:"endpoint"`
	DataGatherers []dataGatherer `yaml:"data-gatherers"`
}

Config wraps the options for a run of the agent.

func ParseConfig

func ParseConfig(data []byte) (Config, error)

ParseConfig reads config into a struct used to configure running agents

func (*Config) Dump

func (c *Config) Dump() (string, error)

Dump generates a YAML string of the Config object

type Credentials

type Credentials struct {
	// UserID is the ID or email for the user or service account.
	UserID string `json:"user_id"`
	// UserSecret is the secret for the user or service account.
	UserSecret string `json:"user_secret"`
}

Credentials defines the format of the credentials.json file.

func ParseCredentials

func ParseCredentials(data []byte) (*Credentials, error)

ParseCredentials reads credentials into a struct used. Performs validations.

type Endpoint

type Endpoint struct {
	Protocol string `yaml:"protocol"`
	Host     string `yaml:"host"`
	Path     string `yaml:"path"`
}

Endpoint is the configuration of the server where to post the data.

Jump to

Keyboard shortcuts

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