egovernor

package
Version: v0.6.16 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2021 License: MIT Imports: 18 Imported by: 11

Documentation

Index

Constants

View Source
const PackageName = "server.egovernor"

PackageName 包名

Variables

View Source
var (
	// DefaultServeMux ...
	DefaultServeMux = http.NewServeMux()
)

Functions

func HandleFunc

func HandleFunc(pattern string, handler http.HandlerFunc)

HandleFunc ...

Types

type Component

type Component struct {
	*http.Server
	// contains filtered or unexported fields
}

Component ...

func (*Component) GracefulStop

func (c *Component) GracefulStop(ctx context.Context) error

GracefulStop ..

func (*Component) Info

func (c *Component) Info() *server.ServiceInfo

Info ..

func (*Component) Init

func (c *Component) Init() error

Init 初始化

func (*Component) Name

func (c *Component) Name() string

Name 配置名称

func (*Component) PackageName

func (c *Component) PackageName() string

PackageName 包名

func (*Component) Start

func (c *Component) Start() error

Start 开始

func (*Component) Stop

func (c *Component) Stop() error

Stop ..

type Config

type Config struct {
	Host    string
	Port    int
	Network string
}

Config 配置

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig 默认配置

func (Config) Address

func (config Config) Address() string

Address 地址

type Container

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

Container 容器

func DefaultContainer

func DefaultContainer() *Container

DefaultContainer 默认容器

func Load

func Load(key string) *Container

Load 加载配置key

func (*Container) Build

func (c *Container) Build(options ...Option) *Component

Build 构建组件

type Option added in v0.3.3

type Option func(c *Container)

Option 可选项

func WithHost added in v0.3.3

func WithHost(host string) Option

WithHost 设置监控IP

func WithPort added in v0.3.3

func WithPort(port int) Option

WithPort 设置监控端口

Jump to

Keyboard shortcuts

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