// NewSDLClient returns a new SDLClient.
func NewSDLClient(ns string) *SDLClient {
+ if ns == "" {
+ ns = "sdl"
+ }
return &SDLClient{
db: sdl.NewSdlInstance(ns, sdl.NewDatabase()),
stat: Metric.RegisterCounterGroup(SDLCounterOpts, "SDL"),
return
}
-func NewRNIBClient(ns string) *RNIBClient {
+func NewRNIBClient() *RNIBClient {
s := sdl.NewSdlInstance("e2Manager", sdl.NewDatabase())
return &RNIBClient{
db: s,
}
}
+func (r *RNIBClient) Subscribe(cb func(string, ...string), channel string) error {
+ return r.db.SubscribeChannel(cb, channel)
+}
+
+func (r *RNIBClient) StoreAndPublish(channel string, event string, pairs ...interface{}) error {
+ return r.db.SetAndPublish([]string{channel, event}, pairs...)
+}
+
func (r *RNIBClient) GetNodeb(invName string) (*RNIBNodebInfo, RNIBIRNibError) {
return rnibreader.GetRNibReader(r.db).GetNodeb(invName)
}