func GoStrings(argc C.int, argv **C.char) []string
GoStrings - Convert C char** to Go string[]
func Restore(ptr unsafe.Pointer) (v interface{})
Restore to fetch the interface associated with a particular unsafe.Pointer
func Save(v interface{}) unsafe.Pointer
Save function to store interface{} for every unsafe.Pointer
func Unref(ptr unsafe.Pointer)
Unref to free the unsafe.Pointer & the associated interface{}
ClientCfg context
type ClientCfg struct {
// contains filtered or unexported fields
}
func (clientctx *ClientCfg) Destroy()
Destroy - To delete Client context
func (clientctx *ClientCfg) GetEndPoints() (string, error)
GetEndPoints for application to fetch Endpoint associated with message bus config
Returns: 1. string
Endpoints value in string
2. error
Error on failure, nil on success
func (clientctx *ClientCfg) GetInterfaceValue(key string) (*ConfigValue, error)
GetInterfaceValue fetch interface value for application to communicate over EII message bus
Parameters: 1. key: string
Key on which interface value is extracted
Returns: 1. Config value : ConfigValue object
Interface value
2. error
Error on failure, nil on success
func (clientctx *ClientCfg) GetMsgbusConfig() (map[string]interface{}, error)
GetMsgbusConfig to fetch client msgbus config for application to communicate over EII message bus
Returns: 1. map[string]interface{} 2. error
Error on failure, nil on success
ConfigMgr object
type ConfigMgr struct {
// contains filtered or unexported fields
}
func ConfigManager() (*ConfigMgr, error)
ConfigManager - Initialize a new config manager context.
Returns: 1. ConfigMgr : ConfigMgr object
ConfigManager instance
2. error
Error on failure, nil on success
func (ctx *ConfigMgr) Destroy()
func (ctx *ConfigMgr) GetAppConfig() (map[string]interface{}, error)
GetAppConfig - Gets value from respective application's config
Returns: 1. appConfig : map[string]interface{} 2. error
Error on failure, nil on success
func (ctx *ConfigMgr) GetAppName() (string, error)
"GetAppName - Get Applications name.
Returns: 1. App name : string
Applications name
2. error
Error on failure, nil on success
func (ctx *ConfigMgr) GetClientByIndex(index int) (*ClientCfg, error)
GetClientByIndex - Get the respective client based on the index
Returns: 1. ClientCfg : ClientCfg obj
ClientCfg instance
2. error
Error on failure, nil on success
func (ctx *ConfigMgr) GetClientByName(name string) (*ClientCfg, error)
GetClientByName - Get the respective client based on the name
Returns: 1. ClientCfg : ClientCfg obj
ClientCfg instance
2. error
Error on failure, nil on success
func (ctx *ConfigMgr) GetNumClients() (int, error)
GetNumClients - Get number of clients in Client array in interface
Returns: 1. num_of_client : int
Number of client
2. error
Error on failure, nil on success
func (ctx *ConfigMgr) GetNumPublishers() (int, error)
GetNumPublishers - Get number of publishers in Publisher array in interface
Returns: 1. num_of_publishers : int
Number of publishers
2. error
Error on failure, nil on success
func (ctx *ConfigMgr) GetNumServers() (int, error)
GetNumServers - Get number of servers in Server array in interface
Returns: 1. num_of_servers : int
Number of servers
2. error
Error on failure, nil on success
func (ctx *ConfigMgr) GetNumSubscribers() (int, error)
GetNumSubscribers - Get number of subscribers in Subscriber array in interface
Returns: 1. num_of_subscribers : int
Number of subscribers
2. error
Error on failure, nil on success
func (ctx *ConfigMgr) GetPublisherByIndex(index int) (*PublisherCfg, error)
GetPublisherByIndex - Get the respective publisher based on the index
Returns: 1. PublisherCfg : PublisherCfg obj
PublisherCfg instance
2. error
Error on failure, nil on success
func (ctx *ConfigMgr) GetPublisherByName(name string) (*PublisherCfg, error)
"GetPublisherByName - Get the respective publisher based on the name
Returns: 1. PublisherCfg : PublisherCfg obj
PublisherCfg instance
2. error
Error on failure, nil on success
func (ctx *ConfigMgr) GetServerByIndex(index int) (*ServerCfg, error)
GetServerByIndex - Get the respective server based on the index
Returns: 1. ServerCfg : ServerCfg obj
ServerCfg instance
2. error
Error on failure, nil on success
func (ctx *ConfigMgr) GetServerByName(name string) (*ServerCfg, error)
GetServerByName - Get the respective server based on the name
Returns: 1. ServerCfg : ServerCfg obj
ServerCfg instance
2. error
Error on failure, nil on success
func (ctx *ConfigMgr) GetSubscriberByIndex(index int) (*SubscriberCfg, error)
GetSubscriberByIndex - Get the respective subscriber based on the index
Returns: 1. SubscriberCfg : SubscriberCfg obj
SubscriberCfg instance
2. error
Error on failure, nil on success
func (ctx *ConfigMgr) GetSubscriberByName(name string) (*SubscriberCfg, error)
GetSubscriberByName - Get the respective subscriber based on the name
Returns: 1. SubscriberCfg : SubscriberCfg obj
SubscriberCfg instance
2. error
Error on failure, nil on success
func (configMgr *ConfigMgr) GetWatchObj() (*WatchObj, error)
func (ctx *ConfigMgr) IsDevMode() (bool, error)
IsDevMode - To check if application running in dev_mode or prod_mode
Returns: 1. bool value : bool
true is dev_mode, false if prod_mode
2. error
Error on failure, nil on success
ConfigValue - strcut to define config type and values
type ConfigValue struct { Type ValType Value Expr }
func (cfg ConfigValue) GetArray() (array, error)
GetArray gets array value from the value received from GetInterfaceValue
Returns: 1. array value : array
returns array value
2. error
Error on failure, nil on success
func (cfg ConfigValue) GetBool() (boolean, error)
GetBool gets boolean value from the value received from GetInterfaceValue
Returns: 1. bool value : bool
returns bool value
2. error
Error on failure, nil on success
func (cfg ConfigValue) GetFloat() (float, error)
GetFloat gets float value from the value received from GetInterfaceValue
Returns: 1. float value : float
returns float value
2. error
Error on failure, nil on success
func (cfg ConfigValue) GetInteger() (integer, error)
GetInteger gets integer value from the value received from GetInterfaceValue
Returns: 1. integer value : integer
returns integer value
2. error
Error on failure, nil on success
func (cfg ConfigValue) GetJSON() (object, error)
GetJSON gets json value from the value received from GetInterfaceValue
Returns: 1. json value : object
returns json value
2. error
Error on failure, nil on success
func (cfg ConfigValue) GetString() (string, error)
GetString gets string value from the value received from GetInterfaceValue
Returns: 1. string value : string
returns string value
2. error
Error on failure, nil on success
type Expr interface { IsExpr() }
PublisherCfg context
type PublisherCfg struct {
// contains filtered or unexported fields
}
func (pubctx *PublisherCfg) Destroy()
Destroy - To delete Publisher context
func (pubctx *PublisherCfg) GetAllowedClients() ([]string, error)
GetAllowedClients gets the names of the clients allowed to get publishers data
Returns: 1. allowed_clients : string array
array of allowed clients
2. error
Error on failure, nil on success
func (pubctx *PublisherCfg) GetEndPoints() (string, error)
GetEndPoints for application to fetch Endpoint associated with message bus config
Returns: 1. string
Endpoints value in string
2. error
Error on failure, nil on success
func (pubctx *PublisherCfg) GetInterfaceValue(key string) (*ConfigValue, error)
GetInterfaceValue fetch interface value for application to communicate over EII message bus
Parameters: 1. key: string
Key on which interface value is extracted
Returns: 1. Config value : ConfigValue object
Interface value
2. error
Error on failure, nil on success
func (pubctx *PublisherCfg) GetMsgbusConfig() (map[string]interface{}, error)
GetMsgbusConfig to fetch client msgbus config for application to communicate over EII message bus
Returns: 1. map[string]interface{} 2. error
Error on failure, nil on success
func (pubctx *PublisherCfg) GetTopics() ([]string, error)
GetTopics gets topics from publisher interface config on which data will be published
Returns: 1. topics : string array
array of topics
2. error
Error on failure, nil on success
func (pubctx *PublisherCfg) SetTopics(topics []string) bool
SetTopics sets new topic for publisher in publishers interface config Parameters: 1. topics : string array
array of topics that needs to be set
Returns: 1. bool value : bool
true if success, false on failure
ServerCfg context
type ServerCfg struct {
// contains filtered or unexported fields
}
func (serverctx *ServerCfg) Destroy()
Destroy - To delete server context
func (serverctx *ServerCfg) GetAllowedClients() ([]string, error)
GetAllowedClients gets the names of the clients allowed to connect to server
Returns: 1. allowed_clients : string array
array of allowed clients
2. error
Error on failure, nil on success
func (serverctx *ServerCfg) GetEndPoints() (string, error)
GetEndPoints for application to fetch Endpoint associated with message bus config
Returns: 1. string
Endpoints value in string
2. error
Error on failure, nil on success
func (serverctx *ServerCfg) GetInterfaceValue(key string) (*ConfigValue, error)
GetInterfaceValue fetch interface value for application to communicate over EII message bus
Parameters: 1. key: string
Key on which interface value is extracted
Returns: 1. Config value : ConfigValue object
Interface value
2. error
Error on failure, nil on success
func (serverctx *ServerCfg) GetMsgbusConfig() (map[string]interface{}, error)
GetMsgbusConfig to fetch client msgbus config for application to communicate over EII message bus
Returns: 1. map[string]interface{} 2. error
Error on failure, nil on success
SubscriberCfg context
type SubscriberCfg struct {
// contains filtered or unexported fields
}
func (subctx *SubscriberCfg) Destroy()
Destroy - To delete Subscriber context
func (subctx *SubscriberCfg) GetEndPoints() (string, error)
GetEndPoints for application to fetch Endpoint associated with message bus config
Returns: 1. string
Endpoints value in string
2. error
Error on failure, nil on success
func (subctx *SubscriberCfg) GetInterfaceValue(key string) (*ConfigValue, error)
GetInterfaceValue fetch interface value for application to communicate over EII message bus
Parameters: 1. key: string
Key on which interface value is extracted
Returns: 1. Config value : ConfigValue object
Interface value
2. error
Error on failure, nil on success
func (subctx *SubscriberCfg) GetMsgbusConfig() (map[string]interface{}, error)
GetMsgbusConfig to fetch client msgbus config for application to communicate over EII message bus
Returns: 1. map[string]interface{} 2. error
Error on failure, nil on success
func (subctx *SubscriberCfg) GetTopics() ([]string, error)
GetTopics gets topics from subscriber interface config on which subscriber receives data Returns: 1. topics : string array
array of topics
2. error
Error on failure, nil on success
func (subctx *SubscriberCfg) SetTopics(topics []string) bool
SetTopics sets new topic for subscriber in subscribers interface config Parameters: 1. topics : string array
array of topics that needs to be set
Returns: 1. bool value : bool
true if success, false on failure
type ValType int
const ( String ValType = iota Int Array Json Boolean Float32 )
func (valType ValType) String() string
WatchObj context
type WatchObj struct {
// contains filtered or unexported fields
}
func (watchCtx *WatchObj) Watch(key string, callbackFunc goCallbacktype, user_data interface{})
func (watchCtx *WatchObj) WatchConfig(callbackFunc goCallbacktype, user_data interface{})
func (watchCtx *WatchObj) WatchConfigFile(callbackFunc fileCallbacktype, user_data interface{})
func (watchCtx *WatchObj) WatchInterface(callbackFunc goCallbacktype, user_data interface{})
func (watchCtx *WatchObj) WatchPrefix(prefix string, callbackFunc goCallbacktype, user_data interface{})