# Functions
AssignString returns the first non-empty string It is equivalent the following in Javascript var value = val0 || val1 || val2 || default.
BuildTopicFn builds topic fullname.
GetConfig returns a reference to the Configuration.
GetEnvInt gets OS environment in integer format with a default if inproper value retrieved.
Init initializes configuration.
IsBroker check if the mode is broker.
IsBrokerRequired check if the broker is required.
IsHTTPRouterRequired check whether to initialize http router.
IsValidMode checks if the mode is supported.
JoinString joins multiple strings.
ListenAndServeTLS listens HTTP with TLS option just like the default http.ListenAndServeTLS in addition it also watches certificate and key file changes and reloads them if necessary.
NewCache is a helper to create instance of the Cache struct.
NewUUID generates a random UUID according to RFC 4122.
QueryParamString get URL query parameter with a default value.
ReadConfigFile reads configuration file.
ReceiverHeader parses headers for Pulsar required configuration.
ReportError logs error.
ResponseErrorJSON builds a Http response.
StrContains check if a string is contained in an array of string.
StringToBool format various strings to boolean strconv.ParseBool only covers `true` and `false` cases.
# Constants
Broker acts Pulsar consumers to send message to webhook.
DefaultConfigFile - default config file it can be overwritten by env variable APP_CONFIG.
HTTPOnly exposes all http endpoints including receiver, token server, and rest api.
HTTPWithNoRest exposes all http endpoints except rest api.
Hybrid mode both broker and webserver.
ItemNotExpire avoids the item being expired by TTL.
Receiver exposes endpoint to send events as Pulsar producer.
Rest mode provides a Rest API for webhook management.
TokenServer mode serves as a token server only.
# Variables
AllowedPulsarURLs specifies a list of allowed pulsar URL/cluster.
Config - this server's configuration instance.
JWTAuth is the RSA key pair for sign and verify JWT.
L is the logger.
SuperRoles are admin level users for jwt authorization.
# Structs
Cache is a synchronized map of items that can auto-expire once stale.
CacheOption is the optional configuration for Cache.
Configuration has a set of parameters to configure the beam server.
ResponseErr - Error struct for Http response.