component

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

type Base struct {
}

Base 组件基类,提供默认实现 嵌入此基类的组件只需实现需要的方法

func (*Base) Close

func (b *Base) Close() error

Close 关闭组件

func (*Base) Destroy

func (b *Base) Destroy() error

Destroy 销毁组件

func (*Base) Init

func (b *Base) Init() error

Init 初始化组件

func (*Base) Name

func (b *Base) Name() string

Name 组件名称

func (*Base) Start

func (b *Base) Start() error

Start 启动组件

type Component

type Component interface {
	// Name 组件名称
	Name() string
	// Init 初始化组件
	Init() error
	// Start 启动组件
	Start() error
	// Close 关闭组件
	Close() error
	// Destroy 销毁组件
	Destroy() error
}

Component 组件接口

Directories

Path Synopsis
http module

Jump to

Keyboard shortcuts

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