server

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(opts ...Option)

func Signal

func Signal() <-chan os.Signal

Signal 全局退出信号接收

Types

type Config

type Config struct {
	ServiceName   string     `yaml:"service_name"`
	Debug         bool       `yaml:"debug"`
	Env           string     `yaml:"env"`
	LogLevel      logx.Level `yaml:"log_level"`
	DeadDelayTime int        `yaml:"dead_delay_time"`
}

type Option

type Option func(o *Options)

func WithDelayTime

func WithDelayTime(delay int) Option

func WithServer

func WithServer(srv ...Server) Option

type Options

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

type Server

type Server interface {
	Start()
	Shutdown(ctx context.Context) error
}

Server 各个服务,安全退出的接口定义

Directories

Path Synopsis
middleware
rpc

Jump to

Keyboard shortcuts

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