config

package
v0.0.0-...-71de28c Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2023 License: Apache-2.0 Imports: 3 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 {
	ServerConfig    ServerConfig
	GCPConfig       GCPConfig
	GitHubAppConfig GitHubAppConfig
}

func Get

func Get() *Config

func Load

func Load() (*Config, error)

type GCPConfig

type GCPConfig struct {
	Region string `env:"REGION" envDefault:"us-central1"`
}

func GetGCPConfig

func GetGCPConfig() GCPConfig

type GitHubAppConfig

type GitHubAppConfig struct {
	PrivateKey     string        `env:"GH_APP_PRIVATE_KEY,required"`
	RequestTimeout time.Duration `env:"GH_REQUEST_TIMEOUT"              envDefault:"1s"`
	AppID          int64         `env:"GH_APP_ID,required"`
	InstallationID int64         `env:"GH_APP_INSTALLATION_ID,required"`
}

func GetGitHubAppConfig

func GetGitHubAppConfig() GitHubAppConfig

type ServerConfig

type ServerConfig struct {
	LogLevel       string        `env:"LOG_LEVEL"               envDefault:"info"`
	WebhookSecret  string        `env:"WEBHOOK_SECRET,required"`
	Port           int           `env:"PORT"                    envDefault:"8080"`
	DefaultTimeout time.Duration `env:"DEFAULT_TIMEOUT"         envDefault:"10s"`
}

func GetServerConfig

func GetServerConfig() ServerConfig

Jump to

Keyboard shortcuts

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