data

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2020 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Config            *Configuration
	DatabaseConfig    *DatabaseConfiguration
	RedisConfig       *RedisConfiguration
	GoogleOauthConfig *GoogleOauthConfiguration
	EmailConfig       *EmailConfiguration
)

Config global config

Functions

func LoadProductionConfig added in v1.0.5

func LoadProductionConfig()

LoadProductionConfig load config

Types

type APIResponse added in v1.0.5

type APIResponse struct {
	Message string      `json:",omitempty"`
	Data    interface{} `json:",omitempty"`
}

APIResponse api response

type AlertData

type AlertData struct {
	IsInfo    bool
	IsSuccess bool
	IsWarning bool
	IsDanger  bool
	Message   string
}

AlertData used in web pages and api responses

type Configuration

type Configuration struct {
	RapidAPIKey string `env:"RAPIDAPI_KEY"`

	JwtKey          []byte
	Host            string `env:"HOST"`
	ResourceVersion string `env:"RESOURCE_VERSION"`

	HTTPS         bool `env:"HTTPS" envDefault:"false"`
	EnableSitemap bool `env:"ENABLE_SITEMAP" envDefault:"false"`
	IsDebug       bool `env:"DEBUG" envDefault:"false"`
}

Configuration app configuration

type DatabaseConfiguration

type DatabaseConfiguration struct {
	ConnectionString string `env:"CONNECTION_STRING" envDefault:"db.db"`
	Driver           string `env:"DB_DRIVER" envDefault:"sqlite3"`
}

DatabaseConfiguration gorm

type EmailConfiguration added in v1.1.4

type EmailConfiguration struct {
	SMTPServer   string `env:"SMTP_SERVER"`
	EmailAddress string `env:"EMAIL_ADDRESS"`
	Password     string `env:"EMAIL_PASSWORD"`
}

EmailConfiguration email configuration for email sms

type GoogleOauthConfiguration

type GoogleOauthConfiguration struct {
	ClientID     string `env:"GOOGLE_CLIENT_ID"`
	ClientSecret string `env:"GOOGLE_CLIENT_SECRET"`
}

GoogleOauthConfiguration google oauth2

type HeaderData

type HeaderData struct {
	Title           string
	Description     string
	ResourceVersion string
	PageStyle       *PageStyleData `json:",omitempty"`
	Nav             *NavData       `json:",omitempty"`
	Alert           *AlertData     `json:",omitempty"`
}

HeaderData header data

type LoginData

type LoginData struct {
	Username string
	ImageURL string
}

LoginData page login info

type NavData struct {
	StyleName string
	Login     *LoginData `json:",omitempty"`
}

NavData nav bar

type PageResponse added in v1.0.5

type PageResponse struct {
	Header *HeaderData `json:",omitempty"`
	Data   interface{}
}

PageResponse page response

func (*PageResponse) SetAlert added in v1.0.5

func (r *PageResponse) SetAlert(alert *AlertData)

SetAlert set alert

func (*PageResponse) SetLogin added in v1.0.5

func (r *PageResponse) SetLogin(login *LoginData)

SetLogin set login

func (*PageResponse) SetNavStyleName added in v1.0.5

func (r *PageResponse) SetNavStyleName(style *PageStyleData)

SetNavStyleName set nav style name

type PageStyleData

type PageStyleData struct {
	Name      string
	Link      string
	Integrity string
}

PageStyleData bootswatch styles

type RedisConfiguration

type RedisConfiguration struct {
	Addr     string `env:"REDIS_ADDR"`
	Password string `env:"REDIS_PASSWORD"`
	DB       int    `env:"REDIS_DB" envDefault:"0"`
}

RedisConfiguration redis config

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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