2021-08-15 16:56:26 +02:00
|
|
|
package client
|
|
|
|
|
|
|
|
import (
|
2024-05-07 18:50:34 +02:00
|
|
|
"context"
|
2022-02-08 18:03:27 +01:00
|
|
|
"io"
|
|
|
|
|
2024-05-07 18:50:34 +02:00
|
|
|
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
|
|
|
|
|
2022-03-26 12:08:54 +01:00
|
|
|
"github.com/netbirdio/netbird/client/system"
|
|
|
|
"github.com/netbirdio/netbird/management/proto"
|
2021-08-15 16:56:26 +02:00
|
|
|
)
|
|
|
|
|
2022-01-18 16:44:58 +01:00
|
|
|
type Client interface {
|
|
|
|
io.Closer
|
2024-06-13 13:24:24 +02:00
|
|
|
Sync(ctx context.Context, sysInfo *system.Info, msgHandler func(msg *proto.SyncResponse) error) error
|
2022-01-18 16:44:58 +01:00
|
|
|
GetServerPublicKey() (*wgtypes.Key, error)
|
2022-06-23 17:04:53 +02:00
|
|
|
Register(serverKey wgtypes.Key, setupKey string, jwtToken string, sysInfo *system.Info, sshKey []byte) (*proto.LoginResponse, error)
|
|
|
|
Login(serverKey wgtypes.Key, sysInfo *system.Info, sshKey []byte) (*proto.LoginResponse, error)
|
2022-05-08 11:04:57 +02:00
|
|
|
GetDeviceAuthorizationFlow(serverKey wgtypes.Key) (*proto.DeviceAuthorizationFlow, error)
|
2023-07-27 11:31:07 +02:00
|
|
|
GetPKCEAuthorizationFlow(serverKey wgtypes.Key) (*proto.PKCEAuthorizationFlow, error)
|
2024-06-13 13:24:24 +02:00
|
|
|
GetNetworkMap(sysInfo *system.Info) (*proto.NetworkMap, error)
|
2024-01-22 12:20:24 +01:00
|
|
|
IsHealthy() bool
|
2024-06-13 13:24:24 +02:00
|
|
|
SyncMeta(sysInfo *system.Info) error
|
2021-08-15 16:56:26 +02:00
|
|
|
}
|