helpers

package
v0.0.0-...-f8ea5e8 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	JWTKey         string `json:"jwt_key"`
	Salt           string `json:"salt"`
	PasswordSuffix string `json:"password_suffix"`
	AuthExp        int    `json:"auth_exp"`

	OAuth      []OAuthInfo `json:"oauth"`
	OAuthState string      `json:"oauth_state"`
}

type Config

type Config struct {
	DB          DB                  `json:"db"`
	UserPicture UserPictureSettings `json:"user_picture"`
	Auth        Auth                `json:"auth"`

	AppPort   int      `json:"app_port"`
	ClientURL string   `json:"client_url"`
	ServerURL string   `json:"server_url"`
	Domains   []string `json:"domains"`
}

Config application config

func GetConfig

func GetConfig() *Config

GetConfig return application config

func ParseConfig

func ParseConfig(configFileName string) (*Config, error)

ParseConfig parse config file to Config structure

type DB

type DB struct {
	User      string    `json:"user"`
	Password  string    `json:"password"`
	Port      int       `json:"port"`
	DBName    string    `json:"dbname"`
	SSLMode   string    `json:"sslmode"`
	Migration Migration `json:"migration"`

	AdminPassword string `json:"admin_password"`
}

type Migration

type Migration struct {
	Files   string `json:"files"`
	Version int    `json:"version"`
}

type OAuthInfo

type OAuthInfo struct {
	Conf *oauth2.Config `json:"-"`

	ClientID     string `json:"id"`
	ClientSecret string `json:"secret"`
	Name         string `json:"name"`

	Scope         string `json:"scope"`
	TokenEndpoint string `json:"token_endpoint"`
	AuthEndpoint  string `json:"auth_endpoint"`
	InfoEndpoint  string `json:"info_endpoint"`
}
func (auth *OAuthInfo) Link() string

type UserPictureSettings

type UserPictureSettings struct {
	XMax int `json:"x_max"`
	YMax int `json:"y_max"`
	Size int `json:"size"` // in KBytes
}

Jump to

Keyboard shortcuts

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