xapp-frame is a simple framework for rapid development of RIC xapps, and supports various services essential for RIC xapps such as RESTful APIs, RMR (RIC Message Routing), database backend services and watching and populating config-map changes in K8S environment.
package main
import "gitlabe1.ext.net.nokia.com/ric_dev/nokia-xapps/xapp/pkg/xapp"
type MessageCounsumer struct {
}
func (m MessageCounsumer) Consume(mtype, len int, payload []byte) (err error) {
xapp.Logger.Debug("Message received - type=%d len=%d", mtype, len)
xapp.Sdl.Store("myKey", payload)
xapp.Rmr.Send(10005, len, payload)
return nil
}
func main() {
xapp.Run(MessageCounsumer{})
}
git clone git@gitlabe1.ext.net.nokia.com:ric_dev/nokia-xapps/xapp.git
unset GOPATH cd xapp/examples go build example-xapp.go ./example-xapp
Congratulations! You've just built your first xapp application.
xapp.Logger.SetLevel(4) xapp.Logger.Info("Status inquiry ...")
xapp.Sdl.Store("myKey", payload)
mid := Rmr.GetRicMessageId("RIC_SUB_RESP") xapp.Rmr.Send(mid, 1234, len, payload)
xapp.Resource.InjectRoute("/ric/v1/health/stat", statisticsHandler, "GET") Resource.InjectQueryRoute("/ric/v1/user", handler, "GET", "foo", "bar", "id", "mykey")
This project is licensed under the Apache License 2.0 - see the LICENSE.md file for details