websocketsrvclimsgpak

package
v0.0.0-...-642df0c Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2024 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Overview

Req: go 1.16 or later (embed.FS is N/A on Go 1.15 or lower)

Req: go 1.16 or later (embed.FS is N/A on Go 1.15 or lower)

Req: go 1.16 or later (embed.FS is N/A on Go 1.15 or lower)

Index

Constants

View Source
const (
	WAIT_CLOSE_LIMIT_SECONDS  uint32 = 2  // default is 2
	HANDSHAKE_TIMEOUT_SECONDS uint32 = 45 // default is 45

	MAX_NUM_ERR_MSG_RECV uint8 = 8 // default is 8 ; after this number of reecive errors, reset connection and force re-connect ; Implemented just for Client ; TODO: implement also for Server
)
View Source
const (
	VERSION string = "r.20240114.2007"

	CERTIFICATES_DEFAULT_PATH string = "./ssl"
	CERTIFICATE_PEM_CRT       string = "cert.crt"
	CERTIFICATE_PEM_KEY       string = "cert.key"

	MAX_META_MSG_SIZE  uint32 = 1 * 1000 * 1000  //  1 MB
	MAX_MSG_SIZE       uint32 = 16 * 1000 * 1000 // 16 MB
	MAX_QUEUE_MESSAGES uint8  = 100              // must be between: 1..255

	LIMIT_INTERVAL_SECONDS_MIN uint32 = 10   // {{{SYNC-MSGPAK-INTERVAL-LIMITS}}}
	LIMIT_INTERVAL_SECONDS_MAX uint32 = 3600 // {{{SYNC-MSGPAK-INTERVAL-LIMITS}}}

	DEBUG bool = false
)
View Source
const (
	HTTP_AUTH_REALM         string = "Smart.MsgPak Server"
	HTTP_GO_LANG_USER_AGENT string = "Go-http-client/1.1"

	WAIT_DHKX_LIMIT_SECONDS uint32 = 60 // default is 60

	DEBUG_CACHE bool = false
)

Variables

This section is empty.

Functions

func MsgPakClientRun

func MsgPakClientRun(clientID string, serverPool []string, tlsMode string, certifPath string, authUsername string, authPassword string, sharedEncPrivKey string, intervalMsgSeconds uint32, handleMessagesFunc HandleMessagesFunc) int16

func MsgPakGenerateUUID

func MsgPakGenerateUUID() string

func MsgPakServerRun

func MsgPakServerRun(serverID string, useTLS bool, certifPath string, httpAddr string, httpPort uint16, allowedIPs string, authUsername string, authPassword string, sharedEncPrivKey string, intervalMsgSeconds uint32, handleMessagesFunc HandleMessagesFunc, allowedHttpCustomCmds map[string]bool, cronMsgTasks []CronMsgTask) int16

func MsgPakSetClientTaskCmd

func MsgPakSetClientTaskCmd(cmd string, data string) string

func MsgPakSetServerTaskCmd

func MsgPakSetServerTaskCmd(cmd string, data string, timeoutSec uint32, tlsMode string, certifPath string, httpAddr string, httpPort uint16, authUsername string, authPassword string) string

Types

type CronMsgTask

type CronMsgTask struct {
	Timing string
	Cmd    string
	Data   string
}

type HandleMessagesFunc

type HandleMessagesFunc func(bool, string, string, string, string, string, string) (string, string)

Jump to

Keyboard shortcuts

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