api_doc

package module
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

README

api_doc

Documentation

Index

Constants

View Source
const (
	Title int = iota
	Url
	Header
	Method
	Param
	Hint
	Return
)

Variables

View Source
var DefaultWriter io.Writer = os.Stdout

Functions

func InitAndRun

func InitAndRun(filepath string)

Types

type Config

type Config struct {
	Addr      string
	Port      string
	Files     []string
	ApiServ   string
	MatchKeys []map[string]string
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig(path string) *Config

type Context

type Context struct {
	Request *http.Request
	Write   http.ResponseWriter
}

func (*Context) FormValue

func (ctx *Context) FormValue(k string) string

func (*Context) Json

func (ctx *Context) Json(v interface{}) (int, error)

func (*Context) SetHeader

func (ctx *Context) SetHeader(k, v string)

type DataExchangeBody

type DataExchangeBody struct {
	Type     int
	Identity string
	Data     interface{}
}

type Doc

type Doc struct {
	Sum    string
	ConSum string
	Path   string
	Notes  []note
	Count  int
}

type Docs

type Docs struct {
	Doc
	// contains filtered or unexported fields
}

type Engine

type Engine struct {
	RouterGroup
	// contains filtered or unexported fields
}

func NewEngine

func NewEngine() *Engine

func (*Engine) Run

func (engine *Engine) Run(addr string) (err error)

func (*Engine) ServeHTTP

func (engine *Engine) ServeHTTP(writer http.ResponseWriter, request *http.Request)

type FWatcher

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

type HandlersChain

type HandlersChain []HttpHandlerFunc

type HttpHandlerFunc

type HttpHandlerFunc func(ctx *Context)

type Hub

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

管理客户

type Notify

type Notify struct {
	Event fsnotify.Event
	Name  string
}

type Response

type Response struct {
	Docs      []*Doc
	IpAddr    string
	Port      string
	ApiServer string
}

type RouterGroup

type RouterGroup struct {
	Handlers HandlersChain
	// contains filtered or unexported fields
}

func (*RouterGroup) BasePath

func (group *RouterGroup) BasePath() string

func (*RouterGroup) DELETE

func (group *RouterGroup) DELETE(relativePath string, handlers ...HttpHandlerFunc) IRoutes

func (*RouterGroup) GET

func (group *RouterGroup) GET(relativePath string, handlers ...HttpHandlerFunc) IRoutes

func (*RouterGroup) Group

func (group *RouterGroup) Group(relativePath string, handlers ...HttpHandlerFunc) *RouterGroup

func (*RouterGroup) Handler

func (group *RouterGroup) Handler(httpMethod, relativePath string, handlers ...HttpHandlerFunc) IRoutes

func (*RouterGroup) OPTION

func (group *RouterGroup) OPTION(relativePath string, handlers ...HttpHandlerFunc) IRoutes

func (*RouterGroup) POST

func (group *RouterGroup) POST(relativePath string, handlers ...HttpHandlerFunc) IRoutes

func (*RouterGroup) PUT

func (group *RouterGroup) PUT(relativePath string, handlers ...HttpHandlerFunc) IRoutes

func (*RouterGroup) Use

func (group *RouterGroup) Use(middleware ...HttpHandlerFunc) IRoutes

type Store

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

func NewStore

func NewStore() *Store

func (*Store) Delete

func (s *Store) Delete(k string)

func (*Store) GetFloat32

func (s *Store) GetFloat32(k string) float32

func (*Store) GetFloat64

func (s *Store) GetFloat64(k string) float64

func (*Store) GetInt

func (s *Store) GetInt(k string) int

func (*Store) GetString

func (s *Store) GetString(k string) string

func (*Store) GetValue

func (s *Store) GetValue(k string) interface{}

func (*Store) Run

func (s *Store) Run()

func (*Store) Set

func (s *Store) Set(k string, v interface{}, expire time.Duration)

type TransmissionData

type TransmissionData struct {
	Type     int
	Data     interface{}
	Status   int
	Identity string
}

@title: 数据传输结构体 @param: type:int:传输类型 @param: data:string:传输信息 @param: state:int:传输动作 @param: identity:string:身份信息

type Value

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

Jump to

Keyboard shortcuts

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