Documentation ¶
Index ¶
- Constants
- func Fork() (int, error)
- func GetFiles(uc *net.UnixConn, filenames []string) ([]*os.File, error)
- func SendFiles(uc *net.UnixConn, fds []int) error
- func SetLogger(l Logger)
- func StopListener(ln net.Listener) error
- type FdsMetadata
- type Logger
- type NetGrace
- func (n *NetGrace) Close() error
- func (n *NetGrace) CloseIdleFiles() error
- func (n *NetGrace) CloseListener(ln net.Listener)
- func (n *NetGrace) Inherit() error
- func (n *NetGrace) ListInheritFilenames() []fileName
- func (n *NetGrace) Listen(network, address string) (net.Listener, error)
- func (n *NetGrace) Ready() (chan struct{}, error)
- type NetGraceOption
- type NetGraceProtocol
- type UpgradeRequest
Constants ¶
View Source
const ( PathMetadata = "/metadata" PathReady = "/ready" )
View Source
const (
DefaultUpgradeSock = "grace_upgrade.sock"
)
Variables ¶
This section is empty.
Functions ¶
func GetFiles ¶
GetFiles receives file descriptors from a Unix domain socket.
You need to close all files in the returned slice. The slice can be non-empty even if this function returns an error.
Use net.FileConn() if you're receiving a network connection.
func StopListener ¶
Types ¶
type FdsMetadata ¶
type FdsMetadata struct {
Filenames []fileName
}
type NetGrace ¶
type NetGrace struct {
// contains filtered or unexported fields
}
NetGrace handles zero downtime upgrades and passing files between processes.
func NewNetGrace ¶
func NewNetGrace(option NetGraceOption) (*NetGrace, error)
func (*NetGrace) CloseIdleFiles ¶
func (*NetGrace) CloseListener ¶
func (*NetGrace) Inherit ¶
Inherit load listener from old process by unixSocket 1. Dail to upgradeSocket to determine whether there is an old process 2. Reads length of fds from old process. Returns if length is 0 3. Response ack after bind listenSocket. Gets fds by listenSocket.
func (*NetGrace) ListInheritFilenames ¶
func (n *NetGrace) ListInheritFilenames() []fileName
type NetGraceOption ¶
type NetGraceOption struct {
UpgradeSock string
}
type NetGraceProtocol ¶
type NetGraceProtocol struct {
Data interface{}
}
type UpgradeRequest ¶
type UpgradeRequest struct {
Path string
}
Click to show internal directories.
Click to hide internal directories.