util

package
v0.0.0-...-3c4a4f3 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EventOutOfRangeError = errors.New("event out of range")
	EventHandleTwice     = errors.New("event handled twice")
)
View Source
var ConfigFile = "mirai_go.config"
View Source
var IsDebug = false
View Source
var TimeOutError = errors.New("time out")

Functions

func FutureFunc

func FutureFunc[T any](process func(resolve func(T), reject func(error))) *promise[T]

Types

type EventCenter

type EventCenter interface {
	// RegisterEvent to event center, return unique identifier for current event
	RegisterEvent() (uint32, chan *Result)
	// Notify the event with id, and pass param in to it
	Notify(id uint32, in any, err error) error
}

func New

func New(cap uint32) EventCenter

type Result

type Result struct {
	Data any
	Err  error
}

Jump to

Keyboard shortcuts

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