Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Limiter ¶ added in v1.13.0
type Limiter interface { Engage(next http.HandlerFunc) http.HandlerFunc GetMaxDailyScore() uint GetTimeout() string GetHeaderKey() string GetRateLimitingMode() string }
Limiter is an interface that defines the methods for a rate limiter.
type Logger ¶
type Logger interface { Info(entry logjuice.GoogleLogEntry) Error(entry logjuice.GoogleLogEntry) Debug(entry logjuice.GoogleLogEntry) Warn(entry logjuice.GoogleLogEntry) Log(ctx context.Context, level logjuice.LogLevel, message, component string) SLog(ctx context.Context, level logjuice.LogLevel, emoji string, messages ...string) JSONLog(ctx context.Context, level logjuice.LogLevel, data interface{}, emoji string, message ...string) }
Logger is an interface that defines the methods for a logger.
type Pipeliner ¶ added in v1.13.0
type Pipeliner interface { ZRemRangeByScore(ctx context.Context, key string, min, max string) *redis.IntCmd ZAdd(ctx context.Context, key string, members ...redis.Z) *redis.IntCmd ZRange(ctx context.Context, key string, start, stop int64) *redis.StringSliceCmd Expire(ctx context.Context, key string, expiration time.Duration) *redis.BoolCmd Exec(ctx context.Context) ([]redis.Cmder, error) }
Pipeline is an interface that defines the methods for a Redis pipeline.
type RedisClient ¶ added in v1.13.0
type RedisClient interface {
Pipeline() Pipeliner
}
RedisClient is an interface that defines the methods for a Redis client.
type Responder ¶
type Responder interface { WriteJSONResponse(w http.ResponseWriter, data interface{}, code int, escapeHTML bool) error WriteErrorResponse(w http.ResponseWriter, code int) }
ResponseWriter is an interface that defines the methods for a response writer.
type Router ¶
type Router interface { Run(addr string, idleTimeout, readTimeout, writeTimeout time.Duration) error Register(reg *regexp.Regexp, handler http.HandlerFunc, weight pnutconfig.RequestWeight, methods ...string) error SetNotFoundHandler(handler http.HandlerFunc) Stop() error ServeHTTP(w http.ResponseWriter, req *http.Request) }
Router is an interface that defines the methods for a router.
Click to show internal directories.
Click to hide internal directories.