web

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2021 License: Apache-2.0 Imports: 4 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 {
	types.AutoConfigure `prefix:"application.web"`
	Charset             string `yaml:"charset"`
}

type Controller added in v1.4.2

type Controller interface {
	bean.Bean
	Group() string
}

Controller web restful api controller

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() []string
	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 FsController added in v1.4.3

type FsController interface {
	Controller
	Compile() bool
}

FsController static assets controller

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 RestMethod added in v1.4.1

type RestMethod interface {
	GetType() string
}

RestMethod is restful mapping interface

type Server added in v1.4.3

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

Server web server container

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