Versions in this module Expand all Collapse all v2 v2.8.2 Nov 1, 2024 v2.8.1 Nov 1, 2024 Changes in this version + const SupportPackageIsVersion1 + func CodecForRequest(r *http.Request, name string) (encoding.Codec, bool) + func CodecForResponse(r *http.Response) encoding.Codec + func DefaultErrorDecoder(_ context.Context, res *http.Response) error + func DefaultErrorEncoder(w http.ResponseWriter, r *http.Request, err error) + func DefaultRequestDecoder(r *http.Request, v interface{}) error + func DefaultRequestEncoder(_ context.Context, contentType string, in interface{}) ([]byte, error) + func DefaultRequestQuery(r *http.Request, v interface{}) error + func DefaultRequestVars(r *http.Request, v interface{}) error + func DefaultResponseDecoder(_ context.Context, res *http.Response, v interface{}) error + func DefaultResponseEncoder(w http.ResponseWriter, r *http.Request, v interface{}) error + func RequestFromServerContext(ctx context.Context) (*http.Request, bool) + func SetCookie(ctx context.Context, cookie *http.Cookie) + func SetOperation(ctx context.Context, op string) + type CallOption interface + func ContentType(contentType string) CallOption + func Header(header *http.Header) CallOption + func Operation(operation string) CallOption + func PathTemplate(pattern string) CallOption + type Client struct + func NewClient(ctx context.Context, opts ...ClientOption) (*Client, error) + func (client *Client) Close() error + func (client *Client) Do(req *http.Request, opts ...CallOption) (*http.Response, error) + func (client *Client) Invoke(ctx context.Context, method, path string, args interface{}, reply interface{}, ...) error + type ClientOption func(*clientOptions) + func WithBlock() ClientOption + func WithDiscovery(d registry.Discovery) ClientOption + func WithEndpoint(endpoint string) ClientOption + func WithErrorDecoder(errorDecoder DecodeErrorFunc) ClientOption + func WithMiddleware(m ...middleware.Middleware) ClientOption + func WithNodeFilter(filters ...selector.NodeFilter) ClientOption + func WithRequestEncoder(encoder EncodeRequestFunc) ClientOption + func WithResponseDecoder(decoder DecodeResponseFunc) ClientOption + func WithSubset(size int) ClientOption + func WithTLSConfig(c *tls.Config) ClientOption + func WithTimeout(d time.Duration) ClientOption + func WithTransport(trans http.RoundTripper) ClientOption + func WithUserAgent(ua string) ClientOption + type ContentTypeCallOption struct + ContentType string + type Context interface + Bind func(interface{}) error + BindForm func(interface{}) error + BindQuery func(interface{}) error + BindVars func(interface{}) error + Blob func(int, string, []byte) error + Form func() url.Values + Header func() http.Header + JSON func(int, interface{}) error + Middleware func(middleware.Handler) middleware.Handler + Query func() url.Values + Request func() *http.Request + Reset func(http.ResponseWriter, *http.Request) + Response func() http.ResponseWriter + Result func(int, interface{}) error + Returns func(interface{}, error) error + Stream func(int, string, io.Reader) error + String func(int, string) error + Vars func() url.Values + XML func(int, interface{}) error + type DecodeErrorFunc func(ctx context.Context, res *http.Response) error + type DecodeRequestFunc func(*http.Request, interface{}) error + type DecodeResponseFunc func(ctx context.Context, res *http.Response, out interface{}) error + type EmptyCallOption struct + type EncodeErrorFunc func(http.ResponseWriter, *http.Request, error) + type EncodeRequestFunc func(ctx context.Context, contentType string, in interface{}) (body []byte, err error) + type EncodeResponseFunc func(http.ResponseWriter, *http.Request, interface{}) error + type FilterFunc func(http.Handler) http.Handler + func FilterChain(filters ...FilterFunc) FilterFunc + type Flusher = http.Flusher + type HandlerFunc func(Context) error + type Head struct + Code int + Msg string + type HeaderCallOption struct + type OperationCallOption struct + Operation string + type PathTemplateCallOption struct + Pattern string + type Redirector interface + Redirect func() (string, int) + func NewRedirect(url string, code int) Redirector + type Request = http.Request + type Response struct + Data any + type ResponseController = http.ResponseController + type ResponseWriter = http.ResponseWriter + type RouteInfo struct + Method string + Path string + type Router struct + func (r *Router) CONNECT(path string, h HandlerFunc, m ...FilterFunc) + func (r *Router) DELETE(path string, h HandlerFunc, m ...FilterFunc) + func (r *Router) GET(path string, h HandlerFunc, m ...FilterFunc) + func (r *Router) Group(prefix string, filters ...FilterFunc) *Router + func (r *Router) HEAD(path string, h HandlerFunc, m ...FilterFunc) + func (r *Router) Handle(method, relativePath string, h HandlerFunc, filters ...FilterFunc) + func (r *Router) OPTIONS(path string, h HandlerFunc, m ...FilterFunc) + func (r *Router) PATCH(path string, h HandlerFunc, m ...FilterFunc) + func (r *Router) POST(path string, h HandlerFunc, m ...FilterFunc) + func (r *Router) PUT(path string, h HandlerFunc, m ...FilterFunc) + func (r *Router) TRACE(path string, h HandlerFunc, m ...FilterFunc) + type Server struct + func NewServer(opts ...ServerOption) *Server + func (s *Server) Endpoint() (*url.URL, error) + func (s *Server) Handle(path string, h http.Handler) + func (s *Server) HandleFunc(path string, h http.HandlerFunc) + func (s *Server) Route(prefix string, filters ...FilterFunc) *Router + func (s *Server) ServeHTTP(res http.ResponseWriter, req *http.Request) + func (s *Server) Start(ctx context.Context) error + func (s *Server) Stop(ctx context.Context) error + func (s *Server) Use(selector string, m ...middleware.Middleware) + type ServerOption func(*Server) + func Address(addr string) ServerOption + func Endpoint(endpoint *url.URL) ServerOption + func ErrorEncoder(en EncodeErrorFunc) ServerOption + func Filter(filters ...FilterFunc) ServerOption + func Listener(lis net.Listener) ServerOption + func Logger(log.Logger) ServerOption + func MethodNotAllowedHandler(handler http.Handler) ServerOption + func Middleware(m ...middleware.Middleware) ServerOption + func Network(network string) ServerOption + func NotFoundHandler(handler http.Handler) ServerOption + func Prefix(prefix string) ServerOption + func RequestDecoder(dec DecodeRequestFunc) ServerOption + func RequestQueryDecoder(dec DecodeRequestFunc) ServerOption + func RequestVarsDecoder(dec DecodeRequestFunc) ServerOption + func ResponseEncoder(en EncodeResponseFunc) ServerOption + func TLSConfig(c *tls.Config) ServerOption + func Timeout(timeout time.Duration) ServerOption + type Target struct + Authority string + Endpoint string + Scheme string + type Transport struct + func (tr *Transport) Endpoint() string + func (tr *Transport) Kind() transport.Kind + func (tr *Transport) Operation() string + func (tr *Transport) PathTemplate() string + func (tr *Transport) ReplyHeader() transport.Header + func (tr *Transport) Request() *http.Request + func (tr *Transport) RequestHeader() transport.Header + type Transporter interface + PathTemplate func() string + Request func() *http.Request + type WalkRouteFunc func(RouteInfo) error