config

package
v0.0.0-...-cc8cc2f Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Version = "1.0.0"

Functions

func LoadEnvConfig

func LoadEnvConfig() error

LoadEnvConfig Loads config from env

func ReadAppConfig

func ReadAppConfig(secrets []byte) error

ReadAppConfig reads a yaml config file

func ReadDBConfig

func ReadDBConfig(secrets []byte) error

ReadDBConfig reads a yaml config file

Types

type BestsellerSpecificConfig

type BestsellerSpecificConfig struct {
	Token   string `yaml:"token"`
	Running bool
}

type Config

type Config struct {
	Datadog            DatadogConfig            `yaml:"datadog"`
	Github             githubapp.Config         `yaml:"github"`
	HTTP               HTTPConfig               `yaml:"http"`
	Server             baseapp.HTTPConfig       `yaml:"server"`
	BestsellerSpecific BestsellerSpecificConfig `yaml:"bestseller_specific"`
	LogLevel           *int                     `yaml:"log_level,omitempty"`
}

Config contains global config

var AppConfig Config

AppConfig contains global app config

type DBConfigSpec

type DBConfigSpec struct {
	ConnectionName   string `yaml:"connection_name"`
	ConnectionString string `yaml:"connection_string"`
	DBName           string `yaml:"db_name"`
	Instance         string `yaml:"instance"`
	Password         string `yaml:"password"`
	Username         string `yaml:"username"`
}

DBConfig contains global db config

var DBConfig DBConfigSpec

DBConfig contains global db app config

type DatadogConfig

type DatadogConfig struct {
	APIKey string `yaml:"api_key"`
}

type EnvConfig

type EnvConfig struct {
	Config    string `required:"false"`
	DBConfig  string `required:"false"`
	LogLevel  *int   `required:"false"`
	DDAddress string `required:"false"`
	Schedule  string `required:"false"`
	WorkerURL string `required:"false"`
}

EnvConfig defines the structure of the global configuration parameters

var EnvVars EnvConfig

EnvVars stores the Global Configuration.

type HTTPConfig

type HTTPConfig struct {
	Token string `yaml:"token"`
}

type RepoConfig

type RepoConfig struct {
	TargetBranch string   `yaml:"target-branch,omitempty"`
	Reviewers    []string `yaml:"reviewers,omitempty"`
	Assignees    []string `yaml:"assignees,omitempty"`
	Labels       []string `yaml:"labels,omitempty"`
	Directory    string   `yaml:"directory,omitempty"`
	Schedule     string   `yaml:"schedule,omitempty"`
}

RepoConfig contains specific config for each repos

func ReadRepoConfig

func ReadRepoConfig(content []byte) (*RepoConfig, error)

ReadRepoConfig reads a yaml file

func (RepoConfig) IsValid

func (r RepoConfig) IsValid() error

IsValid checks if Repoconfig is valid

Jump to

Keyboard shortcuts

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