boost

package module
v0.0.0-...-94dab57 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2026 License: MIT Imports: 49 Imported by: 0

README

go-boost

Generated with TRAE AI

Overview

go-boost is a comprehensive Go toolkit designed to simplify common operations in Go development, built on top of Go's standard library.

Installation

To use go-boost in your project, run:

go get github.com/xiang-tai-duo/go-boost

License

MIT License

About

This project is fully generated and maintained with TRAE AI assistance, demonstrating the power of AI-driven software development in creating high-quality, maintainable Go libraries.

Documentation

Overview

Package boost File: boost.go Url: https://github.com/xiang-tai-duo/go-boost/blob/master/boost.go Author: Vibe Coding Created: 2025/12/20 12:31:58 Description: Global instance declarations for go-boost library --------------------------------------------------------------------------------

Package boost File: config.go Url: https://github.com/xiang-tai-duo/go-boost/blob/master/config.go Author: Vibe Coding Created: 2025/12/20 12:31:58 Description: Config provides functionality for saving and loading configuration --------------------------------------------------------------------------------

Package boost File: debugger.go Url: https://github.com/xiang-tai-duo/go-boost/blob/master/debugger.go Author: Vibe Coding Created: 2025/12/20 12:31:58 Description: DEBUGGER is a utility for detecting debuggers attached to the process --------------------------------------------------------------------------------

Package boost File: directory.go Url: https://github.com/xiang-tai-duo/go-boost/blob/master/directory.go Author: Vibe Coding Created: 12/30/2025 11:03:46 Description: Directory handles operations related to the current directory, --------------------------------------------------------------------------------

Package boost File: file.go Url: https://github.com/xiang-tai-duo/go-boost/blob/master/file.go Author: Vibe Coding Created: 12/30/2025 11:03:46 Description: File provides utility methods for file operations --------------------------------------------------------------------------------

Package boost File: filepath.go Url: https://github.com/xiang-tai-duo/go-boost/blob/master/filepath.go Author: Vibe Coding Created: 12/20/2025 12:31:58 Description: FilePath provides utility methods for file path operations, --------------------------------------------------------------------------------

Package boost File: http.go Url: https://github.com/xiang-tai-duo/go-boost/blob/master/http.go Author: Vibe Coding Created: 12/30/2025 11:03:46 Description: HTTP provides utility methods for HTTP/HTTPS/WS/WSS operations,

including support for self-signed certificates.

--------------------------------------------------------------------------------

Package boost File: json.go Url: https://github.com/xiang-tai-duo/go-boost/blob/master/json.go Author: Vibe Coding Created: 12/30/2025 11:03:46 Description: JSON provides utility methods for JSON operations, including

marshal, unmarshal, validation, formatting, minification, and file operations.

--------------------------------------------------------------------------------

Package boost File: logger.go Url: https://github.com/xiang-tai-duo/go-boost/blob/master/logger.go Author: Vibe Coding Created: 12/30/2025 11:03:46 Description: Logger is a utility for recording and managing application performance metrics and logs. --------------------------------------------------------------------------------

Package boost File: mqtt.go Url: https://github.com/xiang-tai-duo/go-boost/blob/master/mqtt.go Author: Vibe Coding Created: 12/30/2025 11:03:46 Description: MQTT client implementation --------------------------------------------------------------------------------

Package boost File: network.go Url: https://github.com/xiang-tai-duo/go-boost/blob/master/network.go Author: Vibe Coding Created: 01/07/2026 11:03:46 Description: NETWORK provides functions to get network IP addresses with the smallest metric. --------------------------------------------------------------------------------

Package boost File: os.go Url: https://github.com/xiang-tai-duo/go-boost/blob/master/os.go Author: Vibe Coding Created: 12/20/2025 12:31:58 Description: OS provides utility methods for operating system operations, --------------------------------------------------------------------------------

Package boost File: process.go Url: https://github.com/xiang-tai-duo/go-boost/blob/master/process.go Author: Vibe Coding Created: 12/30/2025 11:03:46 Description: Process handles operations related to the current process --------------------------------------------------------------------------------

Package boost File: serve.go Url: https://github.com/xiang-tai-duo/go-boost/blob/master/serve.go Author: TRAE AI Created: 12/30/2025 11:03:46 Description: SERVE provides HTTP and WebSocket server functionality with automatic TLS support --------------------------------------------------------------------------------

Package boost File: soap.go Url: https://github.com/xiang-tai-duo/go-boost/blob/master/soap.go Author: Vibe Coding Created: 12/30/2025 11:03:46 Description: SOAP provides functionality for SOAP web service calls with support for attachments and headers --------------------------------------------------------------------------------

Package boost File: sqlite.go Url: `https://github.com/xiang-tai-duo/go-boost/blob/master/sqlite.go` Author: Vibe Coding Created: 12/30/2025 11:03:46 Description: SQLite is a wrapper for SQLite instance operations, providing a set of methods for instance management and query execution. --------------------------------------------------------------------------------

Package boost File: string.go Url: https://github.com/xiang-tai-duo/go-boost/blob/master/string.go Author: Vibe Coding Created: 12/30/2025 11:03:46 Description: STRING is a wrapper for string operations, providing a set of methods for string manipulation. --------------------------------------------------------------------------------

Package boost File: websocket.go Url: https://github.com/xiang-tai-duo/go-boost/blob/master/websocket.go Author: Vibe Coding Created: 12/30/2025 11:03:46 Description: WebSocket client functionality for Go applications --------------------------------------------------------------------------------

Package boost File: xml.go Url: https://github.com/xiang-tai-duo/go-boost/blob/master/xml.go Author: Vibe Coding Created: 12/30/2025 11:03:46 Description: XML provides utility methods for XML operations, including marshal, unmarshal, validation, formatting, minification, and file operations. --------------------------------------------------------------------------------

Index

Constants

View Source
const (
	DEBUGGER_NONE     = 0
	DEBUGGER_ATTACHED = 1
	DEBUGGER_DETACHED = 2
)
View Source
const (
	SECRET_KEY       = "X7K!2p9@A4z8#F1m5$C3b7%N6D2^q8&W0e9*R4t7(Y2u5)I8o1P3"
	LOG_LEVEL_DEBUG  = 0
	LOG_LEVEL_INFO   = 1
	LOG_LEVEL_WARN   = 2
	LOG_LEVEL_ERROR  = 3
	LOG_LEVEL_SECRET = 4
)
View Source
const (
	OUTPUT_MODE_CONSOLE_ONLY = 0
	OUTPUT_MODE_FILE_ONLY    = 1
	OUTPUT_MODE_BOTH         = 2
)
View Source
const (
	DEFAULT_MQTT_BROKER             = "tcp://localhost:1883"
	DEFAULT_MQTT_QOS                = 0
	DEFAULT_MQTT_KEEP_ALIVE         = 60 * time.Second
	DEFAULT_MQTT_CONNECTION_TIMEOUT = 30 * time.Second
)
View Source
const (
	HEADER_UPGRADE           = "Upgrade"
	WEBSOCKET_UPGRADE        = "websocket"
	DEFAULT_PORT             = 80
	DEFAULT_TLS_PORT         = 443
	DEFAULT_MQTT_SERVER_PORT = 1883
	DEFAULT_MQTT_SERVER_HOST = "0.0.0.0"
	DEFAULT_TOKEN_SECRET_KEY = "XyZ098+7654321qwertyuiopASDFGHJKLzxcvbnm"
	DEFAULT_TOKEN_EXPIRATION = 5 * time.Minute
)
View Source
const (
	DEFAULT_SOAP_CONTENT_TYPE   = "text/xml;charset=UTF-8"
	SOAP_MULTIPART_CONTENT_TYPE = "multipart/related"
	DEFAULT_BOUNDARY_PREFIX     = "----=_Part_"
)
View Source
const (
	DEFAULT_HTTP_TIMEOUT = 30 * time.Second
)

Variables

View Source
var (
	AllowSelfSignedCertificates = false
)
View Source
var (
	Debugger = NewDebugger()
)
View Source
var (
	Logger = &LOGGER{}
)
View Source
var (
	//go:embed soap/*.xml
	SOAP_TEMPLATES embed.FS
)

Functions

func SetAllowSelfSignedCertificates

func SetAllowSelfSignedCertificates(allow bool)

Types

type ACL_CHECK_CALLBACK

type ACL_CHECK_CALLBACK func(client *server.Client, topic string, write bool) bool

type AUTH_CALLBACK

type AUTH_CALLBACK func(client *server.Client, packet packets.Packet) bool

type BEFORE_SERVE_STATIC_CALLBACK_HANDLER

type BEFORE_SERVE_STATIC_CALLBACK_HANDLER func(request *http.Request, response http.ResponseWriter, uri string, filePath string) bool

type BOOST

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

func M

func M(value interface{}) BOOST

func (BOOST) AsDirectory

func (b BOOST) AsDirectory() *DIRECTORY

func (BOOST) AsFile

func (b BOOST) AsFile() *FILE

func (BOOST) AsFilePath

func (b BOOST) AsFilePath() *FILEPATH

func (BOOST) AsJson

func (b BOOST) AsJson() *JSON

func (BOOST) AsProcess

func (b BOOST) AsProcess() *PROCESS

func (BOOST) AsString

func (b BOOST) AsString() *STRING

type CONFIG

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

func NewConfig

func NewConfig() *CONFIG

func (*CONFIG) Clear

func (c *CONFIG) Clear() error

func (*CONFIG) Delete

func (c *CONFIG) Delete(key string) error

func (*CONFIG) Exists

func (c *CONFIG) Exists(key string) (bool, error)

func (*CONFIG) Get

func (c *CONFIG) Get(key string) (interface{}, bool, error)

func (*CONFIG) GetBoolean

func (c *CONFIG) GetBoolean(key string) (bool, error)

func (*CONFIG) GetFloat

func (c *CONFIG) GetFloat(key string) (float64, error)

func (*CONFIG) GetInteger

func (c *CONFIG) GetInteger(key string) (int, error)

func (*CONFIG) GetString

func (c *CONFIG) GetString(key string) (string, error)

func (*CONFIG) GetStringSlice

func (c *CONFIG) GetStringSlice(key string) ([]string, error)

func (*CONFIG) Load

func (c *CONFIG) Load(filePath ...string) error

func (*CONFIG) Save

func (c *CONFIG) Save(filePath ...string) error

func (*CONFIG) Set

func (c *CONFIG) Set(key string, value interface{}) error

func (*CONFIG) SetBoolean

func (c *CONFIG) SetBoolean(key string, value bool) error

func (*CONFIG) SetFloat

func (c *CONFIG) SetFloat(key string, value float64) error

func (*CONFIG) SetInteger

func (c *CONFIG) SetInteger(key string, value int) error

func (*CONFIG) SetString

func (c *CONFIG) SetString(key string, value string) error

func (*CONFIG) SetStrings

func (c *CONFIG) SetStrings(key string, value []string) error

type CONNECT_CALLBACK

type CONNECT_CALLBACK func(client *server.Client, packet packets.Packet)

type DEBUGGER

type DEBUGGER struct{}

func NewDebugger

func NewDebugger() DEBUGGER

func (DEBUGGER) Check

func (debugger DEBUGGER) Check() bool

func (DEBUGGER) IsPresent

func (debugger DEBUGGER) IsPresent() bool

type DIRECTORY

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

func NewDirectory

func NewDirectory(path ...string) *DIRECTORY

func (*DIRECTORY) Base

func (d *DIRECTORY) Base() string

func (*DIRECTORY) Clean

func (d *DIRECTORY) Clean() *DIRECTORY

func (*DIRECTORY) Create

func (d *DIRECTORY) Create() error

func (*DIRECTORY) Delete

func (d *DIRECTORY) Delete() error

func (*DIRECTORY) DeleteAll

func (d *DIRECTORY) DeleteAll() error

func (*DIRECTORY) FromPath

func (d *DIRECTORY) FromPath(path string) *DIRECTORY

func (*DIRECTORY) FromSlash

func (d *DIRECTORY) FromSlash() *DIRECTORY

func (*DIRECTORY) GetAll

func (d *DIRECTORY) GetAll() ([]string, error)

func (*DIRECTORY) GetDirectories

func (d *DIRECTORY) GetDirectories() ([]string, error)

func (*DIRECTORY) GetFiles

func (d *DIRECTORY) GetFiles() ([]string, error)

func (*DIRECTORY) GetWorkingDirectory

func (d *DIRECTORY) GetWorkingDirectory() (*DIRECTORY, error)

func (*DIRECTORY) IsAbs

func (d *DIRECTORY) IsAbs() bool

func (*DIRECTORY) IsExists

func (d *DIRECTORY) IsExists() bool

func (*DIRECTORY) Join

func (d *DIRECTORY) Join(elem ...string) *DIRECTORY

func (*DIRECTORY) MakeAll

func (d *DIRECTORY) MakeAll() error

func (*DIRECTORY) Path

func (d *DIRECTORY) Path() string

func (*DIRECTORY) SetWorkingDirectory

func (d *DIRECTORY) SetWorkingDirectory() error

func (*DIRECTORY) ToSlash

func (d *DIRECTORY) ToSlash() *DIRECTORY

type DISCONNECT_CALLBACK

type DISCONNECT_CALLBACK func(client *server.Client, err error)

type FILE

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

func NewFile

func NewFile(path ...string) *FILE

func (FILE) Abs

func (f FILE) Abs() (FILE, error)

func (FILE) Append

func (f FILE) Append(data []byte) error

func (FILE) AppendString

func (f FILE) AppendString(content string) error

func (FILE) Base

func (f FILE) Base() string

func (FILE) Chmod

func (f FILE) Chmod(mode os.FileMode) error

func (FILE) Chown

func (f FILE) Chown(uid int, gid int) error

func (FILE) Chtimes

func (f FILE) Chtimes(atime time.Time, mtime time.Time) error

func (FILE) Clean

func (f FILE) Clean() FILE

func (FILE) Copy

func (f FILE) Copy(dest FILE) error

func (FILE) Delete

func (f FILE) Delete() error

func (FILE) Dir

func (f FILE) Dir() DIRECTORY

func (FILE) Ext

func (f FILE) Ext() string

func (FILE) FromPath

func (f FILE) FromPath(path string) FILE

func (FILE) FromSlash

func (f FILE) FromSlash() FILE

func (FILE) IsAbs

func (f FILE) IsAbs() bool

func (FILE) IsDir

func (f FILE) IsDir() bool

func (FILE) IsExists

func (f FILE) IsExists() bool

func (FILE) IsRegular

func (f FILE) IsRegular() bool
func (f FILE) IsSymlink() bool

func (FILE) ModTime

func (f FILE) ModTime() time.Time

func (FILE) Mode

func (f FILE) Mode() os.FileMode

func (FILE) Name

func (f FILE) Name() string

func (FILE) Path

func (f FILE) Path() string

func (FILE) ReadAll

func (f FILE) ReadAll() ([]byte, error)

func (FILE) ReadString

func (f FILE) ReadString() (string, error)

func (FILE) Rel

func (f FILE) Rel(basepath string) (string, error)

func (FILE) Rename

func (f FILE) Rename(newPath FILE) error

func (FILE) Size

func (f FILE) Size() int64

func (FILE) ToSlash

func (f FILE) ToSlash() FILE

func (FILE) Write

func (f FILE) Write(data []byte) error

func (FILE) WriteString

func (f FILE) WriteString(content string) error

type FILEPATH

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

func NewFilePath

func NewFilePath(filePath string) *FILEPATH

func (FILEPATH) Abs

func (f FILEPATH) Abs() (FILEPATH, error)

func (FILEPATH) Base

func (f FILEPATH) Base() string

func (FILEPATH) Clean

func (f FILEPATH) Clean() FILEPATH

func (FILEPATH) Dir

func (f FILEPATH) Dir() string
func (f FILEPATH) EvalSymlinks() (FILEPATH, error)

func (FILEPATH) Ext

func (f FILEPATH) Ext() string

func (FILEPATH) FromSlash

func (f FILEPATH) FromSlash() FILEPATH

func (FILEPATH) GetFileExtension

func (f FILEPATH) GetFileExtension() string

func (FILEPATH) GetFileName

func (f FILEPATH) GetFileName() string

func (FILEPATH) GetFileNameWithoutExtension

func (f FILEPATH) GetFileNameWithoutExtension() string

func (FILEPATH) GetParentDirectory

func (f FILEPATH) GetParentDirectory() string

func (FILEPATH) Glob

func (f FILEPATH) Glob() ([]string, error)

func (FILEPATH) HasPrefix

func (f FILEPATH) HasPrefix(prefix string) bool

func (FILEPATH) IsAbs

func (f FILEPATH) IsAbs() bool

func (FILEPATH) IsLocal

func (f FILEPATH) IsLocal() bool

func (FILEPATH) Join

func (f FILEPATH) Join(elem ...string) FILEPATH

func (FILEPATH) Localize

func (f FILEPATH) Localize() (FILEPATH, error)

func (FILEPATH) Match

func (f FILEPATH) Match(pattern string) (bool, error)

func (*FILEPATH) Path

func (f *FILEPATH) Path(filePath ...string) string

func (FILEPATH) Rel

func (f FILEPATH) Rel(basepath string) (FILEPATH, error)

func (FILEPATH) Split

func (f FILEPATH) Split() (string, string)

func (FILEPATH) SplitList

func (f FILEPATH) SplitList() []string

func (FILEPATH) ToSlash

func (f FILEPATH) ToSlash() FILEPATH

func (FILEPATH) VolumeName

func (f FILEPATH) VolumeName() string

func (FILEPATH) Walk

func (f FILEPATH) Walk(fn filepath.WalkFunc) error

func (FILEPATH) WalkDir

func (f FILEPATH) WalkDir(fn fs.WalkDirFunc) error

type HTTP

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

func NewHTTP

func NewHTTP() *HTTP

func (*HTTP) Delete

func (h *HTTP) Delete(requestURL string) (string, int, error)

func (*HTTP) Do

func (h *HTTP) Do(method string, requestURL string, contentType string, body string) (string, int, error)

func (*HTTP) Get

func (h *HTTP) Get(requestURL string) (string, int, error)

func (*HTTP) GetTimeout

func (h *HTTP) GetTimeout() time.Duration

func (*HTTP) Post

func (h *HTTP) Post(requestURL string, contentType string, body string) (string, int, error)

func (*HTTP) Put

func (h *HTTP) Put(requestURL string, contentType string, body string) (string, int, error)

func (*HTTP) SetTimeout

func (h *HTTP) SetTimeout(timeout time.Duration)

func (*HTTP) UpdateClientTransport

func (h *HTTP) UpdateClientTransport() error

type IP_ADDRESSES

type IP_ADDRESSES struct {
	IPv4 string
	IPv6 string
}

func GetNetworkIpAddresses

func GetNetworkIpAddresses() (IP_ADDRESSES, error)

type JSON

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

func NewJSON

func NewJSON(initialValue ...interface{}) *JSON

func (*JSON) Format

func (j *JSON) Format(indent string) (string, error)

func (*JSON) GetInteger

func (j *JSON) GetInteger(path string) (int, error)

func (*JSON) GetMap

func (j *JSON) GetMap(path string) (map[string]interface{}, error)

func (*JSON) GetString

func (j *JSON) GetString(path string) (string, error)

func (*JSON) GetValue

func (j *JSON) GetValue(path string) (interface{}, error)

func (*JSON) Marshal

func (j *JSON) Marshal() (string, error)

func (*JSON) Minify

func (j *JSON) Minify() (string, error)

func (*JSON) SetInteger

func (j *JSON) SetInteger(path string, value int) (*JSON, error)

func (*JSON) SetString

func (j *JSON) SetString(path string, value string) (*JSON, error)

func (*JSON) SetValue

func (j *JSON) SetValue(path string, value interface{}) (*JSON, error)

func (*JSON) Unmarshal

func (j *JSON) Unmarshal(target interface{}) error

func (*JSON) Validate

func (j *JSON) Validate() (bool, error)

func (*JSON) WriteFile

func (j *JSON) WriteFile(filePath string, indent ...string) error

type LOGGER

type LOGGER struct {
	FolderName        string
	ColorReset        string
	Red               string
	Green             string
	Yellow            string
	Blue              string
	Magenta           string
	Cyan              string
	White             string
	Gray              string
	RedBackground     string
	GreenBackground   string
	YellowBackground  string
	BlueBackground    string
	MagentaBackground string
	CyanBackground    string
	WhiteBackground   string
	CurrentLevel      int
	OutputMode        int
	// contains filtered or unexported fields
}

func (*LOGGER) Debug

func (logger *LOGGER) Debug(message string)

func (*LOGGER) DecryptSecretLogs

func (logger *LOGGER) DecryptSecretLogs(logFilePath string) ([]string, error)

func (*LOGGER) Error

func (logger *LOGGER) Error(message interface{}, skipStackFrames ...int)

func (*LOGGER) GetGoroutineID

func (logger *LOGGER) GetGoroutineID() int

func (*LOGGER) Info

func (logger *LOGGER) Info(message string)

func (*LOGGER) Secret

func (logger *LOGGER) Secret(message string)

func (*LOGGER) Warning

func (logger *LOGGER) Warning(message string)

type MQTT

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

func NewMQTT

func NewMQTT(brokerAddress string, params ...string) *MQTT

func (*MQTT) Connect

func (m *MQTT) Connect() error

func (*MQTT) Disconnect

func (m *MQTT) Disconnect(timeoutDuration time.Duration) error

func (*MQTT) GetBroker

func (m *MQTT) GetBroker() string

func (*MQTT) GetClientID

func (m *MQTT) GetClientID() string

func (*MQTT) GetConnectionTimeout

func (m *MQTT) GetConnectionTimeout() time.Duration

func (*MQTT) GetKeepAlive

func (m *MQTT) GetKeepAlive() time.Duration

func (*MQTT) GetPassword

func (m *MQTT) GetPassword() string

func (*MQTT) GetQoS

func (m *MQTT) GetQoS() int

func (*MQTT) GetSubscriptions

func (m *MQTT) GetSubscriptions() map[string]int

func (*MQTT) GetUsername

func (m *MQTT) GetUsername() string

func (*MQTT) IsConnected

func (m *MQTT) IsConnected() bool

func (*MQTT) Publish

func (m *MQTT) Publish(topic string, payload string, params ...interface{}) error

func (*MQTT) SetBroker

func (m *MQTT) SetBroker(brokerAddress string) error

func (*MQTT) SetClientID

func (m *MQTT) SetClientID(clientIdentifier string) error

func (*MQTT) SetConnectHandler

func (m *MQTT) SetConnectHandler(handler func()) error

func (*MQTT) SetConnectionTimeout

func (m *MQTT) SetConnectionTimeout(timeoutDuration time.Duration) error

func (*MQTT) SetDisconnectHandler

func (m *MQTT) SetDisconnectHandler(handler func()) error

func (*MQTT) SetKeepAlive

func (m *MQTT) SetKeepAlive(keepAliveDuration time.Duration) error

func (*MQTT) SetMessageHandler

func (m *MQTT) SetMessageHandler(handler func(*MQTT_MESSAGE)) error

func (*MQTT) SetPassword

func (m *MQTT) SetPassword(passwordValue string) error

func (*MQTT) SetQoS

func (m *MQTT) SetQoS(qosLevel int) error

func (*MQTT) SetUsername

func (m *MQTT) SetUsername(usernameValue string) error

func (*MQTT) Subscribe

func (m *MQTT) Subscribe(topic string, qos int) error

func (*MQTT) Unsubscribe

func (m *MQTT) Unsubscribe(topic string) error

type MQTT_MESSAGE

type MQTT_MESSAGE struct {
	Topic     string    `json:"topic"`
	Payload   string    `json:"payload"`
	Timestamp time.Time `json:"timestamp"`
	QoS       int       `json:"qos"`
	Retained  bool      `json:"retained"`
	Duplicate bool      `json:"duplicate"`
}

type MQTT_SERVER

type MQTT_SERVER struct {
	Server    *server.Server
	Host      string
	Port      int
	CertFile  string
	KeyFile   string
	TLSConfig *tls.Config
	// contains filtered or unexported fields
}

func NewMQTTServer

func NewMQTTServer(params ...interface{}) *MQTT_SERVER

func NewMQTTServerTLS

func NewMQTTServerTLS(host string, port int) *MQTT_SERVER

func (*MQTT_SERVER) FormatError

func (ms *MQTT_SERVER) FormatError(err error) string

func (*MQTT_SERVER) GenerateSelfSignedCertificate

func (ms *MQTT_SERVER) GenerateSelfSignedCertificate() (*tls.Certificate, error)

func (*MQTT_SERVER) GetClientID

func (ms *MQTT_SERVER) GetClientID(client *server.Client) string

func (*MQTT_SERVER) GetClientIP

func (ms *MQTT_SERVER) GetClientIP(client *server.Client) (string, int)

func (*MQTT_SERVER) GetClientPort

func (ms *MQTT_SERVER) GetClientPort(client *server.Client) int

func (*MQTT_SERVER) GetConnectPassword

func (ms *MQTT_SERVER) GetConnectPassword(packet packets.Packet) string

func (*MQTT_SERVER) GetConnectUsername

func (ms *MQTT_SERVER) GetConnectUsername(packet packets.Packet) string

func (*MQTT_SERVER) GetHost

func (ms *MQTT_SERVER) GetHost() string

func (*MQTT_SERVER) GetMQTTMessage

func (ms *MQTT_SERVER) GetMQTTMessage(packet packets.Packet) *MQTT_MESSAGE

func (*MQTT_SERVER) GetOperationType

func (ms *MQTT_SERVER) GetOperationType(write bool) string

func (*MQTT_SERVER) GetPort

func (ms *MQTT_SERVER) GetPort() int

func (*MQTT_SERVER) GetPublishPayload

func (ms *MQTT_SERVER) GetPublishPayload(packet packets.Packet) string

func (*MQTT_SERVER) GetPublishTopic

func (ms *MQTT_SERVER) GetPublishTopic(packet packets.Packet) string

func (*MQTT_SERVER) GetSubscriptionFilters

func (ms *MQTT_SERVER) GetSubscriptionFilters(packet packets.Packet) []string

func (*MQTT_SERVER) GetSubscriptions

func (ms *MQTT_SERVER) GetSubscriptions(packet packets.Packet) map[string]int

func (*MQTT_SERVER) IsRunning

func (ms *MQTT_SERVER) IsRunning() bool

func (*MQTT_SERVER) Publish

func (ms *MQTT_SERVER) Publish(topic string, payload string, params ...interface{}) error

func (*MQTT_SERVER) SetACLCheckCallback

func (ms *MQTT_SERVER) SetACLCheckCallback(callback ACL_CHECK_CALLBACK) error

func (*MQTT_SERVER) SetAuthCallback

func (ms *MQTT_SERVER) SetAuthCallback(callback AUTH_CALLBACK) error

func (*MQTT_SERVER) SetCertFile

func (ms *MQTT_SERVER) SetCertFile(certFilePath string) error

func (*MQTT_SERVER) SetConnectCallback

func (ms *MQTT_SERVER) SetConnectCallback(callback CONNECT_CALLBACK) error

func (*MQTT_SERVER) SetDisconnectCallback

func (ms *MQTT_SERVER) SetDisconnectCallback(callback DISCONNECT_CALLBACK) error

func (*MQTT_SERVER) SetKeyFile

func (ms *MQTT_SERVER) SetKeyFile(keyFilePath string) error

func (*MQTT_SERVER) SetPublishCallback

func (ms *MQTT_SERVER) SetPublishCallback(callback PUBLISH_CALLBACK) error

func (*MQTT_SERVER) SetSubscribeCallback

func (ms *MQTT_SERVER) SetSubscribeCallback(callback SUBSCRIBE_CALLBACK) error

func (*MQTT_SERVER) SetSubscribedCallback

func (ms *MQTT_SERVER) SetSubscribedCallback(callback SUBSCRIBED_CALLBACK) error

func (*MQTT_SERVER) SetUnsubscribeCallback

func (ms *MQTT_SERVER) SetUnsubscribeCallback(callback UNSUBSCRIBE_CALLBACK) error

func (*MQTT_SERVER) SetUnsubscribedCallback

func (ms *MQTT_SERVER) SetUnsubscribedCallback(callback UNSUBSCRIBED_CALLBACK) error

func (*MQTT_SERVER) Start

func (ms *MQTT_SERVER) Start(params ...interface{}) error

func (*MQTT_SERVER) Stop

func (ms *MQTT_SERVER) Stop() error

type MQTT_SERVE_HOOK

type MQTT_SERVE_HOOK struct {
	server.HookBase
	// contains filtered or unexported fields
}

func (*MQTT_SERVE_HOOK) ID

func (h *MQTT_SERVE_HOOK) ID() string

func (*MQTT_SERVE_HOOK) OnACLCheck

func (h *MQTT_SERVE_HOOK) OnACLCheck(client *server.Client, topic string, write bool) bool

func (*MQTT_SERVE_HOOK) OnConnect

func (h *MQTT_SERVE_HOOK) OnConnect(client *server.Client, packet packets.Packet) error

func (*MQTT_SERVE_HOOK) OnConnectAuthenticate

func (h *MQTT_SERVE_HOOK) OnConnectAuthenticate(client *server.Client, packet packets.Packet) bool

func (*MQTT_SERVE_HOOK) OnDisconnect

func (h *MQTT_SERVE_HOOK) OnDisconnect(client *server.Client, err error, expire bool)

func (*MQTT_SERVE_HOOK) OnPublish

func (h *MQTT_SERVE_HOOK) OnPublish(client *server.Client, packet packets.Packet) (packets.Packet, error)

func (*MQTT_SERVE_HOOK) OnSubscribe

func (h *MQTT_SERVE_HOOK) OnSubscribe(client *server.Client, packet packets.Packet) packets.Packet

func (*MQTT_SERVE_HOOK) OnSubscribed

func (h *MQTT_SERVE_HOOK) OnSubscribed(client *server.Client, packet packets.Packet, reasonCodes []byte)

func (*MQTT_SERVE_HOOK) OnUnsubscribe

func (h *MQTT_SERVE_HOOK) OnUnsubscribe(client *server.Client, packet packets.Packet) packets.Packet

func (*MQTT_SERVE_HOOK) OnUnsubscribed

func (h *MQTT_SERVE_HOOK) OnUnsubscribed(client *server.Client, packet packets.Packet)

func (*MQTT_SERVE_HOOK) Provides

func (h *MQTT_SERVE_HOOK) Provides(b byte) bool

type OS

type OS struct{}

func (OS) Architecture

func (o OS) Architecture() string

func (OS) Environments

func (o OS) Environments() []string

func (OS) Executable

func (o OS) Executable() string

func (OS) ExpandEnvironment

func (o OS) ExpandEnvironment(s string) string

func (OS) GetEnvironment

func (o OS) GetEnvironment(key string) string

func (OS) HasEnvironment

func (o OS) HasEnvironment(key string) bool

func (OS) Hostname

func (o OS) Hostname() (string, error)

func (OS) IsLinux

func (o OS) IsLinux() bool

func (OS) IsMac

func (o OS) IsMac() bool

func (OS) IsUnix

func (o OS) IsUnix() bool

func (OS) IsWindows

func (o OS) IsWindows() bool

func (OS) LookPath

func (o OS) LookPath(file string) (string, error)

func (OS) Name

func (o OS) Name() string

func (OS) PathSeparator

func (o OS) PathSeparator() rune

func (OS) Separator

func (o OS) Separator() string

func (OS) SetEnvironment

func (o OS) SetEnvironment(key string, value string) error

func (OS) TemporaryDirectory

func (o OS) TemporaryDirectory() string

func (OS) UnsetEnvironment

func (o OS) UnsetEnvironment(key string) error

func (OS) UserHomeDirectory

func (o OS) UserHomeDirectory() string

func (OS) Version

func (o OS) Version() string

type PROCESS

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

func NewProcess

func NewProcess(pid ...int) *PROCESS

func (PROCESS) ArgumentCount

func (p PROCESS) ArgumentCount() int

func (PROCESS) Arguments

func (p PROCESS) Arguments() []string

func (PROCESS) CommandExists

func (p PROCESS) CommandExists(cmd string) bool

func (PROCESS) Environment

func (p PROCESS) Environment() []string

func (PROCESS) ExecuteCommand

func (p PROCESS) ExecuteCommand(name string, args ...string) (*exec.Cmd, error)

func (PROCESS) ExecuteCommandAndWait

func (p PROCESS) ExecuteCommandAndWait(name string, args ...string) error

func (PROCESS) ExecuteCommandWithOutput

func (p PROCESS) ExecuteCommandWithOutput(name string, args ...string) (string, error)

func (PROCESS) Exists

func (p PROCESS) Exists() bool

func (PROCESS) Exit

func (p PROCESS) Exit(code int)

func (PROCESS) GetArgument

func (p PROCESS) GetArgument(index int) string

func (PROCESS) GetArgumentValue

func (p PROCESS) GetArgumentValue(flag string) string

func (PROCESS) GetEnvironment

func (p PROCESS) GetEnvironment(key string) string

func (PROCESS) GetParentProcessID

func (p PROCESS) GetParentProcessID() int

func (PROCESS) GetProcessID

func (p PROCESS) GetProcessID() int

func (PROCESS) HasArgument

func (p PROCESS) HasArgument(arg string) bool

func (PROCESS) IsCurrent

func (p PROCESS) IsCurrent() bool

func (PROCESS) Kill

func (p PROCESS) Kill() error

func (PROCESS) Name

func (p PROCESS) Name() string

func (PROCESS) Parent

func (p PROCESS) Parent() *PROCESS

func (PROCESS) ParentProcessID

func (p PROCESS) ParentProcessID() int

func (PROCESS) Path

func (p PROCESS) Path() string

func (PROCESS) Process

func (p PROCESS) Process() (*os.Process, error)

func (PROCESS) ProcessID

func (p PROCESS) ProcessID() int

func (PROCESS) Signal

func (p PROCESS) Signal(sig os.Signal) error

func (PROCESS) Wait

func (p PROCESS) Wait() (*os.ProcessState, error)

func (PROCESS) WaitProcess

func (p PROCESS) WaitProcess() (*os.ProcessState, error)

func (PROCESS) WorkingDirectory

func (p PROCESS) WorkingDirectory() string

type PUBLISH_CALLBACK

type PUBLISH_CALLBACK func(client *server.Client, packet packets.Packet)

type REQUEST_HANDLER

type REQUEST_HANDLER func(request *http.Request, response http.ResponseWriter) error

type ROUTE

type ROUTE struct {
	Method  string
	Pattern string
	Handler REQUEST_HANDLER
}

type SEEDED_READER

type SEEDED_READER struct {
	SecretKey []byte
	Counter   uint64
}

SEEDED_READER implements io.Reader using a secretKey as seed This allows generating deterministic random numbers based on the secretKey Same secretKey will produce same random sequence

func (*SEEDED_READER) Read

func (sr *SEEDED_READER) Read(p []byte) (n int, err error)

type SERVE

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

func NewServe

func NewServe() *SERVE

func (*SERVE) AddStaticDirectory

func (s *SERVE) AddStaticDirectory(urlPath string, directoryPath string) *SERVE

func (*SERVE) CheckPortAvailable

func (s *SERVE) CheckPortAvailable(port int) bool

func (*SERVE) EnableRedirectToTLS

func (s *SERVE) EnableRedirectToTLS() error

func (*SERVE) GenerateSelfSignedCertificate

func (s *SERVE) GenerateSelfSignedCertificate() (*tls.Certificate, error)

func (*SERVE) GenerateSelfSignedCertificatePFX

func (s *SERVE) GenerateSelfSignedCertificatePFX(password string) ([]byte, error)

func (*SERVE) GetAvailablePort

func (s *SERVE) GetAvailablePort() (int, error)

func (*SERVE) GetStaticDirectory

func (s *SERVE) GetStaticDirectory(urlPath string) string

func (*SERVE) IsRunning

func (s *SERVE) IsRunning() bool

func (*SERVE) Listen

func (s *SERVE) Listen(address string) error

func (*SERVE) ListenTLS

func (s *SERVE) ListenTLS(address string, params ...interface{}) error

func (*SERVE) On

func (s *SERVE) On(method string, pattern string, handler REQUEST_HANDLER) *SERVE

func (*SERVE) OnBeforeStaticServe

func (s *SERVE) OnBeforeStaticServe(callback BEFORE_SERVE_STATIC_CALLBACK_HANDLER) *SERVE

OnBeforeStaticServe sets the before static serve callback

func (*SERVE) OnError

func (s *SERVE) OnError(handler func(error)) *SERVE

func (*SERVE) OnStaticServe

func (s *SERVE) OnStaticServe(callback SERVE_STATIC_CALLBACK_HANDLER) *SERVE

OnStaticServe sets the static serve callback

func (*SERVE) OnWebSocket

func (s *SERVE) OnWebSocket(pattern string, dataHandler WEBSOCKET_DATA_HANDLER) *SERVE

func (*SERVE) OnWebSocketEx

func (s *SERVE) OnWebSocketEx(pattern string, filter interface{}, dataHandler WEBSOCKET_DATA_HANDLER, disconnectHandler WEBSOCKET_DISCONNECT_HANDLER) *SERVE

func (*SERVE) RemoveStaticDirectory

func (s *SERVE) RemoveStaticDirectory(urlPath string) *SERVE

func (*SERVE) SetContext

func (s *SERVE) SetContext(ctx context.Context)

func (*SERVE) Shutdown

func (s *SERVE) Shutdown() error

type SERVE_STATIC_CALLBACK_HANDLER

type SERVE_STATIC_CALLBACK_HANDLER func(request *http.Request, response http.ResponseWriter, served bool, uri string, filePath string)

type SOAP

type SOAP struct {
	*HTTP
}

func NewSOAP

func NewSOAP() *SOAP

func (*SOAP) Call

func (s *SOAP) Call(url string, action string, body string) (string, int, error)

func (*SOAP) CallWithAttachment

func (s *SOAP) CallWithAttachment(url string, action string, body string, attachment []byte, fileName string, mimeType string) (string, int, error)

func (*SOAP) CallWithHeader

func (s *SOAP) CallWithHeader(url string, action string, header string, body string) (string, int, error)

func (*SOAP) CreateEnvelope

func (s *SOAP) CreateEnvelope(body string) (string, error)

func (*SOAP) ExtractBody

func (s *SOAP) ExtractBody(soapResponse string) string

type SQLITE

type SQLITE struct {
	Trace     bool
	PragmaKey string
	// contains filtered or unexported fields
}

func NewSQLITE

func NewSQLITE() *SQLITE

func (*SQLITE) BeginTransaction

func (sqlite *SQLITE) BeginTransaction() error

func (*SQLITE) Close

func (sqlite *SQLITE) Close()

func (*SQLITE) Commit

func (sqlite *SQLITE) Commit() error

func (*SQLITE) Create

func (sqlite *SQLITE) Create(sqliteFilePath string) error

func (*SQLITE) CreateNew

func (sqlite *SQLITE) CreateNew(sqliteFilePath string) error

func (*SQLITE) DesensitizeColumn

func (sqlite *SQLITE) DesensitizeColumn(tableName string, columnName string) error

func (*SQLITE) ExecNonQueries

func (sqlite *SQLITE) ExecNonQueries(queries []string, callback SQLITE_EXEC_CALLBACK) error

func (*SQLITE) ExecNonQuery

func (sqlite *SQLITE) ExecNonQuery(query string) error

func (*SQLITE) ExecuteQuery

func (sqlite *SQLITE) ExecuteQuery(query string) ([]SQLITE_VALUE, error)

func (*SQLITE) MD5

func (sqlite *SQLITE) MD5(value string) string

func (*SQLITE) Open

func (sqlite *SQLITE) Open(sqliteFilePath string) error

func (*SQLITE) Parse

func (sqlite *SQLITE) Parse(data interface{}) SQLITE_VALUE

func (*SQLITE) Rollback

func (sqlite *SQLITE) Rollback() error

func (*SQLITE) TEXT

func (sqlite *SQLITE) TEXT(str string) string

type SQLITE_EXEC_CALLBACK

type SQLITE_EXEC_CALLBACK func(sql string, err error) bool

type SQLITE_VALUE

type SQLITE_VALUE struct {
	Name  string
	Value interface{}
}

func (SQLITE_VALUE) ToBool

func (value SQLITE_VALUE) ToBool() bool

func (SQLITE_VALUE) ToFloat

func (value SQLITE_VALUE) ToFloat() float64

func (SQLITE_VALUE) ToInt

func (value SQLITE_VALUE) ToInt() int

func (SQLITE_VALUE) ToString

func (value SQLITE_VALUE) ToString() string

func (SQLITE_VALUE) Type

func (value SQLITE_VALUE) Type() string

type STRING

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

func NewString

func NewString(value string) *STRING

func (*STRING) Compare

func (s *STRING) Compare(t string) int

func (*STRING) Contains

func (s *STRING) Contains(substr string) bool

func (*STRING) ContainsAny

func (s *STRING) ContainsAny(chars string) bool

func (*STRING) ContainsRune

func (s *STRING) ContainsRune(r rune) bool

func (*STRING) Count

func (s *STRING) Count(substr string) int

func (*STRING) Cut

func (s *STRING) Cut(sep string) (before STRING, after STRING, found bool)

func (*STRING) CutPrefix

func (s *STRING) CutPrefix(prefix string) (STRING, bool)

func (*STRING) CutSuffix

func (s *STRING) CutSuffix(suffix string) (STRING, bool)

func (*STRING) EqualFold

func (s *STRING) EqualFold(t string) bool

func (*STRING) Equals

func (s *STRING) Equals(t string) bool

func (*STRING) EqualsIgnoreCase

func (s *STRING) EqualsIgnoreCase(t string) bool

func (*STRING) Fields

func (s *STRING) Fields() []string

func (*STRING) FieldsFunc

func (s *STRING) FieldsFunc(f func(rune) bool) []string

func (*STRING) HasPrefix

func (s *STRING) HasPrefix(prefix string) bool

func (*STRING) HasSuffix

func (s *STRING) HasSuffix(suffix string) bool

func (*STRING) Index

func (s *STRING) Index(substr string) int

func (*STRING) IndexAny

func (s *STRING) IndexAny(chars string) int

func (*STRING) IndexByte

func (s *STRING) IndexByte(c byte) int

func (*STRING) IndexFunc

func (s *STRING) IndexFunc(f func(rune) bool) int

func (*STRING) IndexRune

func (s *STRING) IndexRune(r rune) int

func (*STRING) Join

func (s *STRING) Join(elems []string) STRING

func (*STRING) LastIndex

func (s *STRING) LastIndex(substr string) int

func (*STRING) LastIndexAny

func (s *STRING) LastIndexAny(chars string) int

func (*STRING) LastIndexByte

func (s *STRING) LastIndexByte(c byte) int

func (*STRING) LastIndexFunc

func (s *STRING) LastIndexFunc(f func(rune) bool) int

func (*STRING) Left

func (s *STRING) Left(length int) STRING

func (*STRING) Map

func (s *STRING) Map(mapping func(rune) rune) STRING

func (*STRING) Mid

func (s *STRING) Mid(start int, length int) STRING

func (*STRING) Repeat

func (s *STRING) Repeat(count int) STRING

func (*STRING) Replace

func (s *STRING) Replace(old string, newStr string, n int) STRING

func (*STRING) ReplaceAll

func (s *STRING) ReplaceAll(old string, newStr string) STRING

func (*STRING) Right

func (s *STRING) Right(length int) STRING

func (*STRING) Split

func (s *STRING) Split(sep string) []string

func (*STRING) SplitAfter

func (s *STRING) SplitAfter(sep string) []string

func (*STRING) SplitAfterN

func (s *STRING) SplitAfterN(sep string, n int) []string

func (*STRING) SplitN

func (s *STRING) SplitN(sep string, n int) []string

func (*STRING) String

func (s *STRING) String(value ...string) string

func (*STRING) SubStr

func (s *STRING) SubStr(start int) STRING

func (*STRING) Title

func (s *STRING) Title() STRING

func (*STRING) ToLower

func (s *STRING) ToLower() STRING

func (*STRING) ToLowerSpecial

func (s *STRING) ToLowerSpecial(c unicode.SpecialCase) STRING

func (*STRING) ToTitleSpecial

func (s *STRING) ToTitleSpecial(c unicode.SpecialCase) STRING

func (*STRING) ToUpper

func (s *STRING) ToUpper() STRING

func (*STRING) ToUpperSpecial

func (s *STRING) ToUpperSpecial(c unicode.SpecialCase) STRING

func (*STRING) Trim

func (s *STRING) Trim(cutset string) STRING

func (*STRING) TrimFunc

func (s *STRING) TrimFunc(f func(rune) bool) STRING

func (*STRING) TrimLeft

func (s *STRING) TrimLeft(cutset string) STRING

func (*STRING) TrimLeftFunc

func (s *STRING) TrimLeftFunc(f func(rune) bool) STRING

func (*STRING) TrimPrefix

func (s *STRING) TrimPrefix(prefix string) STRING

func (*STRING) TrimRight

func (s *STRING) TrimRight(cutset string) STRING

func (*STRING) TrimRightFunc

func (s *STRING) TrimRightFunc(f func(rune) bool) STRING

func (*STRING) TrimSpace

func (s *STRING) TrimSpace() STRING

func (*STRING) TrimSuffix

func (s *STRING) TrimSuffix(suffix string) STRING

type SUBSCRIBED_CALLBACK

type SUBSCRIBED_CALLBACK func(client *server.Client, packet packets.Packet)

type SUBSCRIBE_CALLBACK

type SUBSCRIBE_CALLBACK func(client *server.Client, packet packets.Packet)

type TOKEN

type TOKEN struct {
	Token     string    `json:"token"`
	ExpiresAt time.Time `json:"expires_at"`
}

TOKEN represents the data stored in an encrypted token

type TOKEN_MANAGER

type TOKEN_MANAGER struct {
	Tokens map[string]bool
	// contains filtered or unexported fields
}

TOKEN_MANAGER handles token operations with thread safety

func NewTokenManager

func NewTokenManager(server *SERVE, secretKey ...string) *TOKEN_MANAGER

func (*TOKEN_MANAGER) AddToken

func (m *TOKEN_MANAGER) AddToken(token string)

func (*TOKEN_MANAGER) DecryptToken

func (m *TOKEN_MANAGER) DecryptToken(encryptedToken string) (TOKEN, error)

func (*TOKEN_MANAGER) NewToken

func (m *TOKEN_MANAGER) NewToken() (string, time.Time, error)

func (*TOKEN_MANAGER) RefreshToken

func (m *TOKEN_MANAGER) RefreshToken(oldToken string) string

func (*TOKEN_MANAGER) RemoveToken

func (m *TOKEN_MANAGER) RemoveToken(token string) bool

func (*TOKEN_MANAGER) Shutdown

func (m *TOKEN_MANAGER) Shutdown()

func (*TOKEN_MANAGER) VerifyToken

func (m *TOKEN_MANAGER) VerifyToken(token string) bool

type UNSUBSCRIBED_CALLBACK

type UNSUBSCRIBED_CALLBACK func(client *server.Client, packet packets.Packet)

type UNSUBSCRIBE_CALLBACK

type UNSUBSCRIBE_CALLBACK func(client *server.Client, packet packets.Packet)

type WEBSOCKET_CLIENT

type WEBSOCKET_CLIENT struct {
	Config         WEBSOCKET_CLIENT_CONFIG
	Conn           *websocket.Conn
	MessageHandler WEBSOCKET_CLIENT_HANDLER
	ErrorHandler   WEBSOCKET_CLIENT_ERROR_HANDLER
	SendChan       chan []byte
	IsConnected    bool
	ReconnectCount int
	Mutex          sync.Mutex
}

type WEBSOCKET_CLIENT_CONFIG

type WEBSOCKET_CLIENT_CONFIG struct {
	Url                  string
	Origin               string
	Headers              http.Header
	Dialer               *websocket.Dialer
	HandshakeTimeout     time.Duration
	ReconnectInterval    time.Duration
	MaxReconnectAttempts int
	SendChannelSize      int
}

type WEBSOCKET_CLIENT_ERROR_HANDLER

type WEBSOCKET_CLIENT_ERROR_HANDLER func(err error)

type WEBSOCKET_CLIENT_HANDLER

type WEBSOCKET_CLIENT_HANDLER func(conn *websocket.Conn, messageType int, data []byte) error

type WEBSOCKET_CLIENT_MANAGER

type WEBSOCKET_CLIENT_MANAGER struct {
	Clients       map[string]*WEBSOCKET_CLIENT
	DefaultConfig WEBSOCKET_CLIENT_CONFIG
	Mutex         sync.Mutex
}

func NewWebSocket

func NewWebSocket() *WEBSOCKET_CLIENT_MANAGER

func (*WEBSOCKET_CLIENT_MANAGER) Connect

func (ws *WEBSOCKET_CLIENT_MANAGER) Connect(uri string, messageHandler WEBSOCKET_CLIENT_HANDLER) (string, error)

func (*WEBSOCKET_CLIENT_MANAGER) ConnectEx

func (ws *WEBSOCKET_CLIENT_MANAGER) ConnectEx(uri string, origin string, headers http.Header, dialer *websocket.Dialer, handshakeTimeout time.Duration, reconnectInterval time.Duration, maxReconnectAttempts int, sendChannelSize int, messageHandler WEBSOCKET_CLIENT_HANDLER) (string, error)

func (*WEBSOCKET_CLIENT_MANAGER) Send

func (ws *WEBSOCKET_CLIENT_MANAGER) Send(clientID string, message []byte) error

func (*WEBSOCKET_CLIENT_MANAGER) Shutdown

func (ws *WEBSOCKET_CLIENT_MANAGER) Shutdown(clientID string) error

type WEBSOCKET_DATA

type WEBSOCKET_DATA struct {
	Pattern           string
	Handler           WEBSOCKET_DATA_HANDLER
	DisconnectHandler WEBSOCKET_DISCONNECT_HANDLER
	Filter            WEBSOCKET_ORIGIN_FILTER
}

type WEBSOCKET_DATA_HANDLER

type WEBSOCKET_DATA_HANDLER func(websocket *websocket.Conn, messageType int, data []byte) error

type WEBSOCKET_DISCONNECT_HANDLER

type WEBSOCKET_DISCONNECT_HANDLER func(websocket *websocket.Conn) error

type WEBSOCKET_ORIGIN_ALLOW_ALL

type WEBSOCKET_ORIGIN_ALLOW_ALL struct{}

func (WEBSOCKET_ORIGIN_ALLOW_ALL) Allow

func (a WEBSOCKET_ORIGIN_ALLOW_ALL) Allow(origin string) bool

type WEBSOCKET_ORIGIN_FILTER

type WEBSOCKET_ORIGIN_FILTER interface {
	Allow(origin string) bool
}

type WEBSOCKET_ORIGIN_MAP

type WEBSOCKET_ORIGIN_MAP map[string]bool

func (WEBSOCKET_ORIGIN_MAP) Allow

func (m WEBSOCKET_ORIGIN_MAP) Allow(origin string) bool

type WEBSOCKET_ORIGIN_REGEX

type WEBSOCKET_ORIGIN_REGEX struct {
	Pattern string
	Regex   *regexp.Regexp
}

func (*WEBSOCKET_ORIGIN_REGEX) Allow

func (r *WEBSOCKET_ORIGIN_REGEX) Allow(origin string) bool

type XML

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

func NewXML

func NewXML(initialValue ...interface{}) *XML

func (*XML) Format

func (j *XML) Format(indent string) (string, error)

func (*XML) GetInteger

func (j *XML) GetInteger(path string) (int, error)

func (*XML) GetMap

func (j *XML) GetMap(path string) (map[string]interface{}, error)

func (*XML) GetString

func (j *XML) GetString(path string) (string, error)

func (*XML) GetValue

func (j *XML) GetValue(path string) (interface{}, error)

func (*XML) Marshal

func (j *XML) Marshal() (string, error)

func (*XML) Minify

func (j *XML) Minify() (string, error)

func (*XML) SetInteger

func (j *XML) SetInteger(path string, value int) (*XML, error)

func (*XML) SetString

func (j *XML) SetString(path string, value string) (*XML, error)

func (*XML) SetValue

func (j *XML) SetValue(path string, value interface{}) (*XML, error)

func (*XML) Unmarshal

func (j *XML) Unmarshal(target interface{}) error

func (*XML) Validate

func (j *XML) Validate() (bool, error)

func (*XML) WriteFile

func (j *XML) WriteFile(filePath string, indent ...string) error

Directories

Path Synopsis
Package main File: network.go Url: https://github.com/xiang-tai-duo/go-boost/blob/master/examples/network.go Author: Vibe Coding Created: 2025/12/20 12:31:58 Description: Example for network functionality --------------------------------------------------------------------------------
Package main File: network.go Url: https://github.com/xiang-tai-duo/go-boost/blob/master/examples/network.go Author: Vibe Coding Created: 2025/12/20 12:31:58 Description: Example for network functionality --------------------------------------------------------------------------------

Jump to

Keyboard shortcuts

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