config

package
v0.0.0-...-7941b6a Latest Latest
Warning

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

Go to latest
Published: May 21, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Configure

func Configure(conf Configuration)

Configure sets the proper values for various important aspects of the library controlling the behavior of important process like emails and signups.

You may create a "gosaas.json" config file that will be automatically loaded at startup.

func LoadFromFile

func LoadFromFile() error

LoadFromFile loads the ./gosaas.json file as the default library configuration

Types

type Configuration

type Configuration struct {
	EmailLogin    string        `json:"emailLogin"`
	EmailPassword string        `json:"emailPassword"`
	EmailFrom     string        `json:"emailFrom"`
	EmailFromName string        `json:"emailFromName"`
	EmailProvider EmailProvider `json:"emailProvider"`

	StripeKey string             `json:"stripeKey"`
	Plans     []data.BillingPlan `json:"plans"`

	SignUpTemplate            string `json:"signupTemplate"`
	SignUpSendEmailValidation bool   `json:"sendEmailValidation"`
	SignUpSuccessRedirect     string `json:"signupSuccessRedirect"`
	SignUpErrorRedirect       string `json:"signupErrorRedirect"`
	SignInTemplate            string `json:"signinTemplate"`
	SignInSuccessRedirect     string `json:"signinSuccessRedirect"`
	SignInErrorRedirect       string `json:"signinErrorRedirect"`
	ForgotLoginTemplate       string `json:"forgotLoginTemplate"`
	ResetLoginTemplate        string `json:"resetLoginTemplate"`
	PwdChgSuccessRedirect     string `json:"pwdChgSuccessRedirect"`
}

Configuration defines important settings used across the library.

var Current Configuration

Current holds the current configuration

type EmailProvider

type EmailProvider string

EmailProvider defines possible implementation of email providers.

const (
	// EmailProviderSES used with Amazon SES email service.
	EmailProviderSES EmailProvider = "amazonses"
)

Jump to

Keyboard shortcuts

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