-
Notifications
You must be signed in to change notification settings - Fork 0
/
node.go
45 lines (41 loc) · 1.27 KB
/
node.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package node
import (
"time"
"github.com/awlsring/texit/internal/pkg/domain/node"
"github.com/awlsring/texit/internal/pkg/domain/provider"
"github.com/awlsring/texit/internal/pkg/domain/tailnet"
)
type Node struct {
Identifier node.Identifier
Status node.Status
PlatformIdentifier node.PlatformIdentifier
Provider provider.Identifier
ProviderType provider.Type
Tailnet tailnet.Identifier
TailnetType tailnet.Type
TailnetName tailnet.DeviceName
TailnetIdentifier tailnet.DeviceIdentifier
Location provider.Location
Size node.Size
Ephemeral bool
CreatedAt time.Time
UpdatedAt time.Time
}
func NewBaseNode(n *node.Node) *Node {
return &Node{
Identifier: n.Identifier,
Status: node.StatusUnknown,
PlatformIdentifier: n.PlatformIdentifier,
Provider: n.Provider,
ProviderType: provider.TypeUnknown,
Tailnet: n.Tailnet,
TailnetType: tailnet.TypeUnknown,
TailnetName: n.TailnetName,
TailnetIdentifier: n.TailnetIdentifier,
Location: n.Location,
Size: n.Size,
Ephemeral: n.Ephemeral,
CreatedAt: n.CreatedAt,
UpdatedAt: n.UpdatedAt,
}
}