Skip to content

Commit

Permalink
Add String() method to PrefixType.
Browse files Browse the repository at this point in the history
  • Loading branch information
tamalsaha committed Jul 5, 2017
1 parent 158bdab commit 335b721
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions api/prefix_type.go
Expand Up @@ -14,6 +14,20 @@ const (
None
)

func (m PrefixType) String() string {
switch m {
case Smart:
return "Smart"
case NodeName:
return "NodeName"
case PodName:
return "PodName"
case None:
return "None"
}
return "<invalid>"
}

func (m PrefixType) MarshalJSON() ([]byte, error) {
switch m {
case Smart:
Expand Down

0 comments on commit 335b721

Please sign in to comment.