Documentation
¶
Overview ¶
Package api pkg/deployment/tps/api/api.go c2-net-transport
Package api pkg/deployment/tps/api/endpoints.go c2-net-transport
Package api pkg/deployment/tps/api/rpc_gateway.go c2-net-transport
Package api pkg/deployment/tps/api/utils.go c2-net-transport
Index ¶
- Variables
- type API
- type Error
- type GetTransportsRequest
- type GetTransportsResponse
- type HealthCheckArgs
- type HealthCheckReply
- type RemoveTransportRequest
- type SetupRPCGateway
- func (g *SetupRPCGateway) AddTransport(req *TransportSetupRequest, reply *TransportSetupResponse) error
- func (g *SetupRPCGateway) GetTransports(req *GetTransportsRequest, reply *GetTransportsResponse) error
- func (g *SetupRPCGateway) HealthCheck(_ *HealthCheckArgs, reply *HealthCheckReply) error
- func (g *SetupRPCGateway) RemoveTransport(_ *RemoveTransportRequest, _ *struct{}) error
- type TransportRequest
- type TransportSetupRequest
- type TransportSetupResponse
- type UUIDRequest
Constants ¶
This section is empty.
Variables ¶
var ErrRemoteRemovalNotAllowed = errors.New("transport removal not allowed via remote interface")
ErrRemoteRemovalNotAllowed is returned when a remote caller tries to remove a transport.
Functions ¶
This section is empty.
Types ¶
type API ¶
API register all the API endpoints. It implements a net/http.Handler.
type Error ¶
type Error struct {
Error string `json:"error"`
}
Error is the object returned to the client when there's an error.
type GetTransportsRequest ¶
GetTransportsRequest is the input for GetTransports RPC.
type GetTransportsResponse ¶
type GetTransportsResponse struct {
Transports []TransportSetupResponse
}
GetTransportsResponse is the response for GetTransports RPC.
type HealthCheckArgs ¶
type HealthCheckArgs struct{}
HealthCheckArgs is an empty struct for the health check call.
type HealthCheckReply ¶
type HealthCheckReply struct {
Status string
}
HealthCheckReply is returned by the HealthCheck RPC method.
type RemoveTransportRequest ¶
RemoveTransportRequest is the input for RemoveTransport RPC.
type SetupRPCGateway ¶
type SetupRPCGateway struct {
// contains filtered or unexported fields
}
SetupRPCGateway handles RPC requests from remote visors over dmsg.
func (*SetupRPCGateway) AddTransport ¶
func (g *SetupRPCGateway) AddTransport(req *TransportSetupRequest, reply *TransportSetupResponse) error
AddTransport requests a transport be created on the target visor.
func (*SetupRPCGateway) GetTransports ¶
func (g *SetupRPCGateway) GetTransports(req *GetTransportsRequest, reply *GetTransportsResponse) error
GetTransports retrieves the list of transports from a target visor.
func (*SetupRPCGateway) HealthCheck ¶
func (g *SetupRPCGateway) HealthCheck(_ *HealthCheckArgs, reply *HealthCheckReply) error
HealthCheck tests if the setup node is responsive.
func (*SetupRPCGateway) RemoveTransport ¶
func (g *SetupRPCGateway) RemoveTransport(_ *RemoveTransportRequest, _ *struct{}) error
RemoveTransport is blocked for remote callers - transport removal only via local HTTP.
type TransportRequest ¶
type TransportRequest struct {
From cipher.PubKey `json:"from" validate:"required"`
To cipher.PubKey `json:"to" validate:"required"`
Type string `json:"type" validate:"required"`
}
TransportRequest specifies a transport between two nodes and its type
type TransportSetupRequest ¶
type TransportSetupRequest struct {
TargetPK cipher.PubKey // visor to add transport on
RemotePK cipher.PubKey // other transport edge
Type string // transport type
}
TransportSetupRequest is the input for AddTransport RPC.
type TransportSetupResponse ¶
type TransportSetupResponse struct {
ID uuid.UUID
Local cipher.PubKey
Remote cipher.PubKey
Type string
}
TransportSetupResponse is the response for AddTransport RPC. ID is uuid.UUID to match the gob-wire format used by the visor's embedded TPS gateway (pkg/visor TPSSetupResponse). Both listen on DmsgTransportSetupServicePort and a client that decodes into one shape cannot decode data serialized from the other, so the wire types MUST match.