appcontext

package
v0.0.31 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IntentOwnerKey = "intent.yndd.io/owner"
)

Variables

This section is empty.

Functions

func GetMeta

func GetMeta(mr resource.Managed, labels, annotations map[string]string) metav1.ObjectMeta

Types

type AppContext

type AppContext interface {
	WithLogging(log logging.Logger)
	WithClient(client resource.ClientApplicator)
	WithCatalog(cat catalog.Catalog)
	WithResourceFn(gvk string, typ GvkType, key catalog.Key, renderFn catalog.Fn, resFn ResourceFn, resListFn ResourceListFn, getGvkkeyFn catalog.GetGvkKeyFn)
	WithNameSpaceName(name, namespace string) *appContext
	AddInstance(gvk string, in *catalog.Input) error
	Apply(ctx context.Context) error
}

func New

func New(opts ...Option) AppContext

type GvkType added in v0.0.14

type GvkType string
const (
	GvkTypeGeneric  GvkType = "generic"
	GvkTypeSpecific GvkType = "specific"
)

type Option

type Option func(AppContext)

Option can be used to manipulate AppContext config.

func WithCatalog added in v0.0.30

func WithCatalog(cat catalog.Catalog) Option

WithCatalog initializes the catalog

func WithClient

func WithClient(client resource.ClientApplicator) Option

WithClient initializes the client

func WithLogging

func WithLogging(log logging.Logger) Option

WithLogging initializes the logger

func WithResourceFn

func WithResourceFn(gvk string, typ GvkType, key catalog.Key, renderFn catalog.Fn, resFn ResourceFn, resListFn ResourceListFn, getGvkKeyFn catalog.GetGvkKeyFn) Option

WithResourceFn initializes the resourceFn per gvk

type ResourceFn added in v0.0.13

type ResourceFn func() resource.Managed

type ResourceListFn added in v0.0.13

type ResourceListFn func() resource.ManagedList

Jump to

Keyboard shortcuts

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