collector

package
v0.0.0-...-3641ea5 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cmd

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

Cmd is a struct implementing Collector interface. It collects command output for given command configured with Cmd field

func NewCmd

func NewCmd(name string, optional bool, cmd []string) *Cmd

func (Cmd) Collect

func (c Cmd) Collect(ctx context.Context) (goio.ReadCloser, error)

func (Cmd) Name

func (c Cmd) Name() string

func (Cmd) Optional

func (c Cmd) Optional() bool

type Collector

type Collector interface {
	// Name returns the Name of this collector
	Name() string
	// Optional returns true if Collector is not mandatory and failures should be ignored
	Optional() bool
	// Collect returns collected data
	Collect(ctx context.Context) (goio.ReadCloser, error)
}

Collector is the interface to abstract data collection from different sources

type Endpoint

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

Endpoint is a struct implementing Collector interface. It collects HTTP response for given url

func NewEndpoint

func NewEndpoint(name string, optional bool, url string, client *http.Client) *Endpoint

func (Endpoint) Collect

func (c Endpoint) Collect(ctx context.Context) (goio.ReadCloser, error)

func (Endpoint) Name

func (c Endpoint) Name() string

func (Endpoint) Optional

func (c Endpoint) Optional() bool

type File

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

func NewFile

func NewFile(name string, optional bool, filePath string) *File

func (File) Collect

func (c File) Collect(ctx context.Context) (goio.ReadCloser, error)

func (File) Name

func (c File) Name() string

func (File) Optional

func (c File) Optional() bool

type Systemd

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

Systemd is a struct implementing Collector interface. It collects journal logs for given unit

func NewSystemd

func NewSystemd(name string, optional bool, unitName string, duration time.Duration) *Systemd

func (Systemd) Collect

func (c Systemd) Collect(ctx context.Context) (goio.ReadCloser, error)

func (Systemd) Name

func (c Systemd) Name() string

func (Systemd) Optional

func (c Systemd) Optional() bool

Jump to

Keyboard shortcuts

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