-
Notifications
You must be signed in to change notification settings - Fork 4
/
connector.go
72 lines (62 loc) · 3.1 KB
/
connector.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package models
import (
"time"
"github.com/borderzero/border0-go/types/connector"
"github.com/borderzero/border0-go/types/service"
)
// ConnectorList represents a list of connectors
type ConnectorList struct {
List []Connector `json:"list"`
}
// Connector represents a cloud-managed Border0 Connector.
type Connector struct {
Name string `json:"name"`
ConnectorID string `json:"connector_id"`
BuiltInSshServiceEnabled bool `json:"built_in_ssh_service_enabled"`
BuiltInSshServiceConfiguration *service.BuiltInSshServiceConfiguration `json:"built_in_ssh_service_configuration,omitempty"`
Description string `json:"description"`
ActiveTokens int `json:"active_tokens"`
Metadata map[string]interface{} `json:"metadata"`
CreatedAt *time.Time `json:"created_at"`
UpdatedAt *time.Time `json:"updated_at"`
LastSeenAt *time.Time `json:"last_seen_at"`
}
// ConnectorWithInstallTokenRequest represents a request to create a Border0 connector and
// connector token with an install token.
type ConnectorWithInstallTokenRequest struct {
Connector
InstallToken string `json:"install_token"`
}
// ConnectorWithInstallTokenResponse represents a response from the request that created
// a Border0 connector and connector token with an install token.
type ConnectorWithInstallTokenResponse struct {
Connector Connector `json:"connector"`
ConnectorToken ConnectorToken `json:"connector_token"`
}
// ConnectorTokenRequest represents a request to create a token for a Border0 Connector.
type ConnectorTokenRequest struct {
ConnectorId string `json:"connector_id,omitempty"`
Name string `json:"name,omitempty"`
ExpiresAt int64 `json:"expires_at,omitempty"`
}
// ConnectorToken represents a token for a Border0 Connector.
type ConnectorToken struct {
ConnectorName string `json:"connector_name,omitempty"`
Name string `json:"name,omitempty"`
ExpiresAt string `json:"expires_at,omitempty"`
Token string `json:"token,omitempty"`
}
// ConnectorPluginRequest represents a request to create a plugin for a Border0 Connector.
type ConnectorPluginRequest struct {
ConnectorId string `json:"connector_id"`
Enabled bool `json:"enabled"`
PluginType string `json:"plugin_type"`
Configuration *connector.PluginConfiguration `json:"configuration"`
}
// ConnectorPlugin represents a plugin for a Border0 Connector.
type ConnectorPlugin struct {
ID string `json:"id"`
Enabled bool `json:"enabled"`
PluginType string `json:"plugin_type"`
Configuration connector.PluginConfiguration `json:"configuration"`
}