Documentation
¶
Overview ¶
package risefront enables gracefully upgrading the server behing a tcp connection with zero-downtime (without disturbing running transfers or dropping incoming requests).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
New calls cfg.Run with opened listeners.
- if no other instance of risefront is found running, it will actually listen on the given addresses.
- if a parent instance of risefront is found running, it will ask this parent to forward all new connections.
The parent will live as long as the context lives. The child will live as long as the parent is alive and no other child has been started.
Types ¶
type Config ¶
type Config struct { Addresses []string // Addresses to listen to. Run func([]net.Listener) error // Handle the connections. All running connections should be closed before returning (srv.Shutdown for http.Server for instance). Dialer Dialer // Dialer for child-parent communication. Let empty for default dialer (PrefixDialer{}). Network string // "tcp" (default if empty), "tcp4", "tcp6", "unix" or "unixpacket" ErrorHandler func(kind string, err error) // Where errors should be logged (print to stderr by default) // contains filtered or unexported fields }
type Dialer ¶
type Dialer interface { Listen(name string) (net.Listener, error) Dial(name string) (net.Conn, error) }
Dialer is used for the child-parent communication.
type PrefixDialer ¶
type PrefixDialer struct {
Prefix string
}
PrefixDialer uses github.com/Microsoft/go-winio.{DialPipe,ListenPipe} on windows and net.{Dial,Listen} on other platforms.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.