diff options
Diffstat (limited to 'iana')
-rw-r--r-- | iana/archtype.go | 4 | ||||
-rw-r--r-- | iana/hwtypes.go | 8 | ||||
-rw-r--r-- | iana/statuscodes.go | 4 |
3 files changed, 12 insertions, 4 deletions
diff --git a/iana/archtype.go b/iana/archtype.go index 6b2cc9e..ca21490 100644 --- a/iana/archtype.go +++ b/iana/archtype.go @@ -32,8 +32,8 @@ var ArchTypeToStringMap = map[ArchType]string{ } -// ArchTypeToString returns a mnemonic name for a given architecture type -func ArchTypeToString(a ArchType) string { +// String returns a mnemonic name for a given architecture type +func (a ArchType) String() string { if at := ArchTypeToStringMap[a]; at != "" { return at } diff --git a/iana/hwtypes.go b/iana/hwtypes.go index 7467a78..075cded 100644 --- a/iana/hwtypes.go +++ b/iana/hwtypes.go @@ -78,3 +78,11 @@ var HwTypeToString = map[HwTypeType]string{ HwTypeWiegandInterface: "Wiegand Interface", HwTypePureIP: "Pure IP", } + +func (h HwTypeType) String() string { + hwtype := HwTypeToString[h] + if hwtype == "" { + hwtype = "Invalid" + } + return hwtype +} diff --git a/iana/statuscodes.go b/iana/statuscodes.go index d3ca410..f61f99e 100644 --- a/iana/statuscodes.go +++ b/iana/statuscodes.go @@ -38,8 +38,8 @@ const ( StatusExcessiveTimeSkew StatusCode = 22 ) -// StatusCodeToString returns a mnemonic name for a given status code -func StatusCodeToString(s StatusCode) string { +// String returns a mnemonic name for a given status code +func (s StatusCode) String() string { if sc := StatusCodeToStringMap[s]; sc != "" { return sc } |