Skip to content
Snippets Groups Projects
Commit ee56ce6b authored by Fabian Seidl's avatar Fabian Seidl
Browse files

linter pleasing and small changes

parent 2970d0c2
No related branches found
No related tags found
3 merge requests!376Add additional example application hostname-checker,!343Add basic application framework and example application to show interaction between events an NBI,!342Resolve "Add an option to send gNMI Subscribe requests via SBI"
Pipeline #107899 failed
......@@ -127,6 +127,8 @@ func (p *PndAdapter) Request(ctx context.Context, did uuid.UUID, path string) (*
return resp, nil
}
// SubscribeONDPath sends an API call to the controller requesting to subscribe
// to a specific path of a specifc device
func (p *PndAdapter) SubscribeONDPath(ctx context.Context, did uuid.UUID, slist *ppb.SubscriptionList) (ppb.PndService_SubscribePathClient, error) {
resp, err := api.SubscribePath(ctx, p.endpoint, p.id.String(), did.String(), slist)
if err != nil {
......
......@@ -152,6 +152,7 @@ func GetPath(ctx context.Context, addr, pid, did, path string) (*ppb.GetPathResp
return pndClient.GetPath(ctx, req)
}
// SubscribePath subscribes to paths on a device
func SubscribePath(ctx context.Context, addr, pid, did string, slist *ppb.SubscriptionList) (ppb.PndService_SubscribePathClient, error) {
log.Println("subscribePath called")
pndClient, err := nbi.PndClient(addr, dialOptions...)
......
......@@ -522,13 +522,13 @@ func (pnd *pndImplementation) SubscribePath(uuid uuid.UUID, subList *ppb.Subscri
return err
}
mode, err := MapModeToAristaFork(subList.GetMode())
mode, err := mapModeToAristaFork(subList.GetMode())
if err != nil {
return err
}
for _, sub := range subList.Subscription {
streamMode, err := MapStreamModeToAristaFork(sub.GetStreamMode())
streamMode, err := mapStreamModeToAristaFork(sub.GetStreamMode())
if err != nil {
return err
}
......@@ -555,7 +555,7 @@ func splitStringPath(s string) []string {
return strings.Split(s, "/")
}
func MapStreamModeToAristaFork(mode ppb.StreamMode) (string, error) {
func mapStreamModeToAristaFork(mode ppb.StreamMode) (string, error) {
switch mode {
case ppb.StreamMode_STREAM_MODE_TARGET_DEFINED:
return "target_defined", nil
......@@ -568,7 +568,7 @@ func MapStreamModeToAristaFork(mode ppb.StreamMode) (string, error) {
}
}
func MapModeToAristaFork(mode ppb.SubscriptionMode) (string, error) {
func mapModeToAristaFork(mode ppb.SubscriptionMode) (string, error) {
switch mode {
case ppb.SubscriptionMode_SUBSCRIPTION_MODE_STREAM:
return "stream", nil
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment