Documentation
¶
Overview ¶
Package net contains the main logic to send and receive requests
I defines interfaces shared by other packages that accept or send requests Packages that implement these interfaces include:
- net/cache
- net/grpc
- net/http
It also manages the lifecycle of the handlers. All handlers should be registered to this package in order to be gracefuly stopped (drained) when the application shuts down.
Index ¶
Constants ¶
View Source
const ( // StateDown mode is the default state. The handler is not ready to accept // new connections StateDown uint32 = iota // StateUp mode is when a handler accepts connections StateUp // StateDrain mode is when a handler stops accepting new connection, but wait // for all existing in-flight requests to complete StateDrain )
Variables ¶
View Source
var ( // ErrEmptyReg is the error returned when there are no servers registered ErrEmptyReg = errors.New("there must be at least one registered server") // ErrDraining occurs when there is an attempt to access a draining `Server` ErrDraining = errors.New("server is draining") )
Functions ¶
func JoinHostPort ¶
JoinHostPort combines host and port into a network address of the form "host:port". If host contains a colon, as found in literal IPv6 addresses, then JoinHostPort returns "[host]:port".
See func Dial for a description of the host and port parameters.
Types ¶
type Reg ¶
type Reg struct {
// contains filtered or unexported fields
}
Reg (registry) holds a list of H
Directories
¶
Path | Synopsis |
---|---|
Package http is an extra layer on to of the standard go net/http package.
|
Package http is an extra layer on to of the standard go net/http package. |
Package naming is a library that converts a target to one or multiple network addresses.
|
Package naming is a library that converts a target to one or multiple network addresses. |
Package stream offers an abstraction layer for stream-processing platforms, such as NATS streaming.
|
Package stream offers an abstraction layer for stream-processing platforms, such as NATS streaming. |
Click to show internal directories.
Click to hide internal directories.