models

package
v0.0.0-...-1015d97 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthType

type AuthType string
const (
	BasicAuth   AuthType = "basic"
	BearerToken AuthType = "bearer"
)

type Error

type Error struct {
	Source  interface{} `json:"source,omitempty"`
	Title   string      `json:"title,omitempty"`
	Message string      `json:"message,omitempty"`
	Code    int         `json:"code"`
}

Error represents an error that occurred while handling a request.

func (*Error) Error

func (e *Error) Error() (errStr string)

func (*Error) Log

func (e *Error) Log()

type HttpAuth

type HttpAuth struct {
	Type     AuthType `json:"auth_type"`
	Token    string   `json:"token,omitempty"`
	Username string   `json:"username,omitempty"`
	Password string   `json:"password,omitempty"`
}

type JwtResources

type JwtResources struct {
	JwtVerifyKey     crypto.PublicKey
	JwtSignKey       crypto.PrivateKey
	JwtSigningMethod jwt.SigningMethod
	JwtKeyfunc       jwt.Keyfunc
	JwtParser        *jwt.Parser
}

type Resources

type Resources struct {
	LogConfig      logger.Config
	FastHTTPClient *fasthttp.Client
	MainDbConn     *gorm.DB
	LogDbConn      *mongo.Database
	RedisStorage   *redis.Storage
	JwtResources   *JwtResources
	SessConfig     session.Config
}

type ResponseError

type ResponseError Error

ResponseError backward complatible Error

type ResponseForm

type ResponseForm struct {
	Result     interface{}     `json:"result,omitempty"`
	Data       interface{}     `json:"data,omitempty"`
	ResultInfo *ResultInfo     `json:"result_info,omitempty"`
	Messages   []string        `json:"messages,omitempty"`
	Errors     []ResponseError `json:"errors,omitempty"`
	Success    bool            `json:"success"`
}

type ResultInfo

type ResultInfo struct {
	Page      int `json:"page"`
	PerPage   int `json:"per_page"`
	Count     int `json:"count"`
	TotalCont int `json:"total_count"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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