web

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2021 License: Apache-2.0 Imports: 3 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(adapter ParamAdapter, handler func(result interface{}) error)
}

type FS added in v1.3.4

type FS struct{}

FS is file system mapping

type FeignClient added in v1.4.1

type FeignClient interface {
	bean.Bean
	Name() string
	Url() string
	Path() string
}

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() 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 ParamAdapter added in v1.4.1

type ParamAdapter interface {
	GetStringFromPath(name string) (string, error)
	GetRequest() *http.Request
	GetResponseWriter() http.ResponseWriter
}

type Patterns added in v1.2.2

type Patterns []string

type RestMethod added in v1.4.1

type RestMethod interface {
	GetType() string
}

RestMethod is restful mapping interface

type Service added in v1.1.9

type Service func() 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