Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Module = fx.Module("oker", fx.Provide( func(in telemetryIn) *telemetry { return &telemetry{ logger: in.Logger, counter: in.Counter, duration: in.Duration, } }), fx.Provide( func(cfg Config, t *telemetry) (*Server, error) { a, err := New( WithConfig(cfg), AddOkEventListener(t), ) return a, err }, ), )
Functions ¶
This section is empty.
Types ¶
type OkEvent ¶
type OkEvent struct { // At holds the time when the request was made. At time.Time // PartnerID is the partner id of the request. PartnerID string // Duration is the time needed to ok the request. Duration time.Duration // StatusCode is the resulting http status code. StatusCode int // Error is the resulting error. Err error }
OkEvent is the event that is sent about an ok request.
type OkEventListener ¶
type OkEventListener interface {
OnOkEvent(OkEvent)
}
OkEventListener is the interface that must be implemented by types that want to receive FetchEvent notifications.
type OkEventListenerFunc ¶
type OkEventListenerFunc func(OkEvent)
OkEventListenerFunc is a function type that implements OkEventListener. It can be used as an adapter for functions that need to implement the OkEventListener interface.
func (OkEventListenerFunc) OnEventEvent ¶
func (f OkEventListenerFunc) OnEventEvent(e OkEvent)
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
func AddOkEventListener ¶
func AddOkEventListener(listener OkEventListener, cancel ...*func()) Option
AddOkListener adds a listener for oking events. If the optional cancel parameter is provided, it is set to a function that can be used to cancel the listener.
func WithConfig ¶
Click to show internal directories.
Click to hide internal directories.