gapi

package module
v0.0.0-...-4c29529 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2021 License: MIT Imports: 9 Imported by: 0

README

GAPI

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CallHandler

type CallHandler interface {
	HandleRequest(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) Get

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

func (*Context) Next

func (ctx *Context) Next() error

func (*Context) Params

func (ctx *Context) Params() httprouter.Params

func (*Context) Request

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

func (*Context) Response

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

func (*Context) Set

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

func (*Context) SetResponse

func (ctx *Context) SetResponse(r http.ResponseWriter)

type HandleFunc

type HandleFunc func(ctx *Context) error

type Server

type Server struct {
	Dial     func(string) (*grpc.ClientConn, error)
	NotFound http.Handler
	// contains filtered or unexported fields
}

func NewServer

func NewServer() *Server

func (*Server) RegisterHandler

func (s *Server) RegisterHandler(name string, h CallHandler)

func (*Server) RegisterMiddleware

func (s *Server) RegisterMiddleware(name string, h HandleFunc)

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, req *http.Request)

func (*Server) UpdateRoute

func (s *Server) UpdateRoute(md *metadata.Metadata) error

func (*Server) Use

func (s *Server) Use(handle HandleFunc)

Directories

Path Synopsis
examples
handler
tests
updater

Jump to

Keyboard shortcuts

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