mirror of
https://github.com/juanfont/headscale.git
synced 2026-03-30 14:12:37 +02:00
lint and leftover
Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:
committed by
Kristoffer Dalby
parent
39443184d6
commit
233dffc186
@@ -54,6 +54,20 @@ func (id NodeID) String() string {
|
||||
return strconv.FormatUint(id.Uint64(), util.Base10)
|
||||
}
|
||||
|
||||
func ParseNodeID(s string) (NodeID, error) {
|
||||
id, err := strconv.ParseUint(s, util.Base10, 64)
|
||||
return NodeID(id), err
|
||||
}
|
||||
|
||||
func MustParseNodeID(s string) NodeID {
|
||||
id, err := ParseNodeID(s)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return id
|
||||
}
|
||||
|
||||
// Node is a Headscale client.
|
||||
type Node struct {
|
||||
ID NodeID `gorm:"primary_key"`
|
||||
|
||||
Reference in New Issue
Block a user