web

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Path      = "path"
	Query     = "query"
	Body      = "body"
	Header    = "header"
	Form      = "form"
	Multipart = "multipart"
	Context   = "context"
	Request   = "request"
	Response  = "response"
	Stream    = "stream"
)

Variables

View Source
var (
	SourceDefine  = []string{Path, Query, Body, Form, Header, Multipart, Context, Request, Response, Stream}
	DefaultSource = Query
)

Functions

This section is empty.

Types

type ApiInfo added in v1.3.0

type ApiInfo interface {
	GetHttpMethod() string
	GetURL() string
	GetDescription() string
	GetParams() []Param
	GetField() reflect.StructField
	GetMethodName() string
	GetMeta(tag string) string
}

type Configure added in v1.2.6

type Configure struct {
	bean.Component
	Charset string `yaml:"charset"`
}

func (*Configure) Prefix added in v1.2.6

func (c *Configure) Prefix() string

type Container added in v1.1.5

type Container interface {
	bean.Bean
	RegisterEndpoint(endpoint Endpoint)
	FsHandler(prefix, dir string)
	ListenAndServe(port int) error
}

type Endpoint added in v1.3.7

type Endpoint interface {
	GetApiInfo() ApiInfo
	GetServiceMethod() ServiceMethod
	Handler(mapper ParamMapper, handler func(result interface{}) error)
}

type FS added in v1.3.4

type FS struct{}

FS is file system mapping

type Filter added in v1.1.5

type Filter interface {
	bean.Bean
	Order() int
	UrlPatterns() Patterns
	DoFilter(w http.ResponseWriter, r *http.Request, chain FilterChain) error
}

type FilterChain added in v1.1.8

type FilterChain interface {
	GetFilter() Filter
	SetNext(chain FilterChain)
	GetNext() FilterChain
	DoFilter(w http.ResponseWriter, r *http.Request) error
	SetService(service Service)
	DoService(w http.ResponseWriter, r *http.Request) error
}

type Param added in v1.3.0

type Param interface {
	GetName() string
	GetSource() string
	GetSpecifyType() string
	GetType() reflect.Type
	SetType(t reflect.Type)
}

type ParamMapper added in v1.3.0

type ParamMapper interface {

	//ExtendedParamMapper
	Get(param Param) (interface{}, error)
	// contains filtered or unexported methods
}

type Patterns added in v1.2.2

type Patterns []string

type Rest added in v1.3.4

type Rest interface {
	GetType() string
}

Rest is restful mapping interface

type Service added in v1.1.9

type Service func(w http.ResponseWriter, r *http.Request) error

type ServiceMethod added in v1.3.6

type ServiceMethod interface {
	GetMethod() *reflect.Method
	GetValue() *reflect.Value
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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