Files
netbird/management/store/store.go
andpar83 9e4aa4f1f1 Move management server to a separate directory (#67)
* Move management server to a separate directory
2021-07-24 16:14:29 +02:00

30 lines
724 B
Go

package store
// Account represents a unique account of the system
type Account struct {
Id string
SetupKeys map[string]*SetupKey
Peers map[string]*Peer
}
// SetupKey represents a pre-authorized key used to register machines (peers)
// One key might have multiple machines
type SetupKey struct {
Key string
}
// Peer represents a machine connected to the network.
// The Peer is a Wireguard peer identified by a public key
type Peer struct {
// Wireguard public key
Key string
// A setup key this peer was registered with
SetupKey *SetupKey
}
type Store interface {
PeerExists(peerKey string) bool
AddPeer(setupKey string, peerKey string) error
GetPeersForAPeer(peerKey string) ([]string, error)
}