config

package
v0.0.0-...-ed3c475 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2020 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddConfigDirectory

func AddConfigDirectory(dir string)

Types

type AWSConfig

type AWSConfig struct {
	Region         string         `json:"region" mapstructure:"region"`
	UseCredentials bool           `json:"useCredentials" mapstructure:"useCredentials"`
	Credentials    AWSCredentials `json:"credentials" mapstructure:"credentials"`
	IsFargate      bool           `json:"isFargate" mapstructure:"isFargate"`
}

type AWSCredentials

type AWSCredentials struct {
	ID     string `json:"id" mapstructure:"id"`
	Secret string `json:"secret" mapstructure:"secret"`
	Token  string `json:"token" mapstructure:"token"`
}

type AblyConfig

type AblyConfig struct {
	Username string `json:"username" mapstructure:"region"`
	Password string `json:"password" mapstructure:"password"`
	Enabled  bool   `json:"enabled" mapstructure:"enabled"`
}

type AppleAuthConfig

type AppleAuthConfig struct {
	TeamID      string `json:"team_id" mapstructure:"team_id"`
	RedirectURI string `json:"redirect_uri" mapstructure:"redirect_uri"`
	ClientID    string `json:"client_id" mapstructure:"client_id"`
	KeyID       string `json:"key_id" mapstructure:"key_id"`
	PrivateKey  string `json:"privateKey" mapstructure:"apple_private_key"`
}

type AuthConfig

type AuthConfig struct {
	HMACSecret string `json:"hmacSecret" mapstructure:"hmacSecret"`
	Domain     string `json:"domain" mapstructure:"domain"`
}

type Config

type Config struct {
	Environment     string          `json:"env" mapstructure:"env"`
	DBConfig        DBConfig        `json:"db" mapstructure:"db"`
	SQLDBConfig     SQLDBConfig     `json:"sqldb" mapstructure:"sqldb"`
	Twitter         TwitterConfig   `json:"twitter" mapstructure:"twitter"`
	Auth            AuthConfig      `json:"auth" mapstructure:"auth"`
	AWS             AWSConfig       `json:"aws" mapstructure:"aws"`
	AblyConfig      AblyConfig      `json:"ably" mapstructure:"ably"`
	S3BucketConfig  S3BucketConfig  `json:"s3_bucket" mapstructure:"s3_bucket"`
	SQSConfig       SQSConfig       `json:"sqs" mapstructure:"sqs"`
	AppleAuthConfig AppleAuthConfig `json:"apple_auth_config" mapstructure:"apple_auth_config"`
}

func ReadConfig

func ReadConfig() (*Config, error)

func (*Config) ReadEnvAndUpdate

func (c *Config) ReadEnvAndUpdate()

type DBConfig

type DBConfig struct {
	Host         string       `json:"host" mapstructure:"host"`
	Port         int          `json:"port" mapstructure:"port"`
	Region       string       `json:"region" mapstructure:"region"`
	TablesConfig TablesConfig `json:"tables_config" mapstructure:"tables_config"`
}

type S3BucketConfig

type S3BucketConfig struct {
	MediaBucket    string `json:"media_bucket" mapstructure:"media_bucket"`
	CloudFrontURL  string `json:"cloudfront_url" mapstructure:"cloudfront_url"`
	BaseKey        string `json:"base_key" mapstructure:"base_key"`
	ImageKeyPrefix string `json:"image_prefix" mapstructure:"image_prefix"`
	GifKeyPrefix   string `json:"gif_prefix" mapstructure:"gif_prefix"`
	VideoKeyPrefix string `json:"video_prefix" mapstructure:"video_prefix"`
}

type SQLDBConfig

type SQLDBConfig struct {
	Host     string `json:"host" mapstructure:"host"`
	Port     int    `json:"port" mapstructure:"port"`
	DBName   string `json:"db_name" mapstructure:"db_name"`
	Username string
	Password string
}

type SQSConfig

type SQSConfig struct {
	DripURL    string `json:"drip_url" mapstructure:"drip_url"`
	MaxWorkers int    `json:"max_workers" mapstructure:"max_workers"`
	Enabled    bool   `json:"enabled" mapstructure:"enabled"`
}

type TableConfig

type TableConfig struct {
	TableName string `json:"table_name" mapstructure:"table_name"`
}

type TablesConfig

type TablesConfig struct {
	Discussions   TableConfig `json:"discussions" mapstructure:"discussions"`
	Participants  TableConfig `json:"participants" mapstructure:"participants"`
	PostBookmarks TableConfig `json:"post_bookmarks" mapstructure:"post_bookmarks"`
	Posts         TableConfig `json:"posts" mapstructure:"posts"`
	Users         TableConfig `json:"users" mapstructure:"users"`
	UserProfiles  TableConfig `json:"user_profiles" mapstructure:"user_profiles"`
	Viewers       TableConfig `json:"viewers" mapstructure:"viewers"`
}

type TwitterConfig

type TwitterConfig struct {
	ConsumerKey    string
	ConsumerSecret string
	Callback       string `json:"callback" mapstructure:"callback"`
	Redirect       string `json:"redirect" mapstructure:"redirect"`
	WebRedirect    string `json:"web_redirect" mapstructure:"web_redirect"`
}

Jump to

Keyboard shortcuts

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