configuration

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CredentialPrefix = "CREDENTIAL:"
)

Variables

View Source
var (
	WellKnownAuthProviderIDs = FSNames{"GOOGLE"}
	WellKnownSMTPProviderIDs = FSNames{"SENDGRID"}
)

Functions

This section is empty.

Types

type AuthConfiguration

type AuthConfiguration struct {
	Google *oauth2.Config `json:"google,omitempty"`
}

type ConfigProvider

type ConfigProvider interface {
	Get() Configuration
	Set(config Configuration)
}

type Configuration

type Configuration struct {
	WebServer WebServerConfiguration     `json:"webServer"`
	Setup     SetupConfiguration         `json:"setup"`
	Database  DatabaseConfiguration      `json:"database"`
	FS        ForeignSystemConfiguration `json:"fs"`
	Prod      bool                       `json:"prod"`
}

type Credential

type Credential struct {
	Name        string            `json:"name"`
	Type        ForeignSystemType `json:"type"`
	ID          string            `json:"id"`
	Secret      string            `json:"-"`
	CreatedBy   store.Identity    `json:"createdBy"`
	CreatedDate time.Time         `json:"createdDate"`
}

func (Credential) Key

func (c Credential) Key() []byte

func (Credential) Prefix

func (c Credential) Prefix() []byte

type CredentialProvider

type CredentialProvider interface {
	Get(name string, fsType ForeignSystemType) (Credential, error)
	Set(cred Credential) error
	AllOf(fsType ForeignSystemType) ([]Credential, error)
	Delete(name string, fsType ForeignSystemType) error
}

type DatabaseConfiguration

type DatabaseConfiguration struct {
	DataDir       string `json:"dataDir"`
	FileIO        bool   `json:"fileIO"`
	EncryptionKey []byte `json:"-"`
}

type FSNames

type FSNames []string

func (FSNames) Includes

func (fs FSNames) Includes(fsName string) bool

type ForeignSystemConfiguration

type ForeignSystemConfiguration struct {
	Auth AuthConfiguration `json:"auth"`
	SMTP SMTPConfiguration `json:"smtp"`
}

type ForeignSystemType

type ForeignSystemType string
const (
	ForeignSystemTypeAuth ForeignSystemType = "AUTH"
	ForeignSystemTypeSMTP ForeignSystemType = "SMTP"
)

func (ForeignSystemType) Bytes

func (t ForeignSystemType) Bytes() []byte

type ForeignSystemTypes

type ForeignSystemTypes []ForeignSystemType

func (ForeignSystemTypes) Includes

func (t ForeignSystemTypes) Includes(fsType ForeignSystemType) bool

type Mode

type Mode struct {
	Prod bool
}

func (Mode) Coalesce

func (mode Mode) Coalesce(envKey, prodDefault, devDefault string) string

type Providers

type Providers struct {
	ConfigProvider
	Credential CredentialProvider
}

type SMTPConfiguration

type SMTPConfiguration struct {
	SendGrid *Credential `json:"sendGrid,omitempty"`
}

type SetupConfiguration

type SetupConfiguration struct {
	InitialAdmin    string `json:"initialAdmin"`
	InitialPassword string `json:"-"`
}

type WebServerConfiguration

type WebServerConfiguration struct {
	Protocol             string `json:"protocol"`
	Host                 string `json:"host"`
	Port                 string `json:"port"`
	UIProxyPort          string `json:"uiProxyPort"`
	ContentRoot          string `json:"contentRoot"`
	Status404HandlerName string `json:"status404HandlerName"`
}

func (WebServerConfiguration) HomePage

func (ws WebServerConfiguration) HomePage() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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