long_param

package
v0.0.0-...-de70ca6 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config interface {
	Logger() Logger
	Instrumentation() Instrumentation
}

Config combines environmental concerns like logging and instrumentation with any other config

type FancyFormatHandler

type FancyFormatHandler struct {
	*MyHandler
}

FancyFormatHandler does something fancy

func NewFancyFormatHandler

func NewFancyFormatHandler(config Config,
	parser Parser,
	limiter RateLimiter,
	loader Loader) *FancyFormatHandler

type FancyFormatter

type FancyFormatter struct{}

FancyFormatter Implements Formatter

func (*FancyFormatter) Format

func (f *FancyFormatter) Format(response http.ResponseWriter, data []byte) error

type Formatter

type Formatter interface {
	Format(resp http.ResponseWriter, data []byte) error
}

Formatter will build the output

type Instrumentation

type Instrumentation interface {
	Count(key string, value int)
	Duration(key string, start time.Time)
}

Instrumentation records the performances and events

type Loader

type Loader interface {
	Load(ID int) ([]byte, error)
}

Loader is responsible for loading the data

type Logger

type Logger interface {
	Error(message string, args ...interface{})
	Warn(message string, args ...interface{})
	Info(message string, args ...interface{})
	Debug(message string, args ...interface{})
}

Logger logs stuff

type MyHandler

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

MyHandler does something fantastic

func (*MyHandler) ServeHTTP

func (m *MyHandler) ServeHTTP(response http.ResponseWriter, request *http.Request)

type Parser

type Parser interface {
	Extract(req *http.Request) (int, error)
}

Parse will extract details from the request

type RateLimiter

type RateLimiter interface {
	Acquire()
	Release()
}

RateLimiter limits how many concurrent requests we can make or process

Jump to

Keyboard shortcuts

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