Skip to content
Snippets Groups Projects

Add basic application framework and example application to show interaction between events an NBI

Merged Ghost User requested to merge istaester/init-application-framework into develop
2 files
+ 36
1
Compare changes
  • Side-by-side
  • Inline
Files
2
package registration
import (
"context"
"time"
"code.fbi.h-da.de/danet/gosdn/api/go/gosdn/app"
"google.golang.org/grpc"
)
// Register registers a new app at the control plane.
func Register(name, token string) (string, error) {
conn, err := grpc.Dial("localhost:55055", grpc.WithInsecure())
if err != nil {
return "", err
}
ctx := context.Background()
appService := app.NewAppServiceClient(conn)
request := &app.AppRegisterRequest{
Timestamp: time.Now().UnixNano(),
Appname: name,
Token: token,
}
response, err := appService.Register(ctx, request)
if err != nil {
return "", err
}
return response.Queueconnection, nil
}
Loading