config

package
v0.0.0-...-785145d Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Giffy

type Giffy struct {
	configmeta.Meta `yaml:",inline"`

	// If this user authenticates it is automatically made a super-admin.
	AdminUserEmail string `json:"adminUserEmail" yaml:"adminUserEmail"`
	EncryptionKey  string `json:"encryptionKey" yaml:"encryptionKey"`

	CloudFrontDNS string `json:"cloudfrontDNS" yaml:"cloudfrontDNS"`
	S3Bucket      string `json:"s3Bucket" yaml:"s3Bucket"`

	SlackClientID          string `json:"slackClientID" yaml:"slackClientID"`
	SlackClientSecret      string `json:"slackClientSecret" yaml:"slackClientSecret"`
	SlackAuthReturnURL     string `json:"slackAuthReturnURL" yaml:"slackAuthReturnURL"`
	SlackVerificationToken string `json:"slackVerificationToken" yaml:"slackVerificationToken" env:"SLACK_VERIFICATION_TOKEN"`

	Aws        awsutil.Config `json:"aws" yaml:"aws"`
	DB         db.Config      `json:"db" yaml:"db"`
	GoogleAuth oauth.Config   `json:"googleAuth" yaml:"googleAuth"`
	Logger     logger.Config  `json:"logger" yaml:"logger"`
	Web        web.Config     `json:"web" yaml:"web"`
}

Giffy is the root config for the server.

func MustNewFromEnv

func MustNewFromEnv() *Giffy

MustNewFromEnv creates a new config from the environment. It will panic on error.

func NewFromEnv

func NewFromEnv() (*Giffy, error)

NewFromEnv creates a new config from the environment.

func (Giffy) GetEncryptionKey

func (g Giffy) GetEncryptionKey() []byte

GetEncryptionKey gets the config encryption key as a byte blob.

func (*Giffy) Resolve

func (g *Giffy) Resolve(ctx context.Context) error

Resolve resolves the config.

func (Giffy) ResolveS3Bucket

func (g Giffy) ResolveS3Bucket(_ context.Context) (*string, error)

GetS3Bucket gets a property or a default.

Jump to

Keyboard shortcuts

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