config

package
v0.2.92 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	APIDefaultDisabled      = true
	APIDefaultListenAddress = "127.0.0.1:8081"
	APIDefaultEndpoint      = "localhost:8081"
	APIDefaultTLS           = false
	APIDefaultNextURL       = "https://loopholelabs.io"
)
View Source
const (
	DefaultDisabled      = false
	DefaultSessionDomain = "localhost"
	DefaultTLS           = true
)

Variables

View Source
var (
	ErrAPIListenAddressRequired  = errors.New("api listen address is required")
	ErrAPIEndpointRequired       = errors.New("api endpoint is required")
	ErrAPIDefaultNextURLRequired = errors.New("api default next url is required")

	ErrAPIGithubClientIDRequired     = errors.New("api github client id is required")
	ErrAPIGithubClientSecretRequired = errors.New("api github client secret is required")

	ErrAPIGoogleClientIDRequired     = errors.New("api google client id is required")
	ErrAPIGoogleClientSecretRequired = errors.New("api google client secret is required")

	ErrAPIMagicLinkFromRequired        = errors.New("api magic link from is required")
	ErrAPIMagicLinkProjectNameRequired = errors.New("api magic link project name is required")
	ErrAPIMagicLinkProjectURLRequired  = errors.New("api magic link project url is required")
	ErrAPIPostmarkAPITokenRequired     = errors.New("api postmark api token is required")
	ErrAPIPostmarkTemplateIDRequired   = errors.New("api postmark template id is required")
	ErrAPIPostmarkTagRequired          = errors.New("api postmark tag is required")
)
View Source
var (
	ErrSessionDomainRequired = errors.New("session domain is required")
)

Functions

This section is empty.

Types

type APIConfig

type APIConfig struct {
	Disabled             bool   `mapstructure:"disabled"`
	ListenAddress        string `mapstructure:"listen_address"`
	Endpoint             string `mapstructure:"endpoint"`
	TLS                  bool   `mapstructure:"tls"`
	DefaultNextURL       string `mapstructure:"default_next_url"`
	DeviceCodeEnabled    bool   `mapstructure:"device_code_enabled"`
	GithubEnabled        bool   `mapstructure:"github_enabled"`
	GithubClientID       string `mapstructure:"github_client_id"`
	GithubClientSecret   string `mapstructure:"github_client_secret"`
	GoogleEnabled        bool   `mapstructure:"google_enabled"`
	GoogleClientID       string `mapstructure:"github_client_id"`
	GoogleClientSecret   string `mapstructure:"github_client_secret"`
	MagicLinkEnabled     bool   `mapstructure:"magic_link_enabled"`
	MagicLinkFrom        string `mapstructure:"magic_link_from"`
	MagicLinkProjectName string `mapstructure:"magic_link_project_name"`
	MagicLinkProjectURL  string `mapstructure:"magic_link_project_url"`
	PostmarkAPIToken     string `mapstructure:"postmark_api_token"`
	PostmarkTemplateID   int    `mapstructure:"postmark_template_id"`
	PostmarkTag          string `mapstructure:"postmark_tag"`
}

func NewAPI

func NewAPI() *APIConfig

func (*APIConfig) GenerateOptions

func (c *APIConfig) GenerateOptions() *api.Options

func (*APIConfig) RootPersistentFlags

func (c *APIConfig) RootPersistentFlags(flags *pflag.FlagSet)

func (*APIConfig) Validate

func (c *APIConfig) Validate() error

type Config

type Config struct {
	Disabled      bool       `mapstructure:"disabled"`
	SessionDomain string     `mapstructure:"session_domain"`
	TLS           bool       `mapstructure:"tls"`
	API           *APIConfig `mapstructure:"api"`
}

func New

func New() *Config

func (*Config) GenerateOptions

func (c *Config) GenerateOptions(logName string) *auth.Options

func (*Config) RootPersistentFlags

func (c *Config) RootPersistentFlags(flags *pflag.FlagSet)

func (*Config) Validate

func (c *Config) Validate() error

Jump to

Keyboard shortcuts

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