xgo

package module
v0.0.0-...-b19fcff Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Modules = map[string]*ModuleEntry{}

Functions

func CheckInit

func CheckInit()

func HasModule

func HasModule(key string) bool

func PostMessage

func PostMessage(sender *ModuleEntry, target *ModuleEntry, msg *XPostMessage) error

Types

type MainEntry

type MainEntry struct {
	Module *ModuleEntry
}
var Main *MainEntry

func NewMainEntry

func NewMainEntry() *MainEntry

type ModuleEntry

type ModuleEntry struct {
	Key           string
	Url           string
	Tags          *xtags
	UsedBy        *usedBy
	Alias         string
	OnPostMessage func(msg *XPostMessage) error
	OnRequest     func(*XReqRes) error
}

func GetModuleEntry

func GetModuleEntry(key string) *ModuleEntry

func ListAllModuleEntrys

func ListAllModuleEntrys() []*ModuleEntry

func NewModuleEntry

func NewModuleEntry(key string, tags ...string) *ModuleEntry

func (*ModuleEntry) PostMessage

func (me *ModuleEntry) PostMessage(target *ModuleEntry, msg *XPostMessage) error

type XPostMessage

type XPostMessage struct {
	Sender  *ModuleEntry
	Target  *ModuleEntry
	Key     string   // Key of the message
	Path    string   // Path of the message
	Args    []string // Arguments for the message
	Message string
}

func NewPostMessage

func NewPostMessage(key string, args ...string) *XPostMessage

type XReqRes

type XReqRes struct {
	Req *XRequest
	Res *XResponse
}

type XRequest

type XRequest struct {
	Sender  *ModuleEntry
	Target  *ModuleEntry
	Key     string   // Key of the request
	Path    string   // Path of the request
	Args    []string // Arguments for the request
	Message string   // Message for the request
}

func NewRequest

func NewRequest(key string, args ...string) *XRequest

type XResponse

type XResponse struct {
	Sender  *ModuleEntry
	Target  *ModuleEntry
	Key     string   // Key of the response
	Path    string   // Path of the response
	Args    []string // Arguments for the response
	Message string   // Message for the response
}

func NewResponse

func NewResponse(key string, args ...string) *XResponse

func SendRequest

func SendRequest(sender *ModuleEntry, target *ModuleEntry, req *XRequest) (*XResponse, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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