...
The Go Programming Language

Package eiiconfigmgr

import "github.com/open-edge-insights/eii-configmgr-go/eiiconfigmgr"
Overview
Index

Overview ▾

Index ▾

func GoStrings(argc C.int, argv **C.char) []string
func Restore(ptr unsafe.Pointer) (v interface{})
func Save(v interface{}) unsafe.Pointer
func Unref(ptr unsafe.Pointer)
type ClientCfg
    func (clientctx *ClientCfg) Destroy()
    func (clientctx *ClientCfg) GetEndPoints() (string, error)
    func (clientctx *ClientCfg) GetInterfaceValue(key string) (*ConfigValue, error)
    func (clientctx *ClientCfg) GetMsgbusConfig() (map[string]interface{}, error)
type ConfigMgr
    func ConfigManager() (*ConfigMgr, error)
    func (ctx *ConfigMgr) Destroy()
    func (ctx *ConfigMgr) GetAppConfig() (map[string]interface{}, error)
    func (ctx *ConfigMgr) GetAppName() (string, error)
    func (ctx *ConfigMgr) GetClientByIndex(index int) (*ClientCfg, error)
    func (ctx *ConfigMgr) GetClientByName(name string) (*ClientCfg, error)
    func (ctx *ConfigMgr) GetNumClients() (int, error)
    func (ctx *ConfigMgr) GetNumPublishers() (int, error)
    func (ctx *ConfigMgr) GetNumServers() (int, error)
    func (ctx *ConfigMgr) GetNumSubscribers() (int, error)
    func (ctx *ConfigMgr) GetPublisherByIndex(index int) (*PublisherCfg, error)
    func (ctx *ConfigMgr) GetPublisherByName(name string) (*PublisherCfg, error)
    func (ctx *ConfigMgr) GetServerByIndex(index int) (*ServerCfg, error)
    func (ctx *ConfigMgr) GetServerByName(name string) (*ServerCfg, error)
    func (ctx *ConfigMgr) GetSubscriberByIndex(index int) (*SubscriberCfg, error)
    func (ctx *ConfigMgr) GetSubscriberByName(name string) (*SubscriberCfg, error)
    func (configMgr *ConfigMgr) GetWatchObj() (*WatchObj, error)
    func (ctx *ConfigMgr) IsDevMode() (bool, error)
type ConfigValue
    func (cfg ConfigValue) GetArray() (array, error)
    func (cfg ConfigValue) GetBool() (boolean, error)
    func (cfg ConfigValue) GetFloat() (float, error)
    func (cfg ConfigValue) GetInteger() (integer, error)
    func (cfg ConfigValue) GetJSON() (object, error)
    func (cfg ConfigValue) GetString() (string, error)
type Expr
type PublisherCfg
    func (pubctx *PublisherCfg) Destroy()
    func (pubctx *PublisherCfg) GetAllowedClients() ([]string, error)
    func (pubctx *PublisherCfg) GetEndPoints() (string, error)
    func (pubctx *PublisherCfg) GetInterfaceValue(key string) (*ConfigValue, error)
    func (pubctx *PublisherCfg) GetMsgbusConfig() (map[string]interface{}, error)
    func (pubctx *PublisherCfg) GetTopics() ([]string, error)
    func (pubctx *PublisherCfg) SetTopics(topics []string) bool
type ServerCfg
    func (serverctx *ServerCfg) Destroy()
    func (serverctx *ServerCfg) GetAllowedClients() ([]string, error)
    func (serverctx *ServerCfg) GetEndPoints() (string, error)
    func (serverctx *ServerCfg) GetInterfaceValue(key string) (*ConfigValue, error)
    func (serverctx *ServerCfg) GetMsgbusConfig() (map[string]interface{}, error)
type SubscriberCfg
    func (subctx *SubscriberCfg) Destroy()
    func (subctx *SubscriberCfg) GetEndPoints() (string, error)
    func (subctx *SubscriberCfg) GetInterfaceValue(key string) (*ConfigValue, error)
    func (subctx *SubscriberCfg) GetMsgbusConfig() (map[string]interface{}, error)
    func (subctx *SubscriberCfg) GetTopics() ([]string, error)
    func (subctx *SubscriberCfg) SetTopics(topics []string) bool
type ValType
    func (valType ValType) String() string
type WatchObj
    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{})

Package files

ConfigManager.go Util.go cgo.go client.go publisher.go server.go subscriber.go

func GoStrings

func GoStrings(argc C.int, argv **C.char) []string

GoStrings - Convert C char** to Go string[]

func Restore

func Restore(ptr unsafe.Pointer) (v interface{})

Restore to fetch the interface associated with a particular unsafe.Pointer

func Save

func Save(v interface{}) unsafe.Pointer

Save function to store interface{} for every unsafe.Pointer

func Unref

func Unref(ptr unsafe.Pointer)

Unref to free the unsafe.Pointer & the associated interface{}

type ClientCfg

ClientCfg context

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

func (*ClientCfg) Destroy

func (clientctx *ClientCfg) Destroy()

Destroy - To delete Client context

func (*ClientCfg) GetEndPoints

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 (*ClientCfg) GetInterfaceValue

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 (*ClientCfg) GetMsgbusConfig

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

type ConfigMgr

ConfigMgr object

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

func ConfigManager

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 (*ConfigMgr) Destroy

func (ctx *ConfigMgr) Destroy()

func (*ConfigMgr) GetAppConfig

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 (*ConfigMgr) GetAppName

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 (*ConfigMgr) GetClientByIndex

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 (*ConfigMgr) GetClientByName

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 (*ConfigMgr) GetNumClients

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 (*ConfigMgr) GetNumPublishers

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 (*ConfigMgr) GetNumServers

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 (*ConfigMgr) GetNumSubscribers

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 (*ConfigMgr) GetPublisherByIndex

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 (*ConfigMgr) GetPublisherByName

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 (*ConfigMgr) GetServerByIndex

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 (*ConfigMgr) GetServerByName

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 (*ConfigMgr) GetSubscriberByIndex

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 (*ConfigMgr) GetSubscriberByName

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) GetWatchObj

func (configMgr *ConfigMgr) GetWatchObj() (*WatchObj, error)

func (*ConfigMgr) IsDevMode

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

type ConfigValue

ConfigValue - strcut to define config type and values

type ConfigValue struct {
    Type  ValType
    Value Expr
}

func (ConfigValue) GetArray

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 (ConfigValue) GetBool

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 (ConfigValue) GetFloat

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 (ConfigValue) GetInteger

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 (ConfigValue) GetJSON

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 (ConfigValue) GetString

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

type Expr interface {
    IsExpr()
}

type PublisherCfg

PublisherCfg context

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

func (*PublisherCfg) Destroy

func (pubctx *PublisherCfg) Destroy()

Destroy - To delete Publisher context

func (*PublisherCfg) GetAllowedClients

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 (*PublisherCfg) GetEndPoints

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 (*PublisherCfg) GetInterfaceValue

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 (*PublisherCfg) GetMsgbusConfig

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 (*PublisherCfg) GetTopics

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 (*PublisherCfg) SetTopics

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

type ServerCfg

ServerCfg context

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

func (*ServerCfg) Destroy

func (serverctx *ServerCfg) Destroy()

Destroy - To delete server context

func (*ServerCfg) GetAllowedClients

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 (*ServerCfg) GetEndPoints

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 (*ServerCfg) GetInterfaceValue

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 (*ServerCfg) GetMsgbusConfig

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

type SubscriberCfg

SubscriberCfg context

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

func (*SubscriberCfg) Destroy

func (subctx *SubscriberCfg) Destroy()

Destroy - To delete Subscriber context

func (*SubscriberCfg) GetEndPoints

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 (*SubscriberCfg) GetInterfaceValue

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 (*SubscriberCfg) GetMsgbusConfig

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 (*SubscriberCfg) GetTopics

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 (*SubscriberCfg) SetTopics

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

type ValType int
const (
    String ValType = iota
    Int
    Array
    Json
    Boolean
    Float32
)

func (ValType) String

func (valType ValType) String() string

type WatchObj

WatchObj context

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

func (*WatchObj) Watch

func (watchCtx *WatchObj) Watch(key string, callbackFunc goCallbacktype, user_data interface{})

func (*WatchObj) WatchConfig

func (watchCtx *WatchObj) WatchConfig(callbackFunc goCallbacktype, user_data interface{})

func (*WatchObj) WatchConfigFile

func (watchCtx *WatchObj) WatchConfigFile(callbackFunc fileCallbacktype, user_data interface{})

func (*WatchObj) WatchInterface

func (watchCtx *WatchObj) WatchInterface(callbackFunc goCallbacktype, user_data interface{})

func (*WatchObj) WatchPrefix

func (watchCtx *WatchObj) WatchPrefix(prefix string, callbackFunc goCallbacktype, user_data interface{})