conf

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2017 License: MIT Imports: 11 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 {
	SiteURL string `mapstructure:"site_url" json:"site_url"`

	JWT struct {
		Secret         string `mapstructure:"secret" json:"secret"`
		AdminGroupName string `mapstructure:"admin_group_name" json:"admin_group_name"`
	} `mapstructure:"jwt" json:"jwt"`

	DB struct {
		Driver      string `mapstructure:"driver" json:"driver"`
		ConnURL     string `mapstructure:"url" json:"url"`
		Namespace   string `mapstructure:"namespace" json:"namespace"`
		Automigrate bool   `mapstructure:"automigrate" json:"automigrate"`
	} `mapstructure:"db" json:"db"`

	API struct {
		Host string `mapstructure:"host" json:"host"`
		Port int    `mapstructure:"port" json:"port"`
	} `mapstructure:"api" json:"api"`
	LogConf struct {
		Level string `mapstructure:"level"`
		File  string `mapstructure:"file"`
	} `mapstructure:"log_conf"`
	Mailer struct {
		Host       string `mapstructure:"host" json:"host"`
		Port       int    `mapstructure:"port" json:"port"`
		User       string `mapstructure:"user" json:"user"`
		Pass       string `mapstructure:"pass" json:"pass"`
		AdminEmail string `mapstructure:"admin_email" json:"admin_email"`
		Subjects   struct {
			OrderConfirmation string `mapstructure:"order_confirmation" json:"order_confirmation"`
			OrderReceived     string `mapstructure:"order_received" json:"order_received"`
		} `mapstructure:"subjects" json:"subjects"`
		Templates struct {
			OrderConfirmation string `mapstructure:"order_confirmation" json:"order_confirmation"`
			OrderReceived     string `mapstructure:"order_received" json:"order_received"`
		} `mapstructure:"templates" json:"templates"`
	} `mapstructure:"mailer" json:"mailer"`

	Payment struct {
		Stripe struct {
			SecretKey string `mapstructure:"secret_key" json:"secret_key"`
		} `mapstructure:"stripe" json:"stripe"`
		Paypal struct {
			ClientID string `mapstructure:"client_id" json:"client_id"`
			Secret   string `mapstructure:"secret" json:"secret"`
			Env      string `mapstructure:"env" json:"env"`
		} `mapstructure:"paypal" json:"paypal"`
	} `mapstructure:"payment" json:"payment"`

	Downloads struct {
		Provider     string `mapstructure:"provider" json:"provider"`
		NetlifyToken string `mapstructure:"netlify_token" json:"netlify_token"`
	} `mapstructure:"downloads" json:"downloads"`

	Coupons struct {
		URL      string `mapstructure:"url" json:"url"`
		User     string `mapstructure:"user" json:"user"`
		Password string `mapstructure:"password" json:"password"`
	} `mapstructure:"coupons" json:"coupons"`

	Webhooks struct {
		Order   string `mapstructure:"order" json:"order"`
		Payment string `mapstructure:"payment" json:"payment"`
		Update  string `mapstructure:"update" json:"update"`
		Refund  string `mapstructure:"refund" json:"refund"`

		Secret string `mapstructure:"secret" json:"secret"`
	} `mapstructure:"webhooks" json:"webhooks"`
}

Configuration holds all the confiruation for authlify

func Load

func Load(configFile string) (*Configuration, error)

Load will construct the config from the file `config.json`

Jump to

Keyboard shortcuts

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