Documentation ¶
Index ¶
- type Config
- type CreateGatewayParams
- type GatewayCreator
- type Service
- func (s *Service) AddCluster(ctx context.Context, webProxyAddress string) (*clusters.Cluster, error)
- func (s *Service) AssumeRole(ctx context.Context, req *api.AssumeRoleRequest) error
- func (s *Service) ClusterLogout(ctx context.Context, uri string) error
- func (s *Service) CreateAccessRequest(ctx context.Context, req *api.CreateAccessRequestRequest) (*clusters.AccessRequest, error)
- func (s *Service) CreateGateway(ctx context.Context, params CreateGatewayParams) (*gateway.Gateway, error)
- func (s *Service) DeleteAccessRequest(ctx context.Context, req *api.DeleteAccessRequestRequest) error
- func (s *Service) GetAccessRequest(ctx context.Context, req *api.GetAccessRequestRequest) ([]clusters.AccessRequest, error)
- func (s *Service) GetAccessRequests(ctx context.Context, req *api.GetAccessRequestsRequest) ([]clusters.AccessRequest, error)
- func (s *Service) GetAllKubes(ctx context.Context, uri string) ([]clusters.Kube, error)
- func (s *Service) GetAllServers(ctx context.Context, clusterURI string) ([]clusters.Server, error)
- func (s *Service) GetKubes(ctx context.Context, req *api.GetKubesRequest) (*clusters.GetKubesResponse, error)
- func (s *Service) GetRequestableRoles(ctx context.Context, req *api.GetRequestableRolesRequest) (*api.GetRequestableRolesResponse, error)
- func (s *Service) GetServers(ctx context.Context, req *api.GetServersRequest) (*clusters.GetServersResponse, error)
- func (s *Service) ListApps(ctx context.Context, clusterURI string) ([]clusters.App, error)
- func (s *Service) ListGateways() []gateway.Gateway
- func (s *Service) ListLeafClusters(ctx context.Context, uri string) ([]clusters.LeafCluster, error)
- func (s *Service) ListRootClusters(ctx context.Context) ([]*clusters.Cluster, error)
- func (s *Service) RemoveCluster(ctx context.Context, uri string) error
- func (s *Service) RemoveGateway(gatewayURI string) error
- func (s *Service) ResolveCluster(uri string) (*clusters.Cluster, error)
- func (s *Service) RestartGateway(ctx context.Context, gatewayURI string) error
- func (s *Service) ReviewAccessRequest(ctx context.Context, req *api.ReviewAccessRequestRequest) (*clusters.AccessRequest, error)
- func (s *Service) SetGatewayLocalPort(gatewayURI, localPort string) (*gateway.Gateway, error)
- func (s *Service) SetGatewayTargetSubresourceName(gatewayURI, targetSubresourceName string) (*gateway.Gateway, error)
- func (s *Service) Stop()
- func (s *Service) TransferFile(ctx context.Context, request *api.FileTransferRequest, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Storage is a storage service that reads/writes to tsh profiles Storage *clusters.Storage // Log is a component logger Log *logrus.Entry GatewayCreator GatewayCreator TCPPortAllocator gateway.TCPPortAllocator }
Config is the cluster service config
func (*Config) CheckAndSetDefaults ¶
CheckAndSetDefaults checks the configuration for its validity and sets default values if needed
type CreateGatewayParams ¶
type GatewayCreator ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the daemon service
func (*Service) AddCluster ¶
func (s *Service) AddCluster(ctx context.Context, webProxyAddress string) (*clusters.Cluster, error)
AddCluster adds a cluster
func (*Service) AssumeRole ¶
func (*Service) ClusterLogout ¶
ClusterLogout logs a user out from the cluster
func (*Service) CreateAccessRequest ¶
func (s *Service) CreateAccessRequest(ctx context.Context, req *api.CreateAccessRequestRequest) (*clusters.AccessRequest, error)
CreateAccessRequest creates an access request
func (*Service) CreateGateway ¶
func (s *Service) CreateGateway(ctx context.Context, params CreateGatewayParams) (*gateway.Gateway, error)
CreateGateway creates a gateway to given targetURI
func (*Service) DeleteAccessRequest ¶
func (*Service) GetAccessRequest ¶
func (s *Service) GetAccessRequest(ctx context.Context, req *api.GetAccessRequestRequest) ([]clusters.AccessRequest, error)
GetAccessRequest returns AccessRequests filtered by ID
func (*Service) GetAccessRequests ¶
func (s *Service) GetAccessRequests(ctx context.Context, req *api.GetAccessRequestsRequest) ([]clusters.AccessRequest, error)
GetAccessRequests returns all access requests with filtered input
func (*Service) GetAllKubes ¶
GetAllKubes lists kubernetes clusters
func (*Service) GetAllServers ¶
GetAllServers returns a full list of nodes without pagination or sorting.
func (*Service) GetKubes ¶
func (s *Service) GetKubes(ctx context.Context, req *api.GetKubesRequest) (*clusters.GetKubesResponse, error)
GetKubes accepts parameterized input to enable searching, sorting, and pagination.
func (*Service) GetRequestableRoles ¶
func (s *Service) GetRequestableRoles(ctx context.Context, req *api.GetRequestableRolesRequest) (*api.GetRequestableRolesResponse, error)
func (*Service) GetServers ¶
func (s *Service) GetServers(ctx context.Context, req *api.GetServersRequest) (*clusters.GetServersResponse, error)
GetServers accepts parameterized input to enable searching, sorting, and pagination.
func (*Service) ListGateways ¶
ListGateways lists gateways
func (*Service) ListLeafClusters ¶
ListLeafClusters returns a list of leaf clusters
func (*Service) ListRootClusters ¶
ListRootClusters returns a list of root clusters
func (*Service) RemoveCluster ¶
RemoveCluster removes cluster
func (*Service) RemoveGateway ¶
RemoveGateway removes cluster gateway
func (*Service) ResolveCluster ¶
ResolveCluster resolves a cluster by URI
func (*Service) RestartGateway ¶
RestartGateway stops a gateway and starts a new one with identical parameters. It also keeps the original URI so that from the perspective of Connect it's still the same gateway but with fresh certs.
func (*Service) ReviewAccessRequest ¶
func (s *Service) ReviewAccessRequest(ctx context.Context, req *api.ReviewAccessRequestRequest) (*clusters.AccessRequest, error)
func (*Service) SetGatewayLocalPort ¶
SetGatewayLocalPort creates a new gateway with the given port, swaps it with the old gateway under the same URI in s.gateways and then closes the old gateway. It doesn't fetch a fresh db cert.
If gateway.NewWithLocalPort fails it's imperative that the current gateway is kept intact. This way if the user attempts to change the port to one that cannot be obtained, they're able to correct that mistake and choose a different port.
SetGatewayLocalPort is a noop if port is equal to the existing port.
func (*Service) SetGatewayTargetSubresourceName ¶
func (s *Service) SetGatewayTargetSubresourceName(gatewayURI, targetSubresourceName string) (*gateway.Gateway, error)
SetGatewayTargetSubresourceName updates the TargetSubresourceName field of a gateway stored in s.gateways.
func (*Service) TransferFile ¶
func (s *Service) TransferFile(ctx context.Context, request *api.FileTransferRequest, sendProgress clusters.FileTransferProgressSender) error