config

package
v1.0.2-0...-81fcf91 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunOnConfigChange

func RunOnConfigChange(ctx context.Context, log *zap.SugaredLogger, path string, callbacks ...CallbackFn)

RunOnConfigChange - run callback functions when config is changed

Types

type CallbackFn

type CallbackFn func(Config)

type Config

type Config struct {
	LogLevel  string `yaml:"logLevel"`
	LogFormat string `yaml:"logFormat"`
}

func LoadLogConfig

func LoadLogConfig(path string) (Config, error)

LoadLogConfig - return cfg struct based on given path

type FunctionConfig

type FunctionConfig struct {
	MetricsPort                     string `yaml:"metricsPort"`
	LeaderElectionEnabled           bool   `yaml:"leaderElectionEnabled"`
	LeaderElectionID                string `yaml:"leaderElectionID"`
	SecretMutatingWebhookPort       int    `yaml:"secretMutatingWebhookPort"`
	Healthz                         healthzConfig
	Images                          ImagesConfig   `yaml:"images"`
	RequeueDuration                 time.Duration  `yaml:"requeueDuration"`
	FunctionReadyRequeueDuration    time.Duration  `yaml:"functionReadyRequeueDuration"`
	PackageRegistryConfigSecretName string         `yaml:"packageRegistryConfigSecretName"`
	FunctionTraceCollectorEndpoint  string         `yaml:"functionTraceCollectorEndpoint"`
	FunctionPublisherProxyAddress   string         `yaml:"functionPublisherProxyAddress"`
	ResourceConfig                  ResourceConfig `yaml:"resourcesConfiguration"`
	InternalEndpointPort            string         `yaml:"internalEndpointPort"`
}

func LoadFunctionConfig

func LoadFunctionConfig(path string) (FunctionConfig, error)

type FunctionResourceConfig

type FunctionResourceConfig struct {
	Resources Resources `yaml:"resources"`
}

type ImagesConfig

type ImagesConfig struct {
	NodeJs20    string `yaml:"nodejs20"`
	NodeJs22    string `yaml:"nodejs22"`
	Python312   string `yaml:"python312"`
	RepoFetcher string `yaml:"repoFetcher"`
}

type Preset

type Preset map[string]Resource

type Quantity

type Quantity struct {
	Quantity resource.Quantity
}

func (*Quantity) UnmarshalYAML

func (q *Quantity) UnmarshalYAML(unmarshal func(interface{}) error) error

type Resource

type Resource struct {
	RequestCPU    Quantity `yaml:"requestCpu"`
	RequestMemory Quantity `yaml:"requestMemory"`
	LimitCPU      Quantity `yaml:"limitCpu"`
	LimitMemory   Quantity `yaml:"limitMemory"`
}

func (Resource) ToResourceRequirements

func (r Resource) ToResourceRequirements() corev1.ResourceRequirements

type ResourceConfig

type ResourceConfig struct {
	Function FunctionResourceConfig `yaml:"function"`
}

func (*ResourceConfig) Unmarshal

func (rc *ResourceConfig) Unmarshal(input string) error

type Resources

type Resources struct {
	DefaultPreset    string   `yaml:"defaultPreset"`
	MinRequestCPU    Quantity `yaml:"minRequestCPU"`
	MinRequestMemory Quantity `yaml:"minRequestMemory"`
	Presets          Preset   `yaml:"presets"`
}

Jump to

Keyboard shortcuts

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