config

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadEnvFromFile

func LoadEnvFromFile(filePath string) error

LoadEnvFromFile loads environment variables from a specified file.

Types

type Config

type Config struct {
	AccessToken              string
	BranchPattern            string
	ChannelsStr              string
	EnvVarContainingTemplate string
	EventToSendMessage       string
	InlineTemplate           string
	InvertMatchStr           string
	JobBranch                string
	JobStatus                string
	JobTag                   string
	TagPattern               string
	IgnoreErrorsStr          string
}

Config represents the configuration loaded from environment variables.

func NewConfig

func NewConfig() *Config

NewConfig loads configuration from environment variables.

func (*Config) ExpandEnvVariables

func (c *Config) ExpandEnvVariables() error

ExpandEnvVariables expands environment variables in the configuration values.

func (*Config) Validate

func (c *Config) Validate() error

Validate checks whether the necessary environment variables are set.

type EnvVarError

type EnvVarError struct {
	VarName string
}

func (*EnvVarError) Error

func (e *EnvVarError) Error() string

type ExpansionError

type ExpansionError struct {
	FieldName string
	Err       error
}

func (*ExpansionError) Error

func (e *ExpansionError) Error() string

Jump to

Keyboard shortcuts

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