key

package
v0.0.0-...-d3e2cfc Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// CleanerLabel is the label this operator looks for on resources when
	// deciding whether to manage them. In other words, when this label is set
	// on an object it tells the cleanup-operator to watch that object and
	// dispose of it when it outlives its usefulness.
	CleanerLabel = project.Name() + ".giantswarm.io/enabled"

	// TTLLabel is the label that specifies how long a specific object should
	// live as a time.Duration. In other words the object with this label will
	// expire at `Status.CreateTime` + value of `TTLLabel`.
	TTLLabel = project.Name() + ".giantswarm.io/ttl"
)

Functions

func IsInvalidArgument

func IsInvalidArgument(err error) bool

IsInvalidArgument asserts invalidArgumentError which in turn means a function was given an invalid argument (like a nil interface).

func IsWrongTypeError

func IsWrongTypeError(err error) bool

IsWrongTypeError asserts wrongTypeError which in turn means a function was given a wrapped type it did not expect.

func TTL

func TTL(obj LabelsGetter) time.Duration

TTL extracts the value of TTLLabel from an object, parses it and returns a time.Duration representing number of seconds an object is set to live. If this label is not specified on an object, it will default to an equivalent of 8 hours.

func ToApp

func ToApp(v interface{}) (v1alpha1.App, error)

ToApp extracts the v1alpha1.App value from the interface wrapper and returns it, or returns an error if the interface contains an incorrect type or a nil value.

Types

type LabelsGetter

type LabelsGetter interface {
	GetLabels() map[string]string
}

LabelsGetter is an object that allows access to its labels via GetLabels method.

Jump to

Keyboard shortcuts

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