app

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var App = &app{
	Provider: providers.P,
}

App 核心实体

Functions

func Auth

func Auth() services.AuthService

Auth 获取 Auth 服务

func Cache

func Cache() services.CacheService

Cache 获取缓存服务

func Config

func Config() *configs.Config

Config 获取配置服务

func Cookie() services.CookieService

Cookie 获取 Cookie 服务

func DB

func DB() services.DBService

DB 获取数据库服务

func Exception

func Exception() *exceptions.Exception

Exception 获取异常服务

func Get

func Get(key string) services.Service

Get 通用获取服务方法

func Logger

func Logger() services.LoggerService

Logger 获取日志服务

func Passwd

func Passwd() services.PasswdService

Passwd 获取密码服务

func Response

func Response() *responses.Response

Response 获取响应体

func Route

func Route() services.RouteService

Route 获取路由服务

func Run

func Run()

Run 启动 App

func SetApp

func SetApp(cliApp *cli.App)

SetApp 设置 Cli App

func SymCrypt

func SymCrypt() services.SymCryptService

SymCrypt 获取对称加密服务

func Translate

func Translate() services.TranslateService

Translate 获取翻译服务

func Upload

func Upload() services.UploadService

Upload 获取上传服务

func Util

func Util() services.UtilService

Util 获取工具服务

func Validator

func Validator() services.ValidatorService

Validator 获取验证器

Types

type Controller

type Controller struct{}

type Data

type Data map[string]any

Data HTML 数据

type Model

type Model interface {
	In(request RequestIFace, r Rule) (Model, error)
	Out(r Rule) (any, error)
	SetModel(i Model) Model
}

type ModelHandle

type ModelHandle struct {
	Model `gorm:"-"`
}

func (*ModelHandle) In

func (m *ModelHandle) In(request RequestIFace, r Rule) (Model, error)

In 数据进来

func (*ModelHandle) Out

func (m *ModelHandle) Out(r Rule) (any, error)

Out 数据出去

func (*ModelHandle) SetModel

func (m *ModelHandle) SetModel(i Model) Model

SetModel 设置具体模型

type Request

type Request struct {
	*gin.Context `json:"-" xml:"-" form:"-" query:"-" protobuf:"-" msgpack:"-" yaml:"-" uri:"-" header:"-" toml:"-"`
	CsrfToken    string `form:"csrf_token" json:"csrf_token" xml:"csrf_token" uri:"csrf_token"`
}

func (*Request) Validate

func (r *Request) Validate(c *gin.Context, req RequestIFace) error

Validate 执行验证

type RequestIFace

type RequestIFace interface {
	Validate(c *gin.Context, req RequestIFace) error
}

RequestIFace 通用请求接口

type Rule

type Rule map[string]any

type Skips

type Skips []string

Jump to

Keyboard shortcuts

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