ws

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: MIT Imports: 13 Imported by: 0

README

xxx

介绍
  1. xxxx
  2. xxxx
  3. xxxx
安装教程

go get github.com/jageros/hawox

使用例子
package main

import (
	"fmt"
	"github.com/jageros/hawox/xxx"
)

func main() {
	/*
	xxxxx
	xxxxx
	xxxxx
	*/
}
使用说明
  1. xxxx
  2. xxxx
  3. xxxx

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Broadcast

func Broadcast(data []byte, filter *Filter) error

func BroadcastBinary

func BroadcastBinary(data []byte, filter *Filter) error

func Init

func Init(ctx contextx.Context, r *gin.RouterGroup, opfs ...func(opt Options))

func OnConnect

func OnConnect(fn func(*melody.Session))

func OnDisConnect

func OnDisConnect(fn func(*melody.Session))

func OnMessage

func OnMessage(fn func(session *melody.Session, bytes []byte))

func OnMessageBinary

func OnMessageBinary(fn func(session *melody.Session, bytes []byte))

Types

type Filter

type Filter struct {
	Keys map[string]map[interface{}]struct{}
	// contains filtered or unexported fields
}

func NewBlacklistFilter

func NewBlacklistFilter(key string, vals ...interface{}) *Filter

func NewWhitelistFilter

func NewWhitelistFilter(key string, vals ...interface{}) *Filter

func (*Filter) AddKeys

func (f *Filter) AddKeys(key string, vals ...interface{})

type Options

type Options interface {
	SetCallTimeout(t time.Duration)
	SetRelativePath(relativePath string)
	SetKeys(keys ...string)
	SetAuth(auth func(c *gin.Context))
}

Jump to

Keyboard shortcuts

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