2023-07-10 19:44:58 +02:00
|
|
|
package sdk
|
|
|
|
|
2023-09-05 17:10:25 +02:00
|
|
|
import "time"
|
|
|
|
|
2023-07-10 19:44:58 +02:00
|
|
|
type BackendMode string
|
|
|
|
|
|
|
|
const (
|
|
|
|
ProxyBackendMode BackendMode = "proxy"
|
|
|
|
WebBackendMode BackendMode = "web"
|
|
|
|
TcpTunnelBackendMode BackendMode = "tcpTunnel"
|
|
|
|
UdpTunnelBackendMode BackendMode = "udpTunnel"
|
2023-08-28 20:49:20 +02:00
|
|
|
CaddyBackendMode BackendMode = "caddy"
|
2023-07-10 19:44:58 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
type ShareMode string
|
|
|
|
|
|
|
|
const (
|
|
|
|
PrivateShareMode ShareMode = "private"
|
|
|
|
PublicShareMode ShareMode = "public"
|
|
|
|
)
|
|
|
|
|
|
|
|
type ShareRequest struct {
|
2023-09-05 17:10:25 +02:00
|
|
|
BackendMode BackendMode
|
|
|
|
ShareMode ShareMode
|
|
|
|
Target string
|
2023-09-28 19:06:00 +02:00
|
|
|
Frontends []string
|
|
|
|
BasicAuth []string
|
2023-09-05 17:10:25 +02:00
|
|
|
OauthProvider string
|
|
|
|
OauthEmailDomains []string
|
|
|
|
OauthAuthorizationCheckInterval time.Duration
|
2023-07-10 19:44:58 +02:00
|
|
|
}
|
2023-07-17 22:45:20 +02:00
|
|
|
|
2023-07-18 21:30:46 +02:00
|
|
|
type Share struct {
|
2023-10-25 17:44:21 +02:00
|
|
|
Token string `json:"token"`
|
|
|
|
FrontendEndpoints []string `json:"frontend_endpoints"`
|
2023-07-18 21:30:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
type AccessRequest struct {
|
|
|
|
ShareToken string
|
|
|
|
}
|
|
|
|
|
|
|
|
type Access struct {
|
|
|
|
Token string
|
|
|
|
ShareToken string
|
|
|
|
BackendMode BackendMode
|
|
|
|
}
|
|
|
|
|
2023-07-17 22:45:20 +02:00
|
|
|
type Metrics struct {
|
|
|
|
Namespace string
|
|
|
|
Sessions map[string]SessionMetrics
|
|
|
|
}
|
|
|
|
|
|
|
|
type SessionMetrics struct {
|
|
|
|
BytesRead int64
|
|
|
|
BytesWritten int64
|
|
|
|
LastUpdate int64
|
|
|
|
}
|
|
|
|
|
|
|
|
type AuthScheme string
|
|
|
|
|
|
|
|
const (
|
|
|
|
None AuthScheme = "none"
|
|
|
|
Basic AuthScheme = "basic"
|
2023-09-05 17:10:25 +02:00
|
|
|
Oauth AuthScheme = "oauth"
|
2023-07-17 22:45:20 +02:00
|
|
|
)
|