config

package
v1.1.62 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package config details configuration data structures for the FlytePropeller Manager implementation.

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultConfig = &Config{
		PodApplication:           "flytepropeller",
		PodTemplateContainerName: "flytepropeller",
		PodTemplateName:          "flytepropeller-template",
		PodTemplateNamespace:     "flyte",
		ScanInterval: config.Duration{
			Duration: 10 * time.Second,
		},
		ShardConfig: ShardConfig{
			Type:       ShardTypeHash,
			ShardCount: 3,
		},
	}
)

Functions

This section is empty.

Types

type Config

type Config struct {
	PodApplication           string          `json:"pod-application" pflag:",Application name for managed pods"`
	PodTemplateContainerName string          `` /* 141-byte string literal not displayed */
	PodTemplateName          string          `json:"pod-template-name" pflag:",K8s PodTemplate name to use for starting FlytePropeller pods"`
	PodTemplateNamespace     string          `json:"pod-template-namespace" pflag:",Namespace where the k8s PodTemplate is located"`
	ScanInterval             config.Duration `json:"scan-interval" pflag:",Frequency to scan FlytePropeller pods and start / restart if necessary"`
	ShardConfig              ShardConfig     `json:"shard" pflag:",Configure the shard strategy for this manager"`
}

Configuration for the FlytePropeller Manager instance

func GetConfig

func GetConfig() *Config

func (Config) GetPFlagSet

func (cfg Config) GetPFlagSet(prefix string) *pflag.FlagSet

GetPFlagSet will return strongly types pflags for all fields in Config and its nested types. The format of the flags is json-name.json-sub-name... etc.

type PerShardMappingsConfig

type PerShardMappingsConfig struct {
	IDs []string `json:"ids" pflag:",The list of ids to be managed"`
}

Configuration for defining shard replicas when using project or domain shard types

type ShardConfig

type ShardConfig struct {
	Type             ShardType                `json:"type" pflag:",Shard implementation to use"`
	PerShardMappings []PerShardMappingsConfig `json:"per-shard-mapping" pflag:"-"`
	ShardCount       int                      `json:"shard-count" pflag:",The number of shards to manage for a 'hash' shard type"`
}

Configuration for the FlytePropeller sharding strategy

type ShardType

type ShardType int
const (
	ShardTypeDomain ShardType = iota
	ShardTypeProject
	ShardTypeHash
)

func ShardTypeString

func ShardTypeString(s string) (ShardType, error)

ShardTypeString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func ShardTypeValues

func ShardTypeValues() []ShardType

ShardTypeValues returns all values of the enum

func (ShardType) IsAShardType

func (i ShardType) IsAShardType() bool

IsAShardType returns "true" if the value is listed in the enum definition. "false" otherwise

func (ShardType) MarshalJSON

func (i ShardType) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface for ShardType

func (ShardType) MarshalYAML

func (i ShardType) MarshalYAML() (interface{}, error)

MarshalYAML implements a YAML Marshaler for ShardType

func (ShardType) String

func (i ShardType) String() string

func (*ShardType) UnmarshalJSON

func (i *ShardType) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ShardType

func (*ShardType) UnmarshalYAML

func (i *ShardType) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements a YAML Unmarshaler for ShardType

Jump to

Keyboard shortcuts

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