skyconfig

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2017 License: Apache-2.0 Imports: 9 Imported by: 0

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"`
		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:"-"`
	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"`
	} `json:"zmq"`
	Plugin map[string]*PluginConfig `json:"-"`
}

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