easyws

package
v0.0.19-pre1 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Name = "xEasyWS"
	Icon = `<i class="fa-solid fa-hexagon-nodes"></i>`

	OptionFields = []xcapability.CapabilityOptionField{
		{
			Name: "on_connect_action",
			Key:  "on_connect_action",
			Type: "boolean",
		},
		{
			Name: "on_disconnect_action",
			Key:  "on_disconnect_action",
			Type: "boolean",
		},
		{
			Name: "on_command_action",
			Key:  "on_command_action",
			Type: "boolean",
		},
	}
)
View Source
var ErrInvalidToken = errors.New("invalid token")
View Source
var Ok = struct {
	Success bool `json:"success"`
}{
	Success: true,
}

Functions

This section is empty.

Types

type CMDDisconnectMessage

type CMDDisconnectMessage struct {
	// contains filtered or unexported fields
}

type CMDMessage

type CMDMessage struct {
	// contains filtered or unexported fields
}

type CapabilityAccessHandle

type CapabilityAccessHandle interface {
	ParseToken(token string) (*signer.CapabilityClaim, error)
	EmitActionEvent(opts *xtypes.ActionEventOptions) error
}

type EasyWsBuilder

type EasyWsBuilder struct {
	// contains filtered or unexported fields
}

func (*EasyWsBuilder) Build

func (*EasyWsBuilder) GetDebugData

func (b *EasyWsBuilder) GetDebugData() map[string]any

func (*EasyWsBuilder) Name

func (b *EasyWsBuilder) Name() string

func (*EasyWsBuilder) Serve

func (b *EasyWsBuilder) Serve(ctx *gin.Context)

type EasyWsCapability

type EasyWsCapability struct {
	// contains filtered or unexported fields
}

func (*EasyWsCapability) Close

func (c *EasyWsCapability) Close() error

func (*EasyWsCapability) Execute

func (*EasyWsCapability) Handle

func (c *EasyWsCapability) Handle(ctx *gin.Context)

func (*EasyWsCapability) ListActions

func (c *EasyWsCapability) ListActions() ([]string, error)

func (*EasyWsCapability) Reload

type MessageParams

type MessageParams struct {
	ToConnId string          `json:"to_cid"`
	Topic    string          `json:"topic"`
	Message  json.RawMessage `json:"message"`
}

type SubscribeParams

type SubscribeParams struct {
	Topic  string `json:"topic"`
	ConnId string `json:"conn_id"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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