gf

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	XIgnoreKey        = "x-ignore" //忽略api显示的自定义key
	XAttrKey          = "x-attr"
	StaticVirtualPath = "/static/files"
	PublicVirtualPath = "/static/public"
	ViewPath          = "/views"
)

Variables

This section is empty.

Functions

func DbCTX added in v1.0.2

func DbCTX(ctx context.Context) gdb.DB

func Register added in v1.0.2

func Register(cnf DBConf)

Register 注册数据库上下文

Types

type AttrType

type AttrType string
const (
	AllowAnonymous AttrType = "allow-anonymous" //允许通过所有验证
)

func (AttrType) String

func (e AttrType) String() string

type BReq

type BReq struct {
}

func (*BReq) GetFile

func (b *BReq) GetFile(ctx context.Context) (multipart.File, *multipart.FileHeader, error)

GetFile 获取文件对象

func (*BReq) ReqCTX

func (b *BReq) ReqCTX(ctx context.Context) *ghttp.Request

ReqCTX 拉取上下文

type BSConf

type BSConf struct {
	Port       int
	RootPrefix string
}

type BootStrap

type BootStrap struct {
	// contains filtered or unexported fields
}

func NewBStrap added in v1.0.3

func NewBStrap(conf BSConf) *BootStrap

func (*BootStrap) AllAttribute added in v1.0.4

func (boot *BootStrap) AllAttribute(r *ghttp.Request) []string

AllAttribute 属性

func (*BootStrap) AllowAnonymous added in v1.0.4

func (boot *BootStrap) AllowAnonymous(r *ghttp.Request) bool

AllowAnonymous 允许跳过各种验证

func (*BootStrap) Attribute added in v1.0.4

func (boot *BootStrap) Attribute(r *ghttp.Request, a AttrType) bool

Attribute 属性

func (*BootStrap) GetServer added in v1.0.4

func (boot *BootStrap) GetServer() *ghttp.Server

func (*BootStrap) OAI added in v1.0.4

func (boot *BootStrap) OAI() *goai.OpenApiV3

OAI openApiV3实例

func (*BootStrap) Run added in v1.0.4

func (boot *BootStrap) Run()

Run 执行

func (*BootStrap) Use added in v1.0.4

func (boot *BootStrap) Use(h ...func(r *ghttp.Request)) *BootStrap

func (*BootStrap) UseController added in v1.0.4

func (boot *BootStrap) UseController(prefix string, ctrl ...interface{}) *BootStrap

func (*BootStrap) UseCors added in v1.0.4

func (boot *BootStrap) UseCors() *BootStrap

func (*BootStrap) UseOAI added in v1.0.4

func (boot *BootStrap) UseOAI(authKey, title, description, ver string) *BootStrap

func (*BootStrap) UsePublic added in v1.0.4

func (boot *BootStrap) UsePublic() *BootStrap

func (*BootStrap) UseStatic added in v1.0.4

func (boot *BootStrap) UseStatic() *BootStrap

func (*BootStrap) UseView added in v1.0.4

func (boot *BootStrap) UseView() *BootStrap

type DBConf added in v1.0.2

type DBConf struct {
	Host  string
	Port  string
	User  string
	Pass  string
	Name  string
	Type  string
	Debug bool
}

type RType

type RType int
const (
	API RType
	VIEW
)

type Res

type Res interface {
	Type() RType
	Write(r *ghttp.Request)
}

Jump to

Keyboard shortcuts

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