config

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: MIT Imports: 10 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 {
	ServeConfig   ServeConfig   `json:"serve" yaml:"serve"`
	LoggingConfig LoggingConfig `json:"logging" yaml:"logging"`
	GithubConfig  GithubConfig  `json:"github" yaml:"github"`
}

func New

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

type GithubConfig added in v0.1.4

type GithubConfig struct {
	PrivateKeyPath string `json:"private_key_path" yaml:"private_key_path"`
	AppID          int64  `json:"app_id" yaml:"app_id"`

	Installations map[string]GithubInstallation `json:"installations" yaml:"installations"`
}

type GithubInstallation added in v0.1.4

type GithubInstallation struct {
	ID int64 `json:"id" yaml:"id"`
}

type LoggingConfig

type LoggingConfig struct {
	Level       int    `json:"level"`
	Encoding    string `json:"encoding"`
	Development bool   `json:"development"`
}

type ServeConfig

type ServeConfig struct {
	BaseUrl string `json:"base_url" yaml:"base_url"`
	Port    int    `json:"port" yaml:"port"`
	Cors    struct {
		Enabled          bool     `json:"enabled" yaml:"enabled"`
		AllowOrigins     []string `json:"allowed_origins" yaml:"allowed_origins"`
		AllowedMethods   []string `json:"allowed_methods" yaml:"allowed_methods"`
		AllowHeaders     []string `json:"allow_headers" yaml:"allow_headers"`
		ExposeHeaders    []string `json:"expose_headers" yaml:"expose_headers"`
		AllowCredentials bool     `json:"allow_credentials" yaml:"allow_credentials"`
	} `json:"cors" yaml:"cors"`
	Timeout time.Duration `json:"timeout" yaml:"timeout"`
}

Jump to

Keyboard shortcuts

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