Versions in this module Expand all Collapse all v8 v8.0.0 Nov 4, 2020 Changes in this version + const TwirpPackageIsVersion7 + func AddHTTPResponseHeader(ctx context.Context, key, value string) error + func HTTPRequestHeaders(ctx context.Context) (http.Header, bool) + func IsValidErrorCode(code ErrorCode) bool + func MethodName(ctx context.Context) (string, bool) + func PackageName(ctx context.Context) (string, bool) + func ServerHTTPStatusFromErrorCode(code ErrorCode) int + func ServiceName(ctx context.Context) (string, bool) + func SetHTTPResponseHeader(ctx context.Context, key, value string) error + func StatusCode(ctx context.Context) (string, bool) + func WithHTTPRequestHeaders(ctx context.Context, h http.Header) (context.Context, error) + func WriteError(resp http.ResponseWriter, err error) error + type ClientHooks struct + Error func(context.Context, Error) + RequestPrepared func(context.Context, *http.Request) (context.Context, error) + ResponseReceived func(context.Context) + func ChainClientHooks(hooks ...*ClientHooks) *ClientHooks + type ClientOption func(*ClientOptions) + func WithClientHooks(hooks *ClientHooks) ClientOption + func WithClientInterceptors(interceptors ...Interceptor) ClientOption + func WithClientLiteralURLs(b bool) ClientOption + func WithClientPathPrefix(prefix string) ClientOption + type ClientOptions struct + Hooks *ClientHooks + Interceptors []Interceptor + LiteralURLs bool + func (opts *ClientOptions) PathPrefix() string + type Error interface + Code func() ErrorCode + Error func() string + Meta func(key string) string + MetaMap func() map[string]string + Msg func() string + WithMeta func(key string, val string) Error + func InternalError(msg string) Error + func InternalErrorWith(err error) Error + func InvalidArgumentError(argument string, validationMsg string) Error + func NewError(code ErrorCode, msg string) Error + func NotFoundError(msg string) Error + func RequiredArgumentError(argument string) Error + func WrapError(twerr Error, err error) Error + type ErrorCode string + const Aborted + const AlreadyExists + const BadRoute + const Canceled + const DataLoss + const DeadlineExceeded + const FailedPrecondition + const Internal + const InvalidArgument + const Malformed + const NoError + const NotFound + const OutOfRange + const PermissionDenied + const ResourceExhausted + const Unauthenticated + const Unavailable + const Unimplemented + const Unknown + type Interceptor func(Method) Method + func ChainInterceptors(interceptors ...Interceptor) Interceptor + type Method func(ctx context.Context, request interface{}) (interface{}, error) + type ServerHooks struct + Error func(context.Context, Error) context.Context + RequestReceived func(context.Context) (context.Context, error) + RequestRouted func(context.Context) (context.Context, error) + ResponsePrepared func(context.Context) context.Context + ResponseSent func(context.Context) + func ChainHooks(hooks ...*ServerHooks) *ServerHooks + type ServerOption func(*ServerOptions) + func WithServerHooks(hooks *ServerHooks) ServerOption + func WithServerInterceptors(interceptors ...Interceptor) ServerOption + func WithServerJSONSkipDefaults(skipDefaults bool) ServerOption + func WithServerPathPrefix(prefix string) ServerOption + type ServerOptions struct + Hooks *ServerHooks + Interceptors []Interceptor + JSONSkipDefaults bool + func (opts *ServerOptions) PathPrefix() string Other modules containing this package github.com/3ventic/twirp