Skip to content

Commit

Permalink
make linter happy
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Richter <[email protected]>
  • Loading branch information
dragonchaser committed Jun 19, 2023
1 parent a3b8a77 commit a8934c3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
3 changes: 2 additions & 1 deletion services/audit/pkg/types/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package types

import "strings"

func SplitId(id string) (string, string) {
// SplitStorageIDFromSpaceID splits the storage- and spaceid- from the given string
func SplitStorageIDFromSpaceID(id string) (string, string) {
ids := strings.Split(id, "$")
if len(ids) != 2 {
return id, ""
Expand Down
32 changes: 16 additions & 16 deletions services/audit/pkg/types/messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,51 +139,51 @@ func MessageFileVersionRestored(executant, item, version string) string {

// MessageSpaceCreated returns the human readable string that describes the action
func MessageSpaceCreated(executant, spaceID, name string) string {
storagId, spaceID := SplitId(spaceID)
return fmt.Sprintf("user '%s' created a space '%s' with name '%s' (storage: '%s')", executant, spaceID, name, storagId)
storagID, spaceID := SplitStorageIDFromSpaceID(spaceID)
return fmt.Sprintf("user '%s' created a space '%s' with name '%s' (storage: '%s')", executant, spaceID, name, storagID)
}

// MessageSpaceRenamed returns the human readable string that describes the action
func MessageSpaceRenamed(executant, spaceID, name string) string {
storagId, spaceID := SplitId(spaceID)
return fmt.Sprintf("user '%s' renamed space '%s' to '%s' (storage: '%s')", executant, spaceID, name, storagId)
storagID, spaceID := SplitStorageIDFromSpaceID(spaceID)
return fmt.Sprintf("user '%s' renamed space '%s' to '%s' (storage: '%s')", executant, spaceID, name, storagID)
}

// MessageSpaceDisabled returns the human readable string that describes the action
func MessageSpaceDisabled(executant, spaceID string) string {
storagId, spaceID := SplitId(spaceID)
return fmt.Sprintf("user '%s' disabled the space '%s' (storage: '%s')", executant, spaceID, storagId)
storagID, spaceID := SplitStorageIDFromSpaceID(spaceID)
return fmt.Sprintf("user '%s' disabled the space '%s' (storage: '%s')", executant, spaceID, storagID)
}

// MessageSpaceEnabled returns the human readable string that describes the action
func MessageSpaceEnabled(executant, spaceID string) string {
storagId, spaceID := SplitId(spaceID)
return fmt.Sprintf("user '%s' (re-) enabled the space '%s' (storage: '%s')", executant, spaceID, storagId)
storagID, spaceID := SplitStorageIDFromSpaceID(spaceID)
return fmt.Sprintf("user '%s' (re-) enabled the space '%s' (storage: '%s')", executant, spaceID, storagID)
}

// MessageSpaceDeleted returns the human readable string that describes the action
func MessageSpaceDeleted(executant, spaceID string) string {
storagId, spaceID := SplitId(spaceID)
return fmt.Sprintf("user '%s' deleted the space '%s' (storage: '%s')", executant, spaceID, storagId)
storagID, spaceID := SplitStorageIDFromSpaceID(spaceID)
return fmt.Sprintf("user '%s' deleted the space '%s' (storage: '%s')", executant, spaceID, storagID)
}

// MessageSpaceShared returns the human readable string that describes the action
func MessageSpaceShared(executant, spaceID, grantee string) string {
storagId, spaceID := SplitId(spaceID)
return fmt.Sprintf("user '%s' shared the space '%s' with '%s' (storage: '%s')", executant, spaceID, grantee, storagId)
storagID, spaceID := SplitStorageIDFromSpaceID(spaceID)
return fmt.Sprintf("user '%s' shared the space '%s' with '%s' (storage: '%s')", executant, spaceID, grantee, storagID)
}

// MessageSpaceUnshared returns the human readable string that describes the action
func MessageSpaceUnshared(executant, spaceID, grantee string) string {
storagId, spaceID := SplitId(spaceID)
return fmt.Sprintf("user '%s' unshared the space '%s' with '%s' (storage: '%s')", executant, spaceID, grantee, storagId)
storagID, spaceID := SplitStorageIDFromSpaceID(spaceID)
return fmt.Sprintf("user '%s' unshared the space '%s' with '%s' (storage: '%s')", executant, spaceID, grantee, storagID)
}

// MessageSpaceUpdated returns the human readable string that describes the action
func MessageSpaceUpdated(executant, spaceID, name string, quota uint64, opaque map[string]string) string {
storagId, spaceID := SplitId(spaceID)
storagID, spaceID := SplitStorageIDFromSpaceID(spaceID)
return fmt.Sprintf("user '%s' updated space '%s'. name: '%s', quota: '%d', opaque: '%s' (storage: '%s')",
executant, spaceID, name, quota, opaque, storagId)
executant, spaceID, name, quota, opaque, storagID)
}

// MessageUserCreated returns the human readable string that describes the action
Expand Down

0 comments on commit a8934c3

Please sign in to comment.