config

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2022 License: Apache-2.0 Imports: 11 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 Email

type Email struct {
	ApiKey                string `yaml:"api_key" mapstructure:"api_key" validate:"required"`
	SendAs                string `yaml:"send_as" mapstructure:"send_as" validate:"required"`
	VerifyEmailTemplateId string `yaml:"verify_template_id" mapstructure:"verify_template_id" validate:"required"`
	//nolint
	ForgotPasswordTemplateId string `yaml:"forgot_password_template_id" mapstructure:"forgot_password_template_id" validate:"required"`
	WelcomeEmailTemplateId   string `yaml:"welcome_template_id" mapstructure:"welcome_template_id" validate:"required"`
}

type GithubOAuth

type GithubOAuth struct {
	ClientID     string `yaml:"client_id" mapstructure:"client_id" validate:"required"`
	ClientSecret string `yaml:"client_secret" mapstructure:"client_secret" validate:"required"`
}

type Log

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

type OAuth

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

type OpenRegistryConfig

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

func ReadYamlConfig

func ReadYamlConfig() (*OpenRegistryConfig, error)

func (*OpenRegistryConfig) Endpoint

func (oc *OpenRegistryConfig) Endpoint() string

func (*OpenRegistryConfig) Validate added in v0.2.2

func (oc *OpenRegistryConfig) Validate() error

type Registry

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

func (*Registry) Address

func (r *Registry) Address() string

type Skynet

type Skynet struct {
	SkynetPortalURL string `yaml:"portal_url" mapstructure:"portal_url" validate:"required"`
	EndpointPath    string `yaml:"endpoint_path" mapstructure:"endpoint_path"`
	ApiKey          string `yaml:"api_key" mapstructure:"api_key"`
	CustomUserAgent string `yaml:"custom_user_agent" mapstructure:"custom_user_agent"`
}

type Store

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

func NewStoreConfig

func NewStoreConfig() (*Store, error)

func (*Store) Endpoint

func (sc *Store) Endpoint() string

type TLS

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

Jump to

Keyboard shortcuts

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