Skip to content

Commit

Permalink
Add Sting() method to RequestNameReply and ReleaseNameReply.
Browse files Browse the repository at this point in the history
  • Loading branch information
istvan-andrasi committed Dec 9, 2024
1 parent c266b19 commit ad645b0
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions export.go
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,18 @@ const (
ReleaseNameReplyNotOwner
)

func (rep ReleaseNameReply) String() string {
switch rep {
case ReleaseNameReplyReleased:
return "released"
case ReleaseNameReplyNonExistent:
return "non existent"
case ReleaseNameReplyNotOwner:
return "not owner"
}
return "unknown"
}

// RequestNameFlags represents the possible flags for a RequestName call.
type RequestNameFlags uint32

Expand All @@ -456,3 +468,17 @@ const (
RequestNameReplyExists
RequestNameReplyAlreadyOwner
)

func (rep RequestNameReply) String() string {
switch rep {
case RequestNameReplyPrimaryOwner:
return "primary owner"
case RequestNameReplyInQueue:
return "in queue"
case RequestNameReplyExists:
return "exists"
case RequestNameReplyAlreadyOwner:
return "already owner"
}
return "unknown"
}

0 comments on commit ad645b0

Please sign in to comment.