config

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UnmarshalConfig

func UnmarshalConfig(b []byte, obj interface{}) error

UnmarshalConfig will decode a JSON structure while disallowing unknown fields, to prevent configuration file errors

Types

type Configuration

type Configuration struct {

	// Periodicity is time span between two iterations of a check
	Periodicity time.Duration `json:"-"`
	// contains filtered or unexported fields
}

Configuration is the jagozzi main configuration structure

func Load

func Load(configurationFile string) (*Configuration, error)

Load is loading configuration from file and returns a jagozzi configuration

func (*Configuration) UnmarshalJSON

func (cfg *Configuration) UnmarshalJSON(b []byte) error

UnmarshalJSON explicits some variables from configuration file to proper Golang type

type ConsumerConfiguration

type ConsumerConfiguration struct {
	Timeout time.Duration `json:"-"`
	// contains filtered or unexported fields
}

ConsumerConfiguration is the configuration of a consumer

func (*ConsumerConfiguration) UnmarshalJSON

func (cfg *ConsumerConfiguration) UnmarshalJSON(b []byte) error

UnmarshalJSON explicits some variables from configuration file to proper Golang type

type GenericPluginConfiguration added in v1.3.0

type GenericPluginConfiguration struct {
	Name            string        `json:"name" validate:"required"`
	PeriodicityJSON *jsonDuration `json:"periodicity"`
}

GenericPluginConfiguration is a generic plugin configuration

func (*GenericPluginConfiguration) Periodicity added in v1.3.0

func (c *GenericPluginConfiguration) Periodicity() *time.Duration

Periodicity returns the proper Periodicity as a time.Duration

type PluginConfiguration

type PluginConfiguration struct {
	// Type is the name of the plugin that will run
	Type string `json:"type"`
	// Config is the custom configuration of the plugin
	Config interface{} `json:"config,omitempty"`
	// Checks is the list of all checks that plugin will run
	Checks []interface{} `json:"checks"`
}

PluginConfiguration represents the configuration of a plugin

Source Files

  • config.go
  • struct.go
  • unmarshal.go

Jump to

Keyboard shortcuts

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