requestcount

package
v0.0.0-...-d80a93d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2016 License: MIT Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IRequestCounter

type IRequestCounter interface {
	Get(ctx context.Context) *RequestCount
	Run() error
	Close() error
}

type IStorage

type IStorage interface {
	Open(filename string, length int) ([]uint64, error)
	Close() error
	Flush() error
}

type RequestCount

type RequestCount struct {
	Count uint64 `json:"count"`
}

type RequestCounter

type RequestCounter struct {
	// contains filtered or unexported fields
}

func NewRequestCounter

func NewRequestCounter(cfg *RequestCounterConfig) *RequestCounter

func (*RequestCounter) Close

func (prc *RequestCounter) Close() error

func (*RequestCounter) Get

func (prc *RequestCounter) Get(ctx context.Context) *RequestCount

func (*RequestCounter) Run

func (prc *RequestCounter) Run() error

type RequestCounterConfig

type RequestCounterConfig struct {
	IntervalCount    int
	IntervalDuration time.Duration
	Filename         string
	Persistent       bool
	PersistDuration  time.Duration
	Logger           log.ILogger
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL