data

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 18, 2020 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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 {
	DatabaseConfig    *DatabaseConfiguration
	RedisConfig       *RedisConfiguration
	GoogleOauthConfig *GoogleOauthConfiguration

	JwtKey          []byte
	Host            string
	ResourceVersion string

	HTTPS         bool
	EnableSitemap bool
	IsDebug       bool
}

Configuration app configuration

var Config *Configuration

Config global config

type DatabaseConfiguration

type DatabaseConfiguration struct {
	ConnectionString string
	Driver           string
}

DatabaseConfiguration gorm

type GoogleOauthConfiguration

type GoogleOauthConfiguration struct {
	ClientID     string
	ClientSecret string
}

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 JWTClaim

type JWTClaim struct {
	ImageURL string `json:"image_url"`
	jwt.StandardClaims
}

JWTClaim web claim

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 PageStyleData

type PageStyleData struct {
	Name      string
	Link      string
	Integrity string
}

PageStyleData bootswatch styles

type RedisConfiguration

type RedisConfiguration struct {
	Addr     string
	Password string
	DB       int
}

RedisConfiguration redis config

type Response

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

Response page and api response

func (*Response) SetAlert

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

SetAlert set alert

func (*Response) SetLogin

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

SetLogin set login

func (*Response) SetNavStyleName

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

SetNavStyleName set nav style name

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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