monitor

package
v0.0.0-...-ff6eb74 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter interface {
	Fetch(cfg AdapterConfig) (string, error)
	Validate(cfg AdapterConfig) error
}

An Adapter is used to load a version string from a specific target / technology / transport

type AdapterConfig

type AdapterConfig struct {
	Type              AdapterType       `yaml:"type"`
	GitHubRelease     GitHubRelease     `yaml:"gitHubRelease"`
	HttpGet           HttpGet           `yaml:"httpGet"`
	K8sContainerImage K8sContainerImage `yaml:"k8sContainerImage,omitempty"`
	ShellCommand      ShellCommand      `yaml:"shellCommand"`
}

AdapterConfig config section

type AdapterRegistry

type AdapterRegistry map[AdapterType]Adapter

AdapterRegistry is a registry for adapters ... wow

type AdapterType

type AdapterType string

AdapterType defines the adapter to use to load the version from

type Config

type Config struct {
	Targets []Target `yaml:"targets"`
}

Config root object, just a list of targets

type GitHubRelease

type GitHubRelease struct {
	Owner string `yaml:"owner"`
	Repo  string `yaml:"repo"`
}

GitHubRelease config section

func (GitHubRelease) String

func (g GitHubRelease) String() string

String implements the fmt.Stringer interface

type HttpGet

type HttpGet struct {
	URL      string `yaml:"url"`
	JSONPath string `yaml:"jsonPath"`
}

HttpGet config section

func (HttpGet) String

func (h HttpGet) String() string

String implements the fmt.Stringer interface

type K8sContainerImage

type K8sContainerImage struct {
	Kind          string `yaml:"kind"`
	Namespace     string `yaml:"namespace"`
	Name          string `yaml:"name"`
	ContainerName string `yaml:"containerName,omitempty"`
}

K8sContainerImage config section

func (K8sContainerImage) String

func (k K8sContainerImage) String() string

String implements the fmt.Stringer interface

type Monitor

type Monitor interface {
	Versions() ([]Version, time.Time, error)
}

A Monitor receives the latest set of versions fetched from adapters

type ShellCommand

type ShellCommand struct {
	Command string   `yaml:"command"`
	Args    []string `yaml:"args"`
}

ShellCommand config section

func (ShellCommand) String

func (s ShellCommand) String() string

String implements the fmt.Stringer interface

type Target

type Target struct {
	Name    string        `yaml:"name"`
	Current AdapterConfig `yaml:"current"`
	Latest  AdapterConfig `yaml:"latest"`
}

Target specifies a single target

type Version

type Version struct {
	Name    string
	Current string
	Latest  string
}

Version information about a specific system / technology

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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