option

package
v0.0.0-...-3f15f89 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package option provides options for a service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

type Base struct {
	Interval           string `yaml:"interval,omitempty" json:"interval,omitempty"`                       // AhBmCs = Sleep A hours, B minutes, and C seconds between queries.
	SemanticVersioning *bool  `yaml:"semantic_versioning,omitempty" json:"semantic_versioning,omitempty"` // Default - true = Version has to follow semantic versioning (https://semver.org/), and be greater than the previous to trigger anything.
}

Base is the base struct for Options.

func (*Base) CheckValues

func (b *Base) CheckValues(prefix string) error

CheckValues validates the fields of the Base struct.

type Defaults

type Defaults struct {
	Base `yaml:",inline" json:",inline"`
}

Defaults are the default values for Options.

func NewDefaults

func NewDefaults(
	interval string,
	semanticVersioning *bool,
) *Defaults

NewDefaults returns a new Defaults.

func (*Defaults) Default

func (od *Defaults) Default()

Default sets this Defaults to the default values.

type Options

type Options struct {
	Base `yaml:",inline" json:",inline"`

	Active *bool `yaml:"active,omitempty" json:"active,omitempty"` // Disable the service.

	Defaults     *Defaults `yaml:"-" json:"-"` // Defaults.
	HardDefaults *Defaults `yaml:"-" json:"-"` // Hard Defaults.
}

Options are the options for a Service.

func New

func New(
	active *bool,
	interval string,
	semanticVersioning *bool,
	defaults, hardDefaults *Defaults,
) *Options

New Options.

func (*Options) Copy

func (o *Options) Copy() *Options

Copy the Options.

func (*Options) GetActive

func (o *Options) GetActive() bool

GetActive status of the Service.

func (*Options) GetInterval

func (o *Options) GetInterval() string

GetInterval between queries for the latest/deployed version.

func (*Options) GetIntervalDuration

func (o *Options) GetIntervalDuration() time.Duration

GetIntervalDuration returns the interval between queries on latest/deployed version.

func (*Options) GetIntervalPointer

func (o *Options) GetIntervalPointer() *string

GetIntervalPointer returns a pointer to the interval between queries on latest/deployed version.

func (*Options) GetSemanticVersioning

func (o *Options) GetSemanticVersioning() bool

GetSemanticVersioning returns whether the Service uses Semantic Versioning.

func (*Options) String

func (o *Options) String() string

String returns a string representation of the Options.

Jump to

Keyboard shortcuts

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