server

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2024 License: Apache-2.0 Imports: 9 Imported by: 2

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"`
	Env         string `yaml:"env"`
}

type Option

type Option func(o *Options)

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
mid

Jump to

Keyboard shortcuts

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