Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithHeaderParser ¶
WithHeaderParser is a custom middleware which used to fetch the header from incoming request and convert it to context.Context. Please take a note that we need to ignore "Accept", "Content-Type", and "Twirp-Version", all of these header's keys used by internal Twirp
Types ¶
type HTTPMiddleware ¶
HTTPMiddleware used as alias type for http's middleware
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service used to wrap given framework.TwirpServiceBuilder We use this object to make handle with our custom middleware and make sure our service's object still compatible with our framework.TwirpServiceBuilder
func New ¶
func New(svc framework.TwirpServiceBuilder) *Service
func (*Service) PathPrefix ¶
PathPrefix used to get path prefix from given service
func (*Service) ServeHTTP ¶
func (s *Service) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP used as "proxy" to our internal http handler
func (*Service) Use ¶
func (s *Service) Use(mw ...HTTPMiddleware)
Use attach multiple HTTPMiddleware