config

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2024 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheConfig

type CacheConfig struct {
	Type CacheTyp         `mapstructure:"type"`
	Disk *DiskCacheConfig `mapstructure:"disk"`
	S3   *S3CacheConfig   `mapstructure:"s3"`
}

type CacheTyp

type CacheTyp string
const (
	Memory CacheTyp = "memory"
	S3     CacheTyp = "s3"
	Disk   CacheTyp = "disk"
)

type Config

type Config struct {
	Addr      string        `mapstructure:"addr"`
	SqliteURL string        `mapstructure:"sqliteUrl"`
	Github    *GithubConfig `mapstructure:"github"`
	Local     *LocalConfig  `mapstructure:"local"`
	Page      *PageConfig   `mapstructure:"page"`
	Cache     *CacheConfig  `mapstructure:"cache"`
}

func Load

func Load(configFile string) (Config, error)

Loads the config file from configPath if specified.

Otherwise searches the standard list of search paths. Returns an error if no configuration files could be found.

func (Config) HasGithubAuth

func (c Config) HasGithubAuth() bool

func (Config) IsDBMode

func (c Config) IsDBMode() bool

Returns wether openchangelog should by started in database mode or in config mode

type DiskCacheConfig

type DiskCacheConfig struct {
	Location string `mapstructure:"location"`
	MaxSize  uint64 `mapstructure:"maxSize"`
}

type GithubAuth

type GithubAuth struct {
	AppID             int64  `mapstructure:"appId"`
	AppSecret         string `mapstructure:"appSecret"`
	AppPrivateKey     string `mapstructure:"appPrivateKey"`
	AppInstallationId int64  `mapstructure:"appInstallationId"`
	AccessToken       string `mapstructure:"accessToken"`
}

type GithubConfig

type GithubConfig struct {
	Owner string      `mapstructure:"owner"`
	Repo  string      `mapstructure:"repo"`
	Path  string      `mapstructure:"path"`
	Auth  *GithubAuth `mapstructure:"auth"`
}

type LocalConfig

type LocalConfig struct {
	FilesPath string `mapstructure:"filesPath"`
}

type LogoConfig

type LogoConfig struct {
	Src    string `mapstructure:"src"`
	Width  string `mapstructure:"width"`
	Height string `mapstructure:"height"`
	Link   string `mapstructure:"link"`
	Alt    string `mapstructure:"alt"`
}

type PageConfig

type PageConfig struct {
	Title    string      `mapstructure:"title"`
	Subtitle string      `mapstructure:"subtitle"`
}

type S3CacheConfig

type S3CacheConfig struct {
	Bucket string `mapstructure:"bucket"`
}

Jump to

Keyboard shortcuts

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