Documentation ¶
Index ¶
- Constants
- Variables
- func ComplementHex(s string, x int) string
- func CreateUUID(xtr []byte) []byte
- func NewSession(types int)
- func Random() []byte
- func Sha1(b []byte) []byte
- func SplitString(str []byte, p []byte) []string
- type AutoRegister
- type Core
- type DynamicRoute
- type GlobalFunc
- type Groups
- func (mux *Groups) Connect(path string, handlerFunc HandlerFunc, middleName ...string)
- func (mux *Groups) Delete(path string, handlerFunc HandlerFunc, middleName ...string)
- func (mux *Groups) Get(path string, handlerFunc HandlerFunc, middleName ...string)
- func (mux *Groups) Group(path string, fn func(groups *Groups))
- func (mux *Groups) Head(path string, handlerFunc HandlerFunc, middleName ...string)
- func (mux *Groups) Middleware(name string, fn func(w http.ResponseWriter, r *http.Request, co *Core) bool)
- func (mux *Groups) Options(path string, handlerFunc HandlerFunc, middleName ...string)
- func (mux *Groups) Patch(path string, handlerFunc HandlerFunc, middleName ...string)
- func (mux *Groups) Post(path string, handlerFunc HandlerFunc, middleName ...string)
- func (mux *Groups) Put(path string, handlerFunc HandlerFunc, middleName ...string)
- func (mux *Groups) Trace(path string, handlerFunc HandlerFunc, middleName ...string)
- type HandlerFunc
- type Plugin
- type SX
- type Session
- type Son
- type Trie
- func (mux *Trie) AutoRegister(auto interface{}, middleware ...string) *AutoRegister
- func (mux *Trie) Connect(path string, handlerFunc HandlerFunc, middleName ...string)
- func (mux *Trie) Delete(path string, handlerFunc HandlerFunc, middleName ...string)
- func (mux *Trie) Dynamic(ymlPath string, route *DynamicRoute)
- func (mux *Trie) Find(key string, methods string) (string, HandlerFunc, http.Handler, string, string, bool)
- func (mux *Trie) Get(path string, handlerFunc HandlerFunc, middleName ...string)
- func (mux *Trie) GlobalFunc(name string, fn func(w http.ResponseWriter, r *http.Request, co *Core) error)
- func (mux *Trie) Group(path string, fn func(groups *Groups))
- func (mux *Trie) Handler(path string, handler http.Handler, middleName ...string)
- func (mux *Trie) Head(path string, handlerFunc HandlerFunc, middleName ...string)
- func (mux *Trie) Middle(name string, fn func(w http.ResponseWriter, r *http.Request, co *Core) bool)
- func (mux *Trie) Middleware(name string, fn func(w http.ResponseWriter, r *http.Request, co *Core) bool)
- func (mux *Trie) Options(path string, handlerFunc HandlerFunc, middleName ...string)
- func (mux *Trie) Patch(path string, handlerFunc HandlerFunc, middleName ...string)
- func (mux *Trie) Plugin(pluginStruct interface{})
- func (mux *Trie) Post(path string, handlerFunc HandlerFunc, middleName ...string)
- func (mux *Trie) Put(path string, handlerFunc HandlerFunc, middleName ...string)
- func (mux *Trie) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (mux *Trie) SetDebug()
- func (mux *Trie) SetLayout(path ...string)
- func (mux *Trie) SetView(path string)
- func (mux *Trie) StopSession()
- func (mux *Trie) Trace(path string, handlerFunc HandlerFunc, middleName ...string)
Constants ¶
View Source
const ( LOCAL = iota SpruceLocal SPRUCE )
Variables ¶
View Source
var ( Debug = false Layout []string OUT = "./view" )
add new component view render
View Source
var ( X *spruce.Hash OP = -1 )
这里是session组件的存 默认是 启用 开源通过 r.StopSession关闭 现版本是只能启用 LOCAL模式
View Source
var FileType = map[string]string{"html": "text/html", "json": "application/json", "css": "text/css", "txt": "text/plain", "zip": "application/x-zip-compressed", "png": "image/png", "jpg": "image/jpeg"}
Functions ¶
func ComplementHex ¶
func CreateUUID ¶
func NewSession ¶
func NewSession(types int)
func SplitString ¶
Types ¶
type Core ¶
type DynamicRoute ¶
type GlobalFunc ¶
type Groups ¶
func (*Groups) Connect ¶
func (mux *Groups) Connect(path string, handlerFunc HandlerFunc, middleName ...string)
func (*Groups) Delete ¶
func (mux *Groups) Delete(path string, handlerFunc HandlerFunc, middleName ...string)
func (*Groups) Get ¶
func (mux *Groups) Get(path string, handlerFunc HandlerFunc, middleName ...string)
handFunc
func (*Groups) Head ¶
func (mux *Groups) Head(path string, handlerFunc HandlerFunc, middleName ...string)
func (*Groups) Middleware ¶
func (*Groups) Options ¶
func (mux *Groups) Options(path string, handlerFunc HandlerFunc, middleName ...string)
func (*Groups) Patch ¶
func (mux *Groups) Patch(path string, handlerFunc HandlerFunc, middleName ...string)
func (*Groups) Post ¶
func (mux *Groups) Post(path string, handlerFunc HandlerFunc, middleName ...string)
type HandlerFunc ¶
type HandlerFunc func(http.ResponseWriter, *http.Request, *Core)
type Plugin ¶
type Plugin struct { }
要求有自动注册插件到Core中去 插件名字 插件结构体 插件应该要继承 Core 结构体 并且重写 AutoStart 和 AutoBefore 方法 插件执行时间 应该分为2个阶段 一个是 系统启动 一个是 执行HandlerFunc之前
func (*Plugin) AutoBefore ¶
func (pl *Plugin)AutoStart() interface{} { return nil }
type Trie ¶
type Trie struct {
// contains filtered or unexported fields
}
func (*Trie) AutoRegister ¶
func (mux *Trie) AutoRegister(auto interface{}, middleware ...string) *AutoRegister
func (*Trie) Connect ¶
func (mux *Trie) Connect(path string, handlerFunc HandlerFunc, middleName ...string)
func (*Trie) Delete ¶
func (mux *Trie) Delete(path string, handlerFunc HandlerFunc, middleName ...string)
func (*Trie) Dynamic ¶
func (mux *Trie) Dynamic(ymlPath string, route *DynamicRoute)
func (*Trie) GlobalFunc ¶
func (*Trie) Head ¶
func (mux *Trie) Head(path string, handlerFunc HandlerFunc, middleName ...string)
func (*Trie) Middleware ¶
func (*Trie) Options ¶
func (mux *Trie) Options(path string, handlerFunc HandlerFunc, middleName ...string)
func (*Trie) Patch ¶
func (mux *Trie) Patch(path string, handlerFunc HandlerFunc, middleName ...string)
func (*Trie) Post ¶
func (mux *Trie) Post(path string, handlerFunc HandlerFunc, middleName ...string)
func (*Trie) StopSession ¶
func (mux *Trie) StopSession()
Click to show internal directories.
Click to hide internal directories.