config

package
v0.0.1-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2022 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnsupportedExtension = errors.New("extension not supported")
)

Functions

This section is empty.

Types

type ActionMetaWrapper

type ActionMetaWrapper struct {
	BumpApplicationRevision *bumpapplicationrevision.Properties `json:"bump-application-revision,omitempty"`
	PatchK8sObjects         *patchk8sobjects.Properties         `json:"patch-k8s-objects,omitempty"`
}

+kubebuilder:object:generate=true

func (*ActionMetaWrapper) DeepCopy

func (in *ActionMetaWrapper) DeepCopy() *ActionMetaWrapper

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ActionMetaWrapper.

func (*ActionMetaWrapper) DeepCopyInto

func (in *ActionMetaWrapper) DeepCopyInto(out *ActionMetaWrapper)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Config

type Config struct {
	Triggers []TriggerMeta `json:"triggers"`
}

Config is what actually stores configs in memory. When marshalling or unmarshalling, simplified.ConfigWrapper will be used instead to make it easier for the user to write.

func CUEParser

func CUEParser(data []byte) (*Config, error)

func JSONParser

func JSONParser(data []byte) (*Config, error)

func New

func New() *Config

func NewFromFileOrDir

func NewFromFileOrDir(path string) (*Config, error)

func YAMLParser

func YAMLParser(data []byte) (*Config, error)

func (*Config) MarshalJSON

func (c *Config) MarshalJSON() ([]byte, error)

MarshalJSON will encode Config as ConfigWrapper, which is an external Config format for the user to hand-write.

func (*Config) Parse

func (c *Config) Parse(jsonByte []byte) error

func (*Config) UnmarshalJSON

func (c *Config) UnmarshalJSON(src []byte) error

UnmarshalJSON will decode ConfigWrapper to Config, which is an internal Config for machines to read.

func (*Config) Validate

func (c *Config) Validate(
	sourceReg *sourceregistry.Registry,
	filterReg *filterregistry.Registry,
	actionReg *actionregistry.Registry,
) error

type ConfigWrapper

type ConfigWrapper struct {
	Triggers []TriggerMetaWrapper `json:"triggers"`
}

ConfigWrapper is what the user writes as config. It is a wrapper over Config. It is meant to make it easier for the user to write configs.

func (*ConfigWrapper) FromConfig

func (c *ConfigWrapper) FromConfig(cfg *Config) error

FromConfig converts Config to ConfigWrapper.

func (*ConfigWrapper) ToConfig

func (c *ConfigWrapper) ToConfig(cfg *Config) error

ToConfig converts ConfigWrapper to Config.

type FilterMetaWrapper

type FilterMetaWrapper struct {
	CUEValidator *cuevalidator.Properties `json:"cue-validator,omitempty"`
}

+kubebuilder:object:generate=true

func (*FilterMetaWrapper) DeepCopy

func (in *FilterMetaWrapper) DeepCopy() *FilterMetaWrapper

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FilterMetaWrapper.

func (*FilterMetaWrapper) DeepCopyInto

func (in *FilterMetaWrapper) DeepCopyInto(out *FilterMetaWrapper)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SourceMetaWrapper

type SourceMetaWrapper struct {
	K8sResourceWatcher *k8sresourcewatcherconfig.Properties `json:"k8s-resource-watcher,omitempty"`
}

+kubebuilder:object:generate=true

func (*SourceMetaWrapper) DeepCopy

func (in *SourceMetaWrapper) DeepCopy() *SourceMetaWrapper

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SourceMetaWrapper.

func (*SourceMetaWrapper) DeepCopyInto

func (in *SourceMetaWrapper) DeepCopyInto(out *SourceMetaWrapper)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TriggerMeta

type TriggerMeta struct {
	Source  sourcetype.SourceMeta   `json:"source"`
	Filters []filtertype.FilterMeta `json:"filters"`
	Actions []actiontype.ActionMeta `json:"actions"`
}

type TriggerMetaWrapper

type TriggerMetaWrapper struct {
	SourceMetaWrapper `json:",inline"`
	Filters           []FilterMetaWrapper `json:"filters"`
	Actions           []ActionMetaWrapper `json:"actions"`
}

+kubebuilder:object:generate=true

func (*TriggerMetaWrapper) DeepCopy

func (in *TriggerMetaWrapper) DeepCopy() *TriggerMetaWrapper

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TriggerMetaWrapper.

func (*TriggerMetaWrapper) DeepCopyInto

func (in *TriggerMetaWrapper) DeepCopyInto(out *TriggerMetaWrapper)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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