config

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Prod  = "production"
	Stage = "stage"
	Local = "local"
	CI    = "ci"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	SupportedServices map[string]bool `mapstructure:"supported_services"`
}

type Email

type Email struct {
	ApiKey                   string `mapstructure:"api_key"`
	SendAs                   string `mapstructure:"send_as"`
	VerifyEmailTemplateId    string `mapstructure:"verify_template_id"`
	ForgotPasswordTemplateId string `mapstructure:"forgot_password_template_id"`
	WelcomeEmailTemplateId   string `mapstructure:"welcome_template_id"`
	Enabled                  bool   `mapstructure:"enabled"`
}

type GithubOAuth

type GithubOAuth struct {
	Provider     string `mapstructure:"provider"`
	ClientID     string `mapstructure:"client_id"`
	ClientSecret string `mapstructure:"client_secret"`
}

type Log

type Log struct {
	Service    string `mapstructure:"name"`
	Endpoint   string `mapstructure:"endpoint"`
	AuthMethod string `mapstructure:"auth_method"`
	Username   string `mapstructure:"username"`
	Password   string `mapstructure:"password"`
}

type OAuth

type OAuth struct {
	Github GithubOAuth `mapstructure:"github"`
}

type OpenRegistryConfig

type OpenRegistryConfig struct {
	Registry                *Registry `mapstructure:"registry"`
	StoreConfig             *Store    `mapstructure:"database"`
	AuthConfig              *Auth     `mapstructure:"auth"`
	LogConfig               *Log      `mapstructure:"log_service"`
	SkynetConfig            *Skynet   `mapstructure:"skynet"`
	OAuth                   *OAuth    `mapstructure:"oauth"`
	Email                   *Email    `mapstructure:"email"`
	Environment             string    `mapstructure:"environment"`
	WebAppEndpoint          string    `mapstructure:"web_app_url"`
	WebAppRedirectURL       string    `mapstructure:"web_app_redirect_url"`
	WebAppErrorRedirectPath string    `mapstructure:"web_app_error_redirect_path"`
	Debug                   bool      `mapstructure:"debug"`
}

func ReadYamlConfig

func ReadYamlConfig() (*OpenRegistryConfig, error)

func (*OpenRegistryConfig) Endpoint

func (oc *OpenRegistryConfig) Endpoint() string

type Registry

type Registry struct {
	TLS           TLS      `mapstructure:"tls"`
	DNSAddress    string   `mapstructure:"dns_address"`
	FQDN          string   `mapstructure:"fqdn"`
	SigningSecret string   `mapstructure:"jwt_signing_secret"`
	Host          string   `mapstructure:"host"`
	Services      []string `mapstructure:"services"`
	Port          uint     `mapstructure:"port"`
}

func (*Registry) Address

func (r *Registry) Address() string

type Skynet

type Skynet struct {
	SkynetPortalURL string `mapstructure:"portal_url"`
	EndpointPath    string `mapstructure:"endpoint_path"`
	ApiKey          string `mapstructure:"api_key"`
	CustomUserAgent string `mapstructure:"custom_user_agent"`
	CustomCookie    string `mapstructure:"custom_cookie"`
}

type Store

type Store struct {
	Kind     string `mapstructure:"kind"`
	User     string `mapstructure:"username"`
	Host     string `mapstructure:"host"`
	Password string `mapstructure:"password"`
	Database string `mapstructure:"name"`
	Port     int    `mapstructure:"port"`
}

func NewStoreConfig

func NewStoreConfig() (*Store, error)

func (*Store) Endpoint

func (sc *Store) Endpoint() string

type TLS

type TLS struct {
	PrivateKey string `mapstructure:"priv_key"`
	PubKey     string `mapstructure:"pub_key"`
}

Jump to

Keyboard shortcuts

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