http

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BackOffForAttempt added in v1.1.0

func BackOffForAttempt(attempt float64) time.Duration

BackOffForAttempt calculates the backoff duration for a given attempt based on exponential backoff strategy. It takes the attempt number as a parameter and computes the backoff duration using the formula:

backoff = backOffMin * (backOffFactor ^ attempt)

func DefaultDuration

func DefaultDuration(value *time.Duration, defaultValue time.Duration) time.Duration

func DefaultInt

func DefaultInt(value *int, defaultValue int) int

Types

type Endpoint

type Endpoint struct {
	Pattern string
	Handler http.Handler
}

type Server

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

func NewServer

func NewServer(serverConfig *ServerConfig, ee []Endpoint, mm []func(http.Handler) http.Handler) *Server

func (*Server) Close

func (s *Server) Close()

func (*Server) Start

func (s *Server) Start() error

type ServerConfig

type ServerConfig struct {
	HttpAddress    string
	MaxHeaderBytes *int
	ReadTimeout    *time.Duration
	WriteTimeout   *time.Duration
	IdleTimeout    *time.Duration
}

Jump to

Keyboard shortcuts

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