egovernor

package
v1.1.19 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: MIT Imports: 20 Imported by: 13

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
	EnableLocalMainIP bool
	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 defines a component instance.

func DefaultContainer

func DefaultContainer() *Container

DefaultContainer returns an default container.

func Load

func Load(key string) *Container

Load parses container configuration from configuration provider, such as a toml file, then use the configuration to construct a component container.

func (*Container) Build

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

Build constructs a specific component from container.

type Option added in v0.3.3

type Option func(c *Container)

Option overrides a Container's default configuration.

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