config

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EnvPrefix = "KEEL_"

Functions

func ReplaceEnvironment added in v0.1.2

func ReplaceEnvironment(val string) string

Types

type Config

type Config struct {
	Log       LogConfig
	Database  DatabaseConfig
	Scheduler SchedulerConfig
	Snapshot  SnapshotConfig
	Worker    WorkerConfig
	Transport TransportConfig
}

func DefaultFromEnv

func DefaultFromEnv() Config

type DatabaseConfig

type DatabaseConfig struct {
	Type string
	DSN  string
}

type KafkaConfig

type KafkaConfig struct {
	Brokers    []string    // Broker addresses
	Topics     KafkaTopics // Topics
	GroupId    string      // Consumer group id
	MessageTTL int         // Message TTL in seconds
}

type KafkaTopics

type KafkaTopics struct {
	Tasks    []string // Tasks topics
	Messages []string // Messages topics
}

type LogConfig

type LogConfig struct {
	Level string
}

func (*LogConfig) GetLevel

func (lc *LogConfig) GetLevel() zerolog.Level

type SchedulerConfig

type SchedulerConfig struct {
	Id                      string // Scheduler id, also used to identify partition
	Zone                    string // The zone to which schedule belongs to
	Port                    int
	Numbers                 int // Number of schedulers within the same zone
	Address                 string
	AdvertisedAddress       string
	ScheduleInterval        int // Schedule interval in seconds
	StaleCheckDelay         int // Stale tasks check delay after start up in seconds
	TaskEventUpdateDeadline int // Deadline in seconds for the scheduler to receive task update events
}

type ServerConfig

type ServerConfig struct {
	HttpAddress string // HTTP server address
	GrpcAddress string // GRPC server address
}

type SnapshotConfig

type SnapshotConfig struct {
	Enabled      bool          // When enabled, schedulers save snapshot files to specified S3 bucket
	MaxVersions  int           // The maximum number of snapshot versions being kept
	Interval     time.Duration // Interval to take snapshots
	Endpoint     string        // S3 endpoint
	Region       string        // S3 region
	Bucket       string        // S3 bucket
	AccessKey    string        // S3 access key
	AccessSecret string        // S3 access secret
	Secure       bool          // Whether LTS is enabled
}

type TransportConfig

type TransportConfig struct {
	Type  string      // Transport type, e.g. kafka
	Role  string      // Transport role, available values are enum.TransportRole
	Kafka KafkaConfig // Kafka config
}

type WorkerConfig

type WorkerConfig struct {
	Name           string // Worker name used to identify the worker
	PoolSize       int    // Worker executor pool size
	Generation     int    // Worker generation
	ReportInterval int    // Interval in seconds that the worker reports events to scheduler
}

Jump to

Keyboard shortcuts

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