data

package
v0.0.0-...-b509d7c Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AeSKeY string = "PoT*!^YwY#AeS"

	MD5    string = "MD5"
	SHA1   string = "SHA1"
	SHA256 string = "SHA256"

	ModeToken string = "TOKEN"
	ModeRsA   string = "RSA"
	ModeAeS   string = "AES"
)
View Source
const (
	PoT string = "PoT"

	// PoT Mode
	ReleaseMode string = "release"
	ConsoleMode string = "console"
)
View Source
const (
	// Models
	ModONE   string = "ONE"
	ModALL   string = "ALL"
	ModByAsc string = "ASC"
	ModByEsc string = "DESC"

	// ModJoinPoT
	ModJoinLEFT  string = "LEFT"
	ModJoinINNER string = "INNER"
	ModJoinRIGHT string = "RIGHT"
)
View Source
const (
	// Err Message Keywords
	ErrPfx       string = PoT
	PoTSuccessOK string = "SuccessOK"
	PoTErrorNull string = "ErrDefault"
)
View Source
const (
	// location zone
	TimeLocation string = "Asia/Shanghai"

	// time
	TimeHour   string = "HOUR"
	TimeMinute string = "MINUTE"
	TimeSecond string = "SECOND"

	// crypto
	JwTKeY string = "PoT*!^YwY#JwT"
)
View Source
const (
	// Zap Log Constant
	//   - LogFormat
	//   - LogFormatConsole
	//   - EncoderConfigure
	LogFormatJson    string = "json"
	LogFormatConsole string = "console"

	LogFileName   string = "./logs/pot/request.log"
	LogTime       string = "time"
	LogLevel      string = "level"
	LogName       string = "logger"
	LogCaller     string = "caller"
	LogMessage    string = "msg"
	LogStackTrace string = "stacktrace"

	// - Log Size -> 1M
	LogMaxSize int = 1
	// - Keep Days
	LogMaxBackups int = 5
	// - Keep Files Counts
	LogMaxAge int = 7
)
View Source
const (
	// Property File Suffix
	EnvDEV      string = "dev"
	EnvSTG      string = "stg"
	EnvPRD      string = "prd"
	PropertySfx string = "yaml"

	PropertyPort         string = "8577"
	PropertyMode         int    = 0
	PropertyTimeLocation string = "Asia/Shanghai"
	PropertyHsslPower    int    = 0
)
View Source
const (
	ReqMethodGET  = "GET"
	ReqMethodPUT  = "PUT"
	ReqMethodPOST = "POST"
)
View Source
const (
	// Status Success
	PoTStatusOK = http.StatusOK

	// Status Other
	PoTUnKnown         = -1
	PoTStatusNotFound  = http.StatusNotFound
	PoTStatusNoContent = http.StatusNoContent
)

Variables

View Source
var (
	PoTMode []interface{} = []interface{}{
		ConsoleMode,
		ReleaseMode,
	}
)
View Source
var (
	/**
	 * Modules: Property
	 *   - dev
	 *   - stg
	 *   - prd
	 */
	PropertySfxs []interface{} = []interface{}{
		EnvDEV,
		EnvSTG,
		EnvPRD,
	}
)
View Source
var (
	ReqMethods []interface{} = []interface{}{
		ReqMethodGET,
		ReqMethodPUT,
		ReqMethodPOST,
	}
)

Functions

func GeTErrMsg

func GeTErrMsg(pfx, k string, content ...interface{}) string

func SeTErrMsg

func SeTErrMsg(msg *ErrH)

Types

type ErrH

type ErrH map[string]H

Err Type

type H

type H map[string]interface{}

Default Type

type ModJoinPoT

type ModJoinPoT struct {
	JoinOperator string
	TableName    interface{}
	Condition    string
}

type ModPoT

type ModPoT struct {
	Types     string        `json:"types"` // Todo: "ONE"->"FetchOne" "ALL"->"FetchAll"
	Table     string        `json:"table"`
	Field     []string      `json:"field"`
	Joins     []*ModJoinPoT `json:"joins"`
	Limit     int           `json:"limit"`
	Start     []int         `json:"start"`
	Query     interface{}   `json:"query"`
	QueryArgs []interface{} `json:"query_args"`
	Columns   []string      `json:"columns"`
	OrderType string        `json:"order_type"`
	OrderArgs []string      `json:"order_args"`
}

Models Struct

type PowerPoT

type PowerPoT struct {
	JwT     int `yaml:"jwt" json:"jwt"`
	Adapter int `yaml:"adapter" json:"adapter"`
	Redis   int `yaml:"redis" json:"redis"`
}

Power

type SrvTpL

type SrvTpL struct {
	Status int
	Msg    interface{}
	Data   *H
}

func SrvTpLInitialized

func SrvTpLInitialized() *SrvTpL

type TpL

type TpL struct {
	Status   int
	Msg      interface{}
	Response *H
}

func TpLInitialized

func TpLInitialized() *TpL

type ZLogPoT

type ZLogPoT struct {
	FileName     string `yaml:"filename" json:"filename"`
	ZapCoreLevel string `yaml:"zap_core_level" json:"zap_core_level"`
	Format       string `yaml:"format" json:"format"`
	Time         string `yaml:"time" json:"time"`
	Level        string `yaml:"level" json:"level"`
	Name         string `yaml:"name" json:"name"`
	Caller       string `yaml:"caller" json:"caller"`
	Message      string `yaml:"message" json:"message"`
	StackTrace   string `yaml:"stacktrace" json:"stack_trace"`

	MaxSize    int `yaml:"max_size" json:"max_size"`
	MaxBackups int `yaml:"max_backups" json:"max_backups"`
	MaxAge     int `yaml:"max_age" json:"max_age"`
}

*

  • Modules: Logs

Jump to

Keyboard shortcuts

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