engine

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

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

func NewBuilder

func NewBuilder() *Builder

func (*Builder) Build

func (b *Builder) Build() *Engine

func (*Builder) Dialer

func (b *Builder) Dialer(dialer Dialer)

func (*Builder) NotFound

func (b *Builder) NotFound(notFound HandleFunc)

func (*Builder) RegisterHandler

func (b *Builder) RegisterHandler(name string, handler CallHandler)

func (*Builder) RegisterMiddleware

func (b *Builder) RegisterMiddleware(name string, handle HandleFunc)

func (*Builder) Use

func (b *Builder) Use(use HandleFunc)

type CallHandler

type CallHandler interface {
	ReadRequest(call *metadata.Call, ctx *Context) ([]byte, error)
	WriteResponse(call *metadata.Call, ctx *Context, data []byte) error
}

type Context

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

func (*Context) CacheBody added in v0.3.1

func (c *Context) CacheBody(data []byte)

func (*Context) Get

func (c *Context) Get(name string) (string, bool)

func (*Context) GetBody added in v0.3.1

func (c *Context) GetBody() []byte

func (*Context) Next

func (c *Context) Next() error

func (*Context) Params

func (c *Context) Params() Params

func (*Context) Query added in v0.3.1

func (c *Context) Query() url.Values

func (*Context) ReadBody added in v0.3.1

func (c *Context) ReadBody() ([]byte, error)

func (*Context) Request

func (c *Context) Request() *http.Request

func (*Context) Response

func (c *Context) Response() http.ResponseWriter

func (*Context) Set

func (c *Context) Set(name string, value string)

func (*Context) SetResponse added in v0.3.0

func (c *Context) SetResponse(w http.ResponseWriter)

type Dialer

type Dialer interface {
	Dial(server string) (*grpc.ClientConn, error)
}

type Engine

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

func (*Engine) ClearRouter added in v0.3.0

func (e *Engine) ClearRouter()

func (*Engine) Execute

func (e *Engine) Execute(w http.ResponseWriter, req *http.Request, params Params, chain []HandleFunc, handle HandleFunc)

func (*Engine) NotFound added in v0.3.0

func (e *Engine) NotFound(w http.ResponseWriter, req *http.Request)

func (*Engine) RebuildRouter

func (e *Engine) RebuildRouter(routes []*metadata.Route, ignoreError bool) error

func (*Engine) ServeHTTP

func (e *Engine) ServeHTTP(w http.ResponseWriter, req *http.Request)

type GrpcDialer

type GrpcDialer struct {
	Opts []grpc.DialOption
}

func (*GrpcDialer) Dial

func (d *GrpcDialer) Dial(server string) (*grpc.ClientConn, error)

type HandleFunc

type HandleFunc func(ctx *Context) error

type Params

type Params httprouter.Params

func (Params) Get

func (ps Params) Get(name string) (string, bool)

Jump to

Keyboard shortcuts

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