config

package
v0.0.0-...-3e0f7d7 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2017 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppConfig

type AppConfig struct {
	TLS     TLS               `yaml:"TLS"`
	Clients []Client          `yaml:"clients"`
	Payment []PaymentProvider `yaml:"payment"`
	Storage Storage           `yaml:"storage"`
	Locker  Locker            `yaml:"locker"`
}

AppConfig is the main config structure

func LoadConfig

func LoadConfig(configPath string) (conf *AppConfig, err error)

LoadConfig read file from provided path and returns *AppConfig or error

type Client

type Client struct {
	Serial string   `yaml:"serial"`
	Scopes []string `yaml:"scopes"`
}

Client is the client config structure accept serial and scopse

clients:
- serial: "A2FF9503829A3A0DDE9CB87191A472D4"
scopes:
- READ
- WRITE

type Locker

type Locker struct {
	Handler string   ` yaml:"handler"`
	Address []string ` yaml:"address"`
}

Locker is the lock server handler config

locker:
handler: zookeeper
address:
- localhost

type PaymentProvider

type PaymentProvider struct {
	Provider   string `yaml:"provider"`
	Secret     string `yaml:"secret"`
	Live       bool   `yaml:"live"`
	MerchId    string `yaml:"merchId"`
	PublicKey  string `yaml:"pubkey"`
	PrivateKey string `yaml:"priKey"`
}

PaymentProvider is the payment provider config

payment:
- provider: Stripe
secret: sk_test_0000000000000000000

type Storage

type Storage struct {
	Handler  string   `yaml:"handler"`
	Address  []string `yaml:"address"`
	Username string   `yaml:"username"`
	Password string   `yaml:"password"`
	Database string   `yaml:"database"`
}

Storage is the storage handler config

storage:
handler: mongodb
address:
- localhost

type TLS

type TLS struct {
	Key   string `yaml:"key"`
	Crt   string `yaml:"crt"`
	CACrt string `yaml:"ca"`
}

TLS is the tls config for running the server

TLS:
crt: out/server.com.crt
key: out/server.com.key
ca: out/ca.crt

Jump to

Keyboard shortcuts

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