util

package
v3.0.15 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComposeStringToSign added in v3.0.10

func ComposeStringToSign(method, uri string, headers, queries map[string]string) string

func GenQueryString

func GenQueryString(variables map[string]interface{}) string

func GetAuthorization added in v3.0.10

func GetAuthorization(accessKeyId, accessKeySecret, stringToSign string) string

func GetQueryString

func GetQueryString(queryMap map[string]string) string

func GetValueOrDefault

func GetValueOrDefault(value ...string) string

func IsArray added in v3.0.14

func IsArray(value interface{}) bool

func IsString added in v3.0.14

func IsString(value interface{}) bool

func RandStringImpr

func RandStringImpr(n int) string

func RandomString

func RandomString(length int) string

func StringContains

func StringContains(s []string, searchTerm string) bool

Types

type EventReceiver added in v3.0.10

type EventReceiver interface {
	OnSuccess(msg []byte)
	OnError(err error)
}

type EventReceives added in v3.0.10

type EventReceives struct {
	Successes []func(msg []byte)
	Errors    []func(err error)
}

func NewEventReceives added in v3.0.10

func NewEventReceives() *EventReceives

type WebSocketEventHub added in v3.0.10

type WebSocketEventHub struct {
	Connections map[string]*websocket.Conn
	// contains filtered or unexported fields
}

func NewWebSocketEvent added in v3.0.10

func NewWebSocketEvent() *WebSocketEventHub

NewWebSocketEvent

func (*WebSocketEventHub) AddReceiver added in v3.0.10

func (eventHub *WebSocketEventHub) AddReceiver(eventCode string, onSuccess func(msg []byte), onError func(err error))

func (*WebSocketEventHub) CreateAuthentication added in v3.0.10

func (eventHub *WebSocketEventHub) CreateAuthentication(eventCode string, websocketHost string, token string) bool

func (*WebSocketEventHub) CreateManagement added in v3.0.10

func (eventHub *WebSocketEventHub) CreateManagement(eventCode string, websocketHost string, token string) bool

func (*WebSocketEventHub) StartReceive added in v3.0.10

func (eventHub *WebSocketEventHub) StartReceive(eventCode string)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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