2021-12-27 14:56:50 +00:00
|
|
|
package cfapi
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/google/uuid"
|
|
|
|
)
|
|
|
|
|
|
|
|
type TunnelClient interface {
|
2022-02-21 11:49:13 +00:00
|
|
|
CreateTunnel(name string, tunnelSecret []byte) (*TunnelWithToken, error)
|
2021-12-27 14:56:50 +00:00
|
|
|
GetTunnel(tunnelID uuid.UUID) (*Tunnel, error)
|
2022-03-22 12:46:07 +00:00
|
|
|
GetTunnelToken(tunnelID uuid.UUID) (string, error)
|
2021-12-27 14:56:50 +00:00
|
|
|
DeleteTunnel(tunnelID uuid.UUID) error
|
|
|
|
ListTunnels(filter *TunnelFilter) ([]*Tunnel, error)
|
|
|
|
ListActiveClients(tunnelID uuid.UUID) ([]*ActiveClient, error)
|
|
|
|
CleanupConnections(tunnelID uuid.UUID, params *CleanupParams) error
|
|
|
|
}
|
|
|
|
|
|
|
|
type HostnameClient interface {
|
|
|
|
RouteTunnel(tunnelID uuid.UUID, route HostnameRoute) (HostnameRouteResult, error)
|
|
|
|
}
|
|
|
|
|
|
|
|
type IPRouteClient interface {
|
|
|
|
ListRoutes(filter *IpRouteFilter) ([]*DetailedRoute, error)
|
|
|
|
AddRoute(newRoute NewRoute) (Route, error)
|
|
|
|
DeleteRoute(params DeleteRouteParams) error
|
|
|
|
GetByIP(params GetRouteByIpParams) (DetailedRoute, error)
|
|
|
|
}
|
|
|
|
|
|
|
|
type VnetClient interface {
|
|
|
|
CreateVirtualNetwork(newVnet NewVirtualNetwork) (VirtualNetwork, error)
|
|
|
|
ListVirtualNetworks(filter *VnetFilter) ([]*VirtualNetwork, error)
|
|
|
|
DeleteVirtualNetwork(id uuid.UUID) error
|
|
|
|
UpdateVirtualNetwork(id uuid.UUID, updates UpdateVirtualNetwork) error
|
|
|
|
}
|
|
|
|
|
|
|
|
type Client interface {
|
|
|
|
TunnelClient
|
|
|
|
HostnameClient
|
|
|
|
IPRouteClient
|
|
|
|
VnetClient
|
|
|
|
}
|