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

fugly godot commit

parent 02352b3b
No related branches found
No related tags found
1 merge request!363Resolve "Improve security by enabling and enforcing more linting rules"
Pipeline #110847 passed
Showing with 39 additions and 39 deletions
...@@ -39,7 +39,7 @@ import ( ...@@ -39,7 +39,7 @@ import (
"github.com/spf13/viper" "github.com/spf13/viper"
) )
// pndCreateCmd represents the create command // pndCreateCmd represents the create command.
var pndCreateCmd = &cobra.Command{ var pndCreateCmd = &cobra.Command{
Use: "create [description]", Use: "create [description]",
Args: cobra.ExactArgs(0), Args: cobra.ExactArgs(0),
......
...@@ -37,7 +37,7 @@ import ( ...@@ -37,7 +37,7 @@ import (
"github.com/spf13/viper" "github.com/spf13/viper"
) )
// pndGetCmd represents the get command // pndGetCmd represents the get command.
var pndGetCmd = &cobra.Command{ var pndGetCmd = &cobra.Command{
Use: "get", Use: "get",
Args: cobra.ExactArgs(1), Args: cobra.ExactArgs(1),
......
...@@ -38,7 +38,7 @@ import ( ...@@ -38,7 +38,7 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
// pndListCmd represents the listPND command // pndListCmd represents the listPND command.
var pndListCmd = &cobra.Command{ var pndListCmd = &cobra.Command{
Use: "list", Use: "list",
Aliases: []string{"ls"}, Aliases: []string{"ls"},
......
...@@ -38,7 +38,7 @@ import ( ...@@ -38,7 +38,7 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
// pndRemoveCmd represents the remove command // pndRemoveCmd represents the remove command.
var pndRemoveCmd = &cobra.Command{ var pndRemoveCmd = &cobra.Command{
Use: "remove", Use: "remove",
Aliases: []string{"rm"}, Aliases: []string{"rm"},
......
...@@ -39,7 +39,7 @@ import ( ...@@ -39,7 +39,7 @@ import (
"github.com/spf13/viper" "github.com/spf13/viper"
) )
// pndUseCmd represents the pnd command // pndUseCmd represents the pnd command.
var pndUseCmd = &cobra.Command{ var pndUseCmd = &cobra.Command{
Use: "use [uuid]", Use: "use [uuid]",
Args: cobra.ExactArgs(1), Args: cobra.ExactArgs(1),
......
...@@ -46,7 +46,7 @@ import ( ...@@ -46,7 +46,7 @@ import (
"github.com/spf13/viper" "github.com/spf13/viper"
) )
// PromptCompleter provides completion for a device // PromptCompleter provides completion for a device.
type PromptCompleter struct { type PromptCompleter struct {
yangSchemaCompleterMap map[uuid.UUID]*completer.YangSchemaCompleter yangSchemaCompleterMap map[uuid.UUID]*completer.YangSchemaCompleter
currentSuggestions []prompt.Suggest currentSuggestions []prompt.Suggest
...@@ -55,14 +55,14 @@ type PromptCompleter struct { ...@@ -55,14 +55,14 @@ type PromptCompleter struct {
history []string history []string
} }
// NewPromptCompleter returns a new promptCompleter // NewPromptCompleter returns a new promptCompleter.
func NewPromptCompleter() *PromptCompleter { func NewPromptCompleter() *PromptCompleter {
return &PromptCompleter{ return &PromptCompleter{
yangSchemaCompleterMap: make(map[uuid.UUID]*completer.YangSchemaCompleter), yangSchemaCompleterMap: make(map[uuid.UUID]*completer.YangSchemaCompleter),
} }
} }
// Run starts the interactive completion // Run starts the interactive completion.
func (pc *PromptCompleter) Run() { func (pc *PromptCompleter) Run() {
title, _ := pterm.DefaultBigText.WithLetters( title, _ := pterm.DefaultBigText.WithLetters(
pterm.NewLettersFromString("go"), pterm.NewLettersFromString("go"),
...@@ -347,7 +347,7 @@ var exitCmd = &cobra.Command{ ...@@ -347,7 +347,7 @@ var exitCmd = &cobra.Command{
}, },
} }
// deviceListCmd represents the listDevice command // deviceListCmd represents the listDevice command.
var promptCmd = &cobra.Command{ var promptCmd = &cobra.Command{
Use: "prompt", Use: "prompt",
Short: "The prompt command runs the CLI in an interactive shell.", Short: "The prompt command runs the CLI in an interactive shell.",
......
...@@ -56,7 +56,7 @@ var userToken string ...@@ -56,7 +56,7 @@ var userToken string
var pndAdapter *adapter.PndAdapter var pndAdapter *adapter.PndAdapter
// rootCmd represents the base command when called without any subcommands // rootCmd represents the base command when called without any subcommands.
var rootCmd = &cobra.Command{ var rootCmd = &cobra.Command{
Use: "gosdnc", Use: "gosdnc",
Short: "goSDN CLI", Short: "goSDN CLI",
......
...@@ -39,7 +39,7 @@ import ( ...@@ -39,7 +39,7 @@ import (
"github.com/spf13/viper" "github.com/spf13/viper"
) )
// loginCmd represents the login command // loginCmd represents the login command.
var userCreateCmd = &cobra.Command{ var userCreateCmd = &cobra.Command{
Use: "userCreate", Use: "userCreate",
Short: "Creates a user with provided data", Short: "Creates a user with provided data",
......
...@@ -38,7 +38,7 @@ import ( ...@@ -38,7 +38,7 @@ import (
"github.com/spf13/viper" "github.com/spf13/viper"
) )
// loginCmd represents the login command // loginCmd represents the login command.
var userDeleteCmd = &cobra.Command{ var userDeleteCmd = &cobra.Command{
Use: "userDelete", Use: "userDelete",
Short: "Deletes a user with provided data", Short: "Deletes a user with provided data",
......
...@@ -39,7 +39,7 @@ import ( ...@@ -39,7 +39,7 @@ import (
"github.com/spf13/viper" "github.com/spf13/viper"
) )
// loginCmd represents the login command // loginCmd represents the login command.
var userGetCmd = &cobra.Command{ var userGetCmd = &cobra.Command{
Use: "userGet", Use: "userGet",
Short: "Requests one user", Short: "Requests one user",
......
...@@ -38,7 +38,7 @@ import ( ...@@ -38,7 +38,7 @@ import (
"github.com/spf13/viper" "github.com/spf13/viper"
) )
// loginCmd represents the login command // loginCmd represents the login command.
var userGetAllCmd = &cobra.Command{ var userGetAllCmd = &cobra.Command{
Use: "userGetAll", Use: "userGetAll",
Short: "Requests all the available users", Short: "Requests all the available users",
......
...@@ -39,7 +39,7 @@ import ( ...@@ -39,7 +39,7 @@ import (
"github.com/spf13/viper" "github.com/spf13/viper"
) )
// loginCmd represents the login command // loginCmd represents the login command.
var userUpdateCmd = &cobra.Command{ var userUpdateCmd = &cobra.Command{
Use: "userUpdate", Use: "userUpdate",
Short: "Updates a user with provided data", Short: "Updates a user with provided data",
......
...@@ -53,7 +53,7 @@ func checkIPPort(string) error { ...@@ -53,7 +53,7 @@ func checkIPPort(string) error {
return nil return nil
} }
// sliceContains checks if a slice contains the given item // sliceContains checks if a slice contains the given item.
func sliceContains[T comparable](slice []T, toCompare T) bool { func sliceContains[T comparable](slice []T, toCompare T) bool {
for _, sliceEntry := range slice { for _, sliceEntry := range slice {
if sliceEntry == toCompare { if sliceEntry == toCompare {
......
...@@ -12,14 +12,14 @@ import ( ...@@ -12,14 +12,14 @@ import (
) )
var ( var (
// YangSchemaCompletionSeperator is the separator for yang schemas // YangSchemaCompletionSeperator is the separator for yang schemas.
YangSchemaCompletionSeperator = string([]byte{' ', '/'}) YangSchemaCompletionSeperator = string([]byte{' ', '/'})
) )
// The idea of path suggestions for a SBI's YANG schema is heavily inspired by // The idea of path suggestions for a SBI's YANG schema is heavily inspired by
// gnmic (https://github.com/karimra/gnmic) // gnmic (https://github.com/karimra/gnmic)
// YangSchemaCompleter represents the YangSchemaCompleter // YangSchemaCompleter represents the YangSchemaCompleter.
type YangSchemaCompleter struct { type YangSchemaCompleter struct {
Cache map[string]*yang.Entry Cache map[string]*yang.Entry
Entry *yang.Entry Entry *yang.Entry
...@@ -106,7 +106,7 @@ func promptFromYangEntry(e *yang.Entry) []prompt.Suggest { ...@@ -106,7 +106,7 @@ func promptFromYangEntry(e *yang.Entry) []prompt.Suggest {
return []prompt.Suggest{} return []prompt.Suggest{}
} }
// Complete provides the actual completion // Complete provides the actual completion.
func (c *YangSchemaCompleter) Complete(d prompt.Document) []prompt.Suggest { func (c *YangSchemaCompleter) Complete(d prompt.Document) []prompt.Suggest {
p := d.GetWordBeforeCursor() p := d.GetWordBeforeCursor()
......
...@@ -8,7 +8,7 @@ import ( ...@@ -8,7 +8,7 @@ import (
nbi "code.fbi.h-da.de/danet/gosdn/controller/northbound/client" nbi "code.fbi.h-da.de/danet/gosdn/controller/northbound/client"
) )
// Login logs a user in // Login logs a user in.
func Login(ctx context.Context, addr, username, pwd string) (*apb.LoginResponse, error) { func Login(ctx context.Context, addr, username, pwd string) (*apb.LoginResponse, error) {
authClient, err := nbi.AuthClient(addr, dialOptions...) authClient, err := nbi.AuthClient(addr, dialOptions...)
if err != nil { if err != nil {
...@@ -23,7 +23,7 @@ func Login(ctx context.Context, addr, username, pwd string) (*apb.LoginResponse, ...@@ -23,7 +23,7 @@ func Login(ctx context.Context, addr, username, pwd string) (*apb.LoginResponse,
return authClient.Login(ctx, r) return authClient.Login(ctx, r)
} }
// Logout logs a user out // Logout logs a user out.
func Logout(ctx context.Context, addr, username string) (*apb.LogoutResponse, error) { func Logout(ctx context.Context, addr, username string) (*apb.LogoutResponse, error) {
authClient, err := nbi.AuthClient(addr, dialOptions...) authClient, err := nbi.AuthClient(addr, dialOptions...)
if err != nil { if err != nil {
......
...@@ -9,7 +9,7 @@ import ( ...@@ -9,7 +9,7 @@ import (
nbi "code.fbi.h-da.de/danet/gosdn/controller/northbound/client" nbi "code.fbi.h-da.de/danet/gosdn/controller/northbound/client"
) )
// GetChanges requests all pending and unconfirmed changes from the controller // GetChanges requests all pending and unconfirmed changes from the controller.
func GetChanges(ctx context.Context, addr, pnd string) (*ppb.GetChangeListResponse, error) { func GetChanges(ctx context.Context, addr, pnd string) (*ppb.GetChangeListResponse, error) {
client, err := nbi.PndClient(addr, dialOptions...) client, err := nbi.PndClient(addr, dialOptions...)
if err != nil { if err != nil {
...@@ -22,7 +22,7 @@ func GetChanges(ctx context.Context, addr, pnd string) (*ppb.GetChangeListRespon ...@@ -22,7 +22,7 @@ func GetChanges(ctx context.Context, addr, pnd string) (*ppb.GetChangeListRespon
return client.GetChangeList(ctx, req) return client.GetChangeList(ctx, req)
} }
// GetChange requests one or more changes from the controller // GetChange requests one or more changes from the controller.
func GetChange(ctx context.Context, addr string, pnd string, args ...string) (*ppb.GetChangeResponse, error) { func GetChange(ctx context.Context, addr string, pnd string, args ...string) (*ppb.GetChangeResponse, error) {
client, err := nbi.PndClient(addr, dialOptions...) client, err := nbi.PndClient(addr, dialOptions...)
if err != nil { if err != nil {
...@@ -53,7 +53,7 @@ func Commit(ctx context.Context, addr, pnd string, cuids ...string) (*ppb.SetCha ...@@ -53,7 +53,7 @@ func Commit(ctx context.Context, addr, pnd string, cuids ...string) (*ppb.SetCha
} }
// Confirm sends a Confirm request for one or multiple changes to the // Confirm sends a Confirm request for one or multiple changes to the
// controller // controller.
func Confirm(ctx context.Context, addr, pnd string, cuids ...string) (*ppb.SetChangeListResponse, error) { func Confirm(ctx context.Context, addr, pnd string, cuids ...string) (*ppb.SetChangeListResponse, error) {
changes := make([]*ppb.SetChange, len(cuids)) changes := make([]*ppb.SetChange, len(cuids))
for i, arg := range cuids { for i, arg := range cuids {
...@@ -65,7 +65,7 @@ func Confirm(ctx context.Context, addr, pnd string, cuids ...string) (*ppb.SetCh ...@@ -65,7 +65,7 @@ func Confirm(ctx context.Context, addr, pnd string, cuids ...string) (*ppb.SetCh
return CommitConfirm(ctx, addr, pnd, changes) return CommitConfirm(ctx, addr, pnd, changes)
} }
// CommitConfirm confirms a commit // CommitConfirm confirms a commit.
func CommitConfirm(ctx context.Context, addr, pnd string, changes []*ppb.SetChange) (*ppb.SetChangeListResponse, error) { func CommitConfirm(ctx context.Context, addr, pnd string, changes []*ppb.SetChange) (*ppb.SetChangeListResponse, error) {
client, err := nbi.PndClient(addr, dialOptions...) client, err := nbi.PndClient(addr, dialOptions...)
if err != nil { if err != nil {
...@@ -94,7 +94,7 @@ func ChangeRequest(ctx context.Context, addr, did, pid, path, value string, op p ...@@ -94,7 +94,7 @@ func ChangeRequest(ctx context.Context, addr, did, pid, path, value string, op p
return SendChangeRequest(ctx, addr, pid, req) return SendChangeRequest(ctx, addr, pid, req)
} }
// SendChangeRequest sends a change request // SendChangeRequest sends a change request.
func SendChangeRequest(ctx context.Context, addr, pid string, req *ppb.ChangeRequest) (*ppb.SetPathListResponse, error) { func SendChangeRequest(ctx context.Context, addr, pid string, req *ppb.ChangeRequest) (*ppb.SetPathListResponse, error) {
pndClient, err := nbi.PndClient(addr, dialOptions...) pndClient, err := nbi.PndClient(addr, dialOptions...)
if err != nil { if err != nil {
......
...@@ -72,7 +72,7 @@ func GetDevice(ctx context.Context, addr, pid string, did string) (*ppb.GetOndRe ...@@ -72,7 +72,7 @@ func GetDevice(ctx context.Context, addr, pid string, did string) (*ppb.GetOndRe
return pndClient.GetOnd(ctx, req) return pndClient.GetOnd(ctx, req)
} }
// GetSbiSchemaTree gets the sbi tree for a sbi // GetSbiSchemaTree gets the sbi tree for a sbi.
func GetSbiSchemaTree(ctx context.Context, addr string, pid, sid uuid.UUID) (map[string]*yang.Entry, error) { func GetSbiSchemaTree(ctx context.Context, addr string, pid, sid uuid.UUID) (map[string]*yang.Entry, error) {
sbiClient, err := nbi.SbiClient(addr, dialOptions...) sbiClient, err := nbi.SbiClient(addr, dialOptions...)
if err != nil { if err != nil {
...@@ -136,7 +136,7 @@ func GetFlattenedDevices(ctx context.Context, addr, pid string) (*ppb.GetFlatten ...@@ -136,7 +136,7 @@ func GetFlattenedDevices(ctx context.Context, addr, pid string) (*ppb.GetFlatten
return pndClient.GetFlattenedOndList(ctx, req) return pndClient.GetFlattenedOndList(ctx, req)
} }
// GetPath requests a specific path // GetPath requests a specific path.
func GetPath(ctx context.Context, addr, pid, did, path string) (*ppb.GetPathResponse, error) { func GetPath(ctx context.Context, addr, pid, did, path string) (*ppb.GetPathResponse, error) {
pndClient, err := nbi.PndClient(addr, dialOptions...) pndClient, err := nbi.PndClient(addr, dialOptions...)
if err != nil { if err != nil {
...@@ -153,7 +153,7 @@ func GetPath(ctx context.Context, addr, pid, did, path string) (*ppb.GetPathResp ...@@ -153,7 +153,7 @@ func GetPath(ctx context.Context, addr, pid, did, path string) (*ppb.GetPathResp
return pndClient.GetPath(ctx, req) return pndClient.GetPath(ctx, req)
} }
// SubscribePath subscribes to paths on a device // SubscribePath subscribes to paths on a device.
func SubscribePath(ctx context.Context, addr, pid, did string, slist *ppb.SubscriptionList) (ppb.PndService_SubscribePathClient, error) { func SubscribePath(ctx context.Context, addr, pid, did string, slist *ppb.SubscriptionList) (ppb.PndService_SubscribePathClient, error) {
log.Println("subscribePath called") log.Println("subscribePath called")
pndClient, err := nbi.PndClient(addr, dialOptions...) pndClient, err := nbi.PndClient(addr, dialOptions...)
...@@ -171,7 +171,7 @@ func SubscribePath(ctx context.Context, addr, pid, did string, slist *ppb.Subscr ...@@ -171,7 +171,7 @@ func SubscribePath(ctx context.Context, addr, pid, did string, slist *ppb.Subscr
return pndClient.SubscribePath(ctx, req) return pndClient.SubscribePath(ctx, req)
} }
// DeleteDevice deletes a device // DeleteDevice deletes a device.
func DeleteDevice(ctx context.Context, addr, pid, did string) (*ppb.DeleteOndResponse, error) { func DeleteDevice(ctx context.Context, addr, pid, did string) (*ppb.DeleteOndResponse, error) {
pndClient, err := nbi.PndClient(addr, dialOptions...) pndClient, err := nbi.PndClient(addr, dialOptions...)
if err != nil { if err != nil {
......
...@@ -38,7 +38,7 @@ func Init(ctx context.Context, addr string) error { ...@@ -38,7 +38,7 @@ func Init(ctx context.Context, addr string) error {
return viper.WriteConfig() return viper.WriteConfig()
} }
// GetIds requests all UUID information from the controller // GetIds requests all UUID information from the controller.
func GetIds(ctx context.Context, addr string) ([]*ppb.PrincipalNetworkDomain, error) { func GetIds(ctx context.Context, addr string) ([]*ppb.PrincipalNetworkDomain, error) {
resp, err := GetAllCore(ctx, addr) resp, err := GetAllCore(ctx, addr)
if err != nil { if err != nil {
...@@ -47,7 +47,7 @@ func GetIds(ctx context.Context, addr string) ([]*ppb.PrincipalNetworkDomain, er ...@@ -47,7 +47,7 @@ func GetIds(ctx context.Context, addr string) ([]*ppb.PrincipalNetworkDomain, er
return resp.Pnd, nil return resp.Pnd, nil
} }
// GetAllCore requests all PNDs // GetAllCore requests all PNDs.
func GetAllCore(ctx context.Context, addr string) (*pb.GetPndListResponse, error) { func GetAllCore(ctx context.Context, addr string) (*pb.GetPndListResponse, error) {
coreClient, err := nbi.CoreClient(addr, dialOptions...) coreClient, err := nbi.CoreClient(addr, dialOptions...)
if err != nil { if err != nil {
......
...@@ -10,7 +10,7 @@ import ( ...@@ -10,7 +10,7 @@ import (
) )
// AddPnd takes a name, description and SBI UUID to create a new // AddPnd takes a name, description and SBI UUID to create a new
// PrincipalNetworkDomain on the controller // PrincipalNetworkDomain on the controller.
func AddPnd(ctx context.Context, addr, name, description, sbi string) (*pb.CreatePndListResponse, error) { func AddPnd(ctx context.Context, addr, name, description, sbi string) (*pb.CreatePndListResponse, error) {
coreClient, err := nbi.CoreClient(addr, dialOptions...) coreClient, err := nbi.CoreClient(addr, dialOptions...)
if err != nil { if err != nil {
......
...@@ -9,7 +9,7 @@ import ( ...@@ -9,7 +9,7 @@ import (
"github.com/google/uuid" "github.com/google/uuid"
) )
// CreateRoles creates roles with provided data // CreateRoles creates roles with provided data.
func CreateRoles(ctx context.Context, addr string, roles []*apb.Role) (*apb.CreateRolesResponse, error) { func CreateRoles(ctx context.Context, addr string, roles []*apb.Role) (*apb.CreateRolesResponse, error) {
roleClient, err := nbi.RoleClient(addr, dialOptions...) roleClient, err := nbi.RoleClient(addr, dialOptions...)
if err != nil { if err != nil {
...@@ -24,7 +24,7 @@ func CreateRoles(ctx context.Context, addr string, roles []*apb.Role) (*apb.Crea ...@@ -24,7 +24,7 @@ func CreateRoles(ctx context.Context, addr string, roles []*apb.Role) (*apb.Crea
return roleClient.CreateRoles(ctx, r) return roleClient.CreateRoles(ctx, r)
} }
// GetRole returns one requested role found by name // GetRole returns one requested role found by name.
func GetRole(ctx context.Context, addr, name string, uuid uuid.UUID) (*apb.GetRoleResponse, error) { func GetRole(ctx context.Context, addr, name string, uuid uuid.UUID) (*apb.GetRoleResponse, error) {
roleClient, err := nbi.RoleClient(addr, dialOptions...) roleClient, err := nbi.RoleClient(addr, dialOptions...)
if err != nil { if err != nil {
...@@ -40,7 +40,7 @@ func GetRole(ctx context.Context, addr, name string, uuid uuid.UUID) (*apb.GetRo ...@@ -40,7 +40,7 @@ func GetRole(ctx context.Context, addr, name string, uuid uuid.UUID) (*apb.GetRo
return roleClient.GetRole(ctx, r) return roleClient.GetRole(ctx, r)
} }
// GetRoles returns all available roles // GetRoles returns all available roles.
func GetRoles(ctx context.Context, addr string) (*apb.GetRolesResponse, error) { func GetRoles(ctx context.Context, addr string) (*apb.GetRolesResponse, error) {
roleClient, err := nbi.RoleClient(addr, dialOptions...) roleClient, err := nbi.RoleClient(addr, dialOptions...)
if err != nil { if err != nil {
...@@ -54,7 +54,7 @@ func GetRoles(ctx context.Context, addr string) (*apb.GetRolesResponse, error) { ...@@ -54,7 +54,7 @@ func GetRoles(ctx context.Context, addr string) (*apb.GetRolesResponse, error) {
return roleClient.GetRoles(ctx, r) return roleClient.GetRoles(ctx, r)
} }
// UpdateRoles updates the procided roles // UpdateRoles updates the procided roles.
func UpdateRoles(ctx context.Context, addr string, roles []*apb.Role) (*apb.UpdateRolesResponse, error) { func UpdateRoles(ctx context.Context, addr string, roles []*apb.Role) (*apb.UpdateRolesResponse, error) {
roleClient, err := nbi.RoleClient(addr, dialOptions...) roleClient, err := nbi.RoleClient(addr, dialOptions...)
if err != nil { if err != nil {
...@@ -69,7 +69,7 @@ func UpdateRoles(ctx context.Context, addr string, roles []*apb.Role) (*apb.Upda ...@@ -69,7 +69,7 @@ func UpdateRoles(ctx context.Context, addr string, roles []*apb.Role) (*apb.Upda
return roleClient.UpdateRoles(ctx, r) return roleClient.UpdateRoles(ctx, r)
} }
// DeletePermissionForRole deletes the provided permissions from one role found by name // DeletePermissionForRole deletes the provided permissions from one role found by name.
func DeletePermissionForRole(ctx context.Context, addr, name string, permissionsToDelete []string) (*apb.DeletePermissionsForRoleResponse, error) { func DeletePermissionForRole(ctx context.Context, addr, name string, permissionsToDelete []string) (*apb.DeletePermissionsForRoleResponse, error) {
roleClient, err := nbi.RoleClient(addr, dialOptions...) roleClient, err := nbi.RoleClient(addr, dialOptions...)
if err != nil { if err != nil {
...@@ -85,7 +85,7 @@ func DeletePermissionForRole(ctx context.Context, addr, name string, permissions ...@@ -85,7 +85,7 @@ func DeletePermissionForRole(ctx context.Context, addr, name string, permissions
return roleClient.DeletePermissionsForRole(ctx, r) return roleClient.DeletePermissionsForRole(ctx, r)
} }
// DeleteRoles deletes all the provided roles with their permissions // DeleteRoles deletes all the provided roles with their permissions.
func DeleteRoles(ctx context.Context, addr string, roleName []string) (*apb.DeleteRolesResponse, error) { func DeleteRoles(ctx context.Context, addr string, roleName []string) (*apb.DeleteRolesResponse, error) {
roleClient, err := nbi.RoleClient(addr, dialOptions...) roleClient, err := nbi.RoleClient(addr, dialOptions...)
if err != nil { if err != nil {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment