Documentation ¶
Index ¶
- Constants
- Variables
- func New(servers []Server, opts ...option) (*app, error)
- func WithCallbackTimeout(timeout time.Duration) option
- func WithShutdownCallbacks(s ...ShutdownCallback) option
- func WithShutdownTimeout(timeout time.Duration) option
- func WithWaitTimeout(timeout time.Duration) option
- type Server
- type ShutdownCallback
Constants ¶
View Source
const ( // 选择不常用的值方便调试 InterruptExitCode = 13 TimeoutExitCode = 18 )
Variables ¶
View Source
var (
ErrAtLeastOneServer = errors.New("at least one server is required")
)
Functions ¶
func WithCallbackTimeout ¶
func WithShutdownCallbacks ¶
func WithShutdownCallbacks(s ...ShutdownCallback) option
func WithShutdownTimeout ¶
func WithWaitTimeout ¶
Types ¶
type ShutdownCallback ¶
Click to show internal directories.
Click to hide internal directories.