echoadapter

package
v0.0.0-...-00694c9 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterService

func RegisterService(e *echo.Echo, spec httpadapter.ServiceSpec, connectHandler http.Handler, opts ...Option) error

Types

type Config

type Config struct {
	GroupPrefix          string
	Middlewares          []echo.MiddlewareFunc
	ConnectOptions       []connect.HandlerOption
	RequestBinder        binding.RequestBinder
	ResponseWriter       response.ResponseWriter
	Validator            validate.Validator
	ErrorMapper          adaptererrors.ErrorMapper
	ErrorWriter          adaptererrors.ErrorWriter
	MethodRequestBinders map[string]binding.RequestBinder
	MethodWriters        map[string]response.ResponseWriter
	MethodValidators     map[string]validate.Validator
	MethodErrorMappers   map[string]adaptererrors.ErrorMapper
	MethodErrorWriters   map[string]adaptererrors.ErrorWriter
}

func NewConfig

func NewConfig(opts ...Option) Config

type Option

type Option func(*Config)

func WithConnectOptions

func WithConnectOptions(options ...connect.HandlerOption) Option

func WithErrorMapper

func WithErrorMapper(mapper adaptererrors.ErrorMapper) Option

func WithErrorWriter

func WithErrorWriter(writer adaptererrors.ErrorWriter) Option

func WithGroupPrefix

func WithGroupPrefix(prefix string) Option

func WithMethodErrorMapper

func WithMethodErrorMapper(service, method string, mapper adaptererrors.ErrorMapper) Option

func WithMethodErrorMapperKey

func WithMethodErrorMapperKey(key string, mapper adaptererrors.ErrorMapper) Option

func WithMethodErrorWriter

func WithMethodErrorWriter(service, method string, writer adaptererrors.ErrorWriter) Option

func WithMethodErrorWriterKey

func WithMethodErrorWriterKey(key string, writer adaptererrors.ErrorWriter) Option

func WithMethodRequestBinder

func WithMethodRequestBinder(service, method string, binder binding.RequestBinder) Option

func WithMethodRequestBinderKey

func WithMethodRequestBinderKey(key string, binder binding.RequestBinder) Option

func WithMethodResponseWriter

func WithMethodResponseWriter(service, method string, writer response.ResponseWriter) Option

func WithMethodResponseWriterKey

func WithMethodResponseWriterKey(key string, writer response.ResponseWriter) Option

func WithMethodValidator

func WithMethodValidator(service, method string, validator validate.Validator) Option

func WithMethodValidatorKey

func WithMethodValidatorKey(key string, validator validate.Validator) Option

func WithMiddleware

func WithMiddleware(middlewares ...echo.MiddlewareFunc) Option

func WithRequestBinder

func WithRequestBinder(binder binding.RequestBinder) Option

func WithResponseWriter

func WithResponseWriter(writer response.ResponseWriter) Option

func WithValidator

func WithValidator(validator validate.Validator) Option

type ServiceRegistrar

type ServiceRegistrar struct {
	Spec           httpadapter.ServiceSpec
	ConnectHandler http.Handler
	Config         Config
}

func (ServiceRegistrar) Register

func (r ServiceRegistrar) Register(e *echo.Echo) error

Jump to

Keyboard shortcuts

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