goft

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AnnotationList []Annotation
View Source
var ResponderList []Responder

Functions

func Convert

func Convert(handler interface{}) gin.HandlerFunc

func Error

func Error(err error, msg ...string)

func ErrorHandler

func ErrorHandler() gin.HandlerFunc

func GetConfigValue

func GetConfigValue(m UserConfig, prefix []string, index int) interface{}

func IsAnnotation

func IsAnnotation(t reflect.Type) bool

判断当前的 注入对象 是否是注解

func LoadConfigFile

func LoadConfigFile() []byte

Types

type Annotation

type Annotation interface {
	SetTag(tag reflect.StructTag)
	String() string
}

type BeanFactory

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

func NewBeanFactory

func NewBeanFactory() *BeanFactory

func (*BeanFactory) GetBean

func (this *BeanFactory) GetBean(bean interface{}) interface{}

外部使用

func (*BeanFactory) Inject

func (this *BeanFactory) Inject(object interface{})

type Fairing

type Fairing interface {
	OnRequest(ctx *gin.Context) error
}

type Goft

type Goft struct {
	*gin.Engine
	// contains filtered or unexported fields
}

func Ignite

func Ignite() *Goft

初始化函数

func (*Goft) Attach

func (this *Goft) Attach(f Fairing) *Goft

加载中间件

func (*Goft) Beans

func (this *Goft) Beans(beans ...interface{}) *Goft

func (*Goft) Handle

func (this *Goft) Handle(httpMethod, relativePath string, handler interface{}) *Goft

func (*Goft) Launch

func (this *Goft) Launch()

启动

func (*Goft) Mount

func (this *Goft) Mount(group string, classes ...IClass) *Goft

挂载路由

type GormAdapter

type GormAdapter struct {
	*gorm.DB
}

func NewGormAdapter

func NewGormAdapter() *GormAdapter

type IClass

type IClass interface {
	Build(goft *Goft)
}

type Model

type Model interface {
	String() string
}

type ModelResponder

type ModelResponder func(*gin.Context) Model

切片返回

func (ModelResponder) RespondTo

func (this ModelResponder) RespondTo() gin.HandlerFunc

type Models

type Models string

func MakeModels

func MakeModels(v interface{}) Models

type ModelsResponder

type ModelsResponder func(*gin.Context) Models

json返回

func (ModelsResponder) RespondTo

func (this ModelsResponder) RespondTo() gin.HandlerFunc

type Responder

type Responder interface {
	RespondTo() gin.HandlerFunc
}

type ServerConfig

type ServerConfig struct {
	Port int32  `yaml:"Port"`
	Name string `yaml:"Name"`
}

type StringResponder

type StringResponder func(*gin.Context) string

字符串返回

func (StringResponder) RespondTo

func (this StringResponder) RespondTo() gin.HandlerFunc

type SysConfig

type SysConfig struct {
	Server *ServerConfig `yaml:"Server"`
	Config UserConfig
}

func InitConfig

func InitConfig() *SysConfig

func NewSysConfig

func NewSysConfig() *SysConfig

type UserConfig

type UserConfig map[string]interface{}

type Value

type Value struct {
	Beanfactory *BeanFactory
	// contains filtered or unexported fields
}

func (*Value) SetTag

func (this *Value) SetTag(tag reflect.StructTag)

func (*Value) String

func (this *Value) String() string

Jump to

Keyboard shortcuts

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