common

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewResourceInstance

func NewResourceInstance(apiVersionKind string) *unstructured.Unstructured

func NewResourceInstanceList

func NewResourceInstanceList(apiVersionKind string) *unstructured.UnstructuredList

func ResolveSchedule added in v0.1.5

func ResolveSchedule(creationTimestamp metav1.Time, dateTimeDuration string) (time.Time, error)

Types

type Config

type Config struct {
	EnableLeaderElection bool          `env:"ENABLE_LEADER_ELECTION" envDefault:"false"`
	SyncPeriod           time.Duration `env:"SYNC_PERIOD" envDefault:"60m"`
	MonitoringInterval   time.Duration `env:"MONITORING_INTERVAL" envDefault:"5s"`
	ExpirationLabel      string        `env:"EXPIRATION_LABEL" envDefault:"mayfly.cloud.namecheap.com/expire"`
	Resources            []string      `env:"RESOURCES" envSeparator:"," envDefault:"v1;Secret,cloud.namecheap.com/v1alpha1;ScheduledResource"`
}

func NewConfig

func NewConfig() *Config

type Scheduler

type Scheduler interface {
	CreateOrUpdateTask(tag string, date time.Time, task func() error) error
	DeleteTask(tag string) error
}

func NewScheduler

func NewScheduler(config *Config) Scheduler

Jump to

Keyboard shortcuts

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