Documentation ¶
Index ¶
- func Do(s HttpService, ctx context.Context) error
- func NewCancellationFilter() saola.Filter
- func NewRequestLogFilter(f func(e LogEntry)) saola.Filter
- func NewResponseStatsFilter(stats stats.StatsReceiver) saola.Filter
- func NewStdRequestLogFilter() saola.Filter
- func Serve(addr string, s saola.Service) error
- func WithParams(ctx context.Context, p Params) context.Context
- func WithServerRequest(ctx context.Context, w http.ResponseWriter, r *http.Request) context.Context
- type CancellableRoundTripper
- type Client
- type ClientRequest
- type Endpoint
- func (e *Endpoint) Do(ctx context.Context) error
- func (e *Endpoint) DoHTTP(_ context.Context, w http.ResponseWriter, r *http.Request) error
- func (e *Endpoint) GET(path string, s saola.Service)
- func (e *Endpoint) Name() string
- func (e *Endpoint) POST(path string, s saola.Service)
- func (e *Endpoint) PUT(path string, s saola.Service)
- type FuncService
- type HttpService
- type LogEntry
- type Params
- type ResponseWriter
- type ServerRequest
- type StatusCodeInterceptor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCancellationFilter ¶
func NewRequestLogFilter ¶
func NewResponseStatsFilter ¶
func NewResponseStatsFilter(stats stats.StatsReceiver) saola.Filter
func NewStdRequestLogFilter ¶
func WithServerRequest ¶
Types ¶
type CancellableRoundTripper ¶
type CancellableRoundTripper interface { http.RoundTripper CancelRequest(*http.Request) }
type Client ¶
type Client struct { Filter saola.Filter Transport CancellableRoundTripper // contains filtered or unexported fields }
type ClientRequest ¶
func GetClientRequest ¶
func GetClientRequest(ctx context.Context) *ClientRequest
type Endpoint ¶
type Endpoint struct {
// contains filtered or unexported fields
}
func NewEndpoint ¶
func NewEndpoint() *Endpoint
type FuncService ¶
func (FuncService) DoHTTP ¶
func (f FuncService) DoHTTP(ctx context.Context, w http.ResponseWriter, r *http.Request) error
func (FuncService) Name ¶
func (f FuncService) Name() string
type HttpService ¶
type Params ¶
type Params struct {
// contains filtered or unexported fields
}
func EmptyParams ¶
func EmptyParams() Params
type ResponseWriter ¶
type ResponseWriter struct { http.ResponseWriter // contains filtered or unexported fields }
func NewResponseWriter ¶
func NewResponseWriter(w http.ResponseWriter) *ResponseWriter
func (*ResponseWriter) CloseNotify ¶
func (w *ResponseWriter) CloseNotify() <-chan bool
func (*ResponseWriter) Flush ¶
func (w *ResponseWriter) Flush()
func (*ResponseWriter) StatusCode ¶
func (w *ResponseWriter) StatusCode() int
func (*ResponseWriter) WriteHeader ¶
func (w *ResponseWriter) WriteHeader(code int)
type ServerRequest ¶
type ServerRequest struct { Writer http.ResponseWriter Request *http.Request }
func GetServerRequest ¶
func GetServerRequest(ctx context.Context) *ServerRequest
type StatusCodeInterceptor ¶
type StatusCodeInterceptor interface {
StatusCode() int
}
Click to show internal directories.
Click to hide internal directories.