Documentation ¶
Index ¶
- Variables
- func EventSendHandler(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func EventStats(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func EventWaitHandler(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func Main()
- func RecvTimeout(ch <-chan bool, d time.Duration) (v bool, err error)
- func Router() *httprouter.Router
- func SemaphoreAcquireHandler(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func SemaphoreReleaseHandler(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func SemaphoreStats(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func SetField(s interface{}, f string, v interface{}) error
- func TokenBucketAcquireHandler(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func TokenBucketStats(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func ViewStats(w http.ResponseWriter, r *http.Request, ps httprouter.Params, f statsFunc)
- func WatchdogKickHandler(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func WatchdogStats(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func WatchdogWaitHandler(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func WellKnownReady(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- type Event
- type Metrics
- type Reply
- type Request
- type Semaphore
- type TokenBucket
- type Watchdog
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidSize = errors.New("request: 'size' must be a positive non-zero integer") ErrKeyError = errors.New("conflict: key already released or expired") ErrTimedOut = errors.New("timeout: 'maxwait' exceeded while waiting for token") ErrEventClosed = errors.New("conflict: event was already sent and closed") ErrNotFound = errors.New("request: object not found") )
Functions ¶
func EventSendHandler ¶
func EventSendHandler(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
func EventStats ¶
func EventStats(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
func EventWaitHandler ¶
func EventWaitHandler(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
func Router ¶
func Router() *httprouter.Router
func SemaphoreAcquireHandler ¶
func SemaphoreAcquireHandler(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
func SemaphoreReleaseHandler ¶
func SemaphoreReleaseHandler(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
func SemaphoreStats ¶
func SemaphoreStats(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
func TokenBucketAcquireHandler ¶
func TokenBucketAcquireHandler(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
func TokenBucketStats ¶
func TokenBucketStats(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
func ViewStats ¶
func ViewStats(w http.ResponseWriter, r *http.Request, ps httprouter.Params, f statsFunc)
func WatchdogKickHandler ¶
func WatchdogKickHandler(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
func WatchdogStats ¶
func WatchdogStats(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
func WatchdogWaitHandler ¶
func WatchdogWaitHandler(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
func WellKnownReady ¶
func WellKnownReady(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
Types ¶
type Metrics ¶
type Metrics struct { Nominal uint64 `json:"nominal"` Acquired uint64 `json:"acquired"` Released uint64 `json:"released"` WaitTime uint64 `json:"total_wait_time"` TimedOut uint64 `json:"timed_out"` Expired uint64 `json:"expired"` Reacquired uint64 `json:"reacquired"` CreatedAt string `json:"created_at"` }
type Reply ¶
func (*Reply) WriteResponse ¶
type Request ¶
type Semaphore ¶
type Semaphore struct { Name string Size uint64 Keys map[string]time.Duration Stats *Metrics // contains filtered or unexported fields }
type TokenBucket ¶
type TokenBucket struct { Name string Size uint64 Interval time.Duration Stats *Metrics // contains filtered or unexported fields }
func (*TokenBucket) GetStats ¶
func (bucket *TokenBucket) GetStats() *Metrics
Click to show internal directories.
Click to hide internal directories.