def

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2022 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Content_JSON        = "application/json"
	CONTENT_STREAM      = "application/octet-stream"
	HEAD_CONST          = "API_HEADER_TYPE"
	CONTENT_DISPOSITION = "Content-Disposition"
)

Variables

This section is empty.

Functions

func GetMethodPools

func GetMethodPools() *methodsPools

GetMethodPools Fn [name]->

Types

type Adapter

type Adapter interface {
	Mapper(param ParamWarp) reflect.Value
	Register() []reflect.Type
}

type AppendHeader

type AppendHeader interface {
	Append(header ReadHeader) map[string]string
}

used in retType

type Caller

type Caller interface {
	// Call request ==> object
	Call(f *Entry, req *http.Request) interface{}
}

type Content

type Content struct {
	ContentType string
	Bytes       []byte
}

type ContentType

type ContentType interface {
	ContentType() string
}

used in retType

type Entry

type Entry struct {
	Url    string
	Group  string
	Method string
	Fn     interface{}
	Ids    sync.Map
}

type Error

type Error struct {
	ErrorMessage string `json:"error"`
	Code         int    `json:"code"`
}

func NewError

func NewError(string2 string) Error

func NewErrorCode

func NewErrorCode(string2 string, code int) Error

func (Error) Error

func (e Error) Error() string

type Flusher

type Flusher interface {
	// Flush sends any buffered data to the client.
	Flush()
}
type Header interface {
	ReadHeader
	WriteHeader
}

Header used in param eg. *

 GET(func(a def.Header) interface{} {
		return a.Values("Accept-Encoding")
 }, "/h")

type HttpStatus

type HttpStatus interface {
	Code() int
}

type Int16Req

type Int16Req int16

func (Int16Req) Int16

func (i Int16Req) Int16() int16

type Int32Req

type Int32Req int32

type Int64Req

type Int64Req int64

func (Int64Req) Int64 added in v0.0.4

func (i Int64Req) Int64() int64

type Int8Req

type Int8Req int8

func (Int8Req) Int32

func (i Int8Req) Int32() int32

func (Int8Req) Int8

func (i Int8Req) Int8() int8

type IntReq

type IntReq int

func (IntReq) Int

func (i IntReq) Int() int

type Match

type Match interface {
	Match(url *url.URL) *Entry
	Add(key string, data interface{})
}

type MethodInfo

type MethodInfo struct {
	Pkg        string                      `json:"pkg"`
	Receive    string                      `json:"receive"`
	Method     interface{}                 `json:"-"`
	MethodName string                      `json:"method_name"`
	Param      map[string]methods.ArgsMeta `json:"param"`
}

type Param

type Param struct {
	Order int    `json:"order"`
	Name  string `json:"name"`
}

type ParamWarp

type ParamWarp struct {
	http.Request
	PTyp   reflect.Type
	PValue string
	Path   string
	PName  string
}

type ReadHeader

type ReadHeader interface {
	Get(key string) string
	Values(key string) []string
}

type RetAdapter

type RetAdapter interface {
	ContentType
	Return() io.Reader
	Register() []reflect.Type
}

type Serialize

type Serialize interface {
	Encode(interface{}) *Content
	// Decode interface{} is out
	Decode([]byte, interface{}) error
}

type StringReq

type StringReq string

func (StringReq) String

func (i StringReq) String() string

type WriteHeader

type WriteHeader interface {
	Add(key, value string)
}

Jump to

Keyboard shortcuts

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