registry

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterEventProtocol

func RegisterEventProtocol(lc fx.Lifecycle, input RegisterEventProtocolInput) error

RegisterEvents 注册事件

func RegisterPubsubProtocol

func RegisterPubsubProtocol(lc fx.Lifecycle, input RegisterPubsubProtocolInput)

RegisterPubsubProtocol 注册订阅

func RegisterStreamProtocol

func RegisterStreamProtocol(lc fx.Lifecycle, input RegisterStreamProtocolInput)

RegisterStreamProtocol 注册流

Types

type NewEventRegistryOutput

type NewEventRegistryOutput struct {
	fx.Out
	Registry *eventbus.EventRegistry // 事件总线
}

func NewEventRegistry

func NewEventRegistry(lc fx.Lifecycle) (out NewEventRegistryOutput, err error)

NewEventRegistry 新的事件总线

type RegisterEventProtocolInput

type RegisterEventProtocolInput struct {
	fx.In
	Ctx          context.Context         // 全局上下文
	Opt          *opts.Options           // 文件存储选项配置
	P2P          *dep2p.DeP2P            // DeP2P网络主机
	PubSub       *pubsub.DeP2PPubSub     // DeP2P网络订阅
	DB           *sqlites.SqliteDB       // sqlite数据库服务
	UploadChan   chan *core.UploadChan   // 用于刷新上传的通道
	DownloadChan chan *core.DownloadChan // 用于刷新下载的通道

	Registry *eventbus.EventRegistry // 事件总线
	Cache    *ristretto.Cache        // 缓存实例
	Pool     *pool.MemoryPool        // 内存池
}

type RegisterPubsubProtocolInput

type RegisterPubsubProtocolInput struct {
	fx.In
	Ctx          context.Context         // 全局上下文
	Opt          *opts.Options           // 文件存储选项配置
	P2P          *dep2p.DeP2P            // DeP2P网络主机
	PubSub       *pubsub.DeP2PPubSub     // DeP2P网络订阅
	DB           *sqlites.SqliteDB       // sqlite数据库服务
	UploadChan   chan *core.UploadChan   // 用于刷新上传的通道
	DownloadChan chan *core.DownloadChan // 用于刷新下载的通道
	SearchChan   chan *core.SearchChan   // 用于刷新搜索的通道

	Registry *eventbus.EventRegistry // 事件总线
	Cache    *ristretto.Cache        // 缓存实例
	Pool     *pool.MemoryPool        // 内存池
}

type RegisterStreamProtocolInput

type RegisterStreamProtocolInput struct {
	fx.In
	Ctx          context.Context         // 全局上下文
	Opt          *opts.Options           // 文件存储选项配置
	P2P          *dep2p.DeP2P            // DeP2P网络主机
	PubSub       *pubsub.DeP2PPubSub     // DeP2P网络订阅
	DB           *sqlites.SqliteDB       // sqlite数据库服务
	UploadChan   chan *core.UploadChan   // 用于刷新上传的通道
	DownloadChan chan *core.DownloadChan // 用于刷新下载的通道
	StorageChan  chan *core.StorageChan  // 用于存储奖励的通知

	Registry *eventbus.EventRegistry // 事件总线
	Cache    *ristretto.Cache        // 缓存实例
	Pool     *pool.MemoryPool        // 内存池
}

Jump to

Keyboard shortcuts

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