config

package
v0.0.0-...-c11a323 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// YHSConfig specifies the configuration for the Yunikorn History Server.
	YHSConfig YHSConfig
	// PostgresConfig specifies the configuration for the Postgres database.
	PostgresConfig PostgresConfig
	// YunikornConfig specifies the configuration for the Yunikorn API.
	YunikornConfig YunikornConfig
	// LogConfig specifies the configuration for the logger.
	LogConfig LogConfig
}

func New

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

New creates a new Config object by loading the configuration from the provided path if provided, then load the configuration from environment variables prefixed with YHS_, so that environment variables take precedence.

type LogConfig

type LogConfig struct {
	LogLevel   string
	JSONFormat bool
}

type PostgresConfig

type PostgresConfig struct {
	Host                string
	DbName              string
	Username            string
	Password            string
	PoolMaxConnLifetime time.Duration
	PoolMaxConnIdleTime time.Duration
	Port                int
	PoolMaxConns        int
	PoolMinConns        int
	SSLMode             string
	Schema              string
}

func (*PostgresConfig) Validate

func (c *PostgresConfig) Validate() error

type YHSConfig

type YHSConfig struct {
	// Port specifies the port on which the Yunikorn History Server listens for incoming requests.
	Port int
	// AssetsDir specifies the directory where the static assets are stored.
	AssetsDir string
	// DataSyncInterval specifies the interval at which the data is synced from the Yunikorn API.
	DataSyncInterval time.Duration
}

func (*YHSConfig) Validate

func (c *YHSConfig) Validate() error

type YunikornConfig

type YunikornConfig struct {
	Host string
	Port int
	// Secure indicates whether the connection to the Yunikorn API is using encryption or not.
	Secure bool
}

YunikornConfig specifies the configuration for the Yunikorn API.

func (*YunikornConfig) Validate

func (c *YunikornConfig) Validate() error

Jump to

Keyboard shortcuts

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