Documentation ¶
Index ¶
- Constants
- func RegisterService(mux *http.ServeMux, s Service)
- type IDFn
- type NamespaceFn
- type Options
- func (o *Options) ClockOptions() clock.Options
- func (o *Options) IDFn() IDFn
- func (o *Options) InstrumentOptions() instrument.Options
- func (o *Options) NamespaceFn() NamespaceFn
- func (o *Options) ParserPool() *json.ParserPool
- func (o *Options) ReadTimeout() time.Duration
- func (o *Options) SetClockOptions(v clock.Options) *Options
- func (o *Options) SetIDFn(value IDFn) *Options
- func (o *Options) SetInstrumentOptions(v instrument.Options) *Options
- func (o *Options) SetNamespaceFn(value NamespaceFn) *Options
- func (o *Options) SetParserPool(value *json.ParserPool) *Options
- func (o *Options) SetReadTimeout(value time.Duration) *Options
- func (o *Options) SetTimeNanosFn(value TimeNanosFn) *Options
- func (o *Options) SetWriteTimeout(value time.Duration) *Options
- func (o *Options) TimeNanosFn() TimeNanosFn
- func (o *Options) WriteTimeout() time.Duration
- type Response
- type Service
- type TimeNanosFn
Constants ¶
const ( HealthPath = "/health" WritePath = "/write" QueryPath = "/query" )
A list of HTTP endpoints. TODO(xichen): API versioning.
Variables ¶
This section is empty.
Functions ¶
func RegisterService ¶
RegisterService registers handler service.
Types ¶
type NamespaceFn ¶
NamespaceFn determines the namespace a JSON document belongs to.
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
Options provide a set of options for service handlers.
func (*Options) ClockOptions ¶
ClockOptions returns the clock options.
func (*Options) InstrumentOptions ¶
func (o *Options) InstrumentOptions() instrument.Options
InstrumentOptions returns the instrument options.
func (*Options) NamespaceFn ¶
func (o *Options) NamespaceFn() NamespaceFn
NamespaceFn returns the ID function.
func (*Options) ParserPool ¶
func (o *Options) ParserPool() *json.ParserPool
ParserPool returns the pool for JSON parsers.
func (*Options) ReadTimeout ¶
ReadTimeout returns the timeout for a read request.
func (*Options) SetClockOptions ¶
SetClockOptions sets the clock options.
func (*Options) SetInstrumentOptions ¶
func (o *Options) SetInstrumentOptions(v instrument.Options) *Options
SetInstrumentOptions sets the instrument options.
func (*Options) SetNamespaceFn ¶
func (o *Options) SetNamespaceFn(value NamespaceFn) *Options
SetNamespaceFn sets the namespace function.
func (*Options) SetParserPool ¶
func (o *Options) SetParserPool(value *json.ParserPool) *Options
SetParserPool sets the pool for JSON parsers.
func (*Options) SetReadTimeout ¶
SetReadTimeout sets the timeout for a read request.
func (*Options) SetTimeNanosFn ¶
func (o *Options) SetTimeNanosFn(value TimeNanosFn) *Options
SetTimeNanosFn sets the timestamp function.
func (*Options) SetWriteTimeout ¶
SetWriteTimeout sets the timeout for a write request.
func (*Options) TimeNanosFn ¶
func (o *Options) TimeNanosFn() TimeNanosFn
TimeNanosFn returns the timestamp function.
func (*Options) WriteTimeout ¶
WriteTimeout returns the timeout for a write request.
type Response ¶
type Response struct { State string `json:"state,omitempty"` Error string `json:"error,omitempty"` }
Response is an HTTP response.
type Service ¶
type Service interface { // Health returns service health. Health(w http.ResponseWriter, r *http.Request) // Write writes one or more JSON events. Documents are delimited with newline. Write(w http.ResponseWriter, r *http.Request) // Query performs an document query. Query(w http.ResponseWriter, r *http.Request) }
Service provides handlers for serving HTTP requests.