skyconfig

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2018 License: Apache-2.0 Imports: 10 Imported by: 7 modules, 24 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	HTTP struct {
		Host string `json:"host"`
	} `json:"http"`
	App struct {
		Name            string     `json:"name"`
		APIKey          string     `json:"api_key"`
		MasterKey       string     `json:"master_key"`
		AccessControl   string     `json:"access_control"`
		AuthRecordKeys  [][]string `json:"auth_record_keys"`
		DevMode         bool       `json:"dev_mode"`
		CORSHost        string     `json:"cors_host"`
		Slave           bool       `json:"slave"`
		ResponseTimeout int64      `json:"response_timeout"`
	} `json:"app"`
	DB struct {
		ImplName string `json:"implementation"`
		Option   string `json:"option"`
	} `json:"database"`
	TokenStore struct {
		ImplName string `json:"implementation"`
		Path     string `json:"path"`
		Prefix   string `json:"prefix"`
		Expiry   int64  `json:"expiry"`
		Secret   string `json:"secret"`
	} `json:"-"`
	Auth struct {
		CustomTokenSecret string `json:"custom_token_secret"`
	} `json:"auth"`
	AssetStore struct {
		ImplName string `json:"implementation"`
		Public   bool   `json:"public"`

		FileSystemStore struct {
			Path      string `json:"-"`
			URLPrefix string `json:"url_prefix"`
			Secret    string `json:"secret"`
		} `json:"fs"`

		S3Store struct {
			AccessToken string `json:"access_key"`
			SecretToken string `json:"secret_key"`
			Region      string `json:"region"`
			Bucket      string `json:"bucket"`
			URLPrefix   string `json:"url_prefix"`
		} `json:"s3"`

		CloudStore struct {
			Host          string `json:"host"`
			Token         string `json:"token"`
			PublicPrefix  string `json:"public_prefix"`
			PrivatePrefix string `json:"private_prefix"`
		} `json:"cloud"`
	} `json:"asset_store"`
	APNS struct {
		Enable bool   `json:"enable"`
		Type   string `json:"type"`
		Env    string `json:"env"`

		CertConfig struct {
			Cert     string `json:"cert"`
			Key      string `json:"key"`
			CertPath string `json:"-"`
			KeyPath  string `json:"-"`
		} `json:"cert_config"`

		TokenConfig struct {
			TeamID  string `json:"team_id"`
			KeyID   string `json:"key_id"`
			Key     string `json:"key"`
			KeyPath string `json:"-"`
		} `json:"token_config"`
	} `json:"apns"`
	GCM struct {
		Enable bool   `json:"enable"`
		APIKey string `json:"api_key"`
	} `json:"gcm"`
	LOG struct {
		Level           string            `json:"-"`
		LoggersLevel    map[string]string `json:"-"`
		RouterByteLimit int64             `json:"-"`
	} `json:"log"`
	LogHook struct {
		SentryDSN   string
		SentryLevel string
	} `json:"-"`
	Zmq struct {
		Timeout   int `json:"timeout"`
		MaxBounce int `json:"max_bounce"`
	} `json:"zmq"`
	Plugin    map[string]*PluginConfig `json:"-"`
	UserAudit struct {
		Enabled             bool     `json:"enabled"`
		TrailHandlerURL     string   `json:"trail_handler_url"`
		PwMinLength         int      `json:"pw_min_length"`
		PwUppercaseRequired bool     `json:"pw_uppercase_required"`
		PwLowercaseRequired bool     `json:"pw_lowercase_required"`
		PwDigitRequired     bool     `json:"pw_digit_required"`
		PwSymbolRequired    bool     `json:"pw_symbol_required"`
		PwMinGuessableLevel int      `json:"pw_min_guessable_level"`
		PwExcludedKeywords  []string `json:"pw_excluded_keywords"`
		PwExcludedFields    []string `json:"pw_excluded_fields"`
		PwHistorySize       int      `json:"pw_history_size"`
		PwHistoryDays       int      `json:"pw_history_days"`
		PwExpiryDays        int      `json:"pw_expiry_days"`
	} `json:"user_audit"`
}

Configuration is Skygear's configuration The configuration will load in following order: 1. The ENV 2. The key/value in .env file 3. The config in *.ini (To-be depreacted)

func NewConfiguration

func NewConfiguration() Configuration

func NewConfigurationWithKeys

func NewConfigurationWithKeys() Configuration

func (*Configuration) ReadFromEnv

func (config *Configuration) ReadFromEnv()

func (*Configuration) Validate

func (config *Configuration) Validate() error

type PluginConfig

type PluginConfig struct {
	Transport string
	Path      string
	Args      []string
}

Jump to

Keyboard shortcuts

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