shipyard

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 28, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ServiceType_name = map[int32]string{
		0: "LOCAL",
		1: "REMOTE",
	}
	ServiceType_value = map[string]int32{
		"LOCAL":  0,
		"REMOTE": 1,
	}
)

Enum value maps for ServiceType.

View Source
var (
	ServiceStatus_name = map[int32]string{
		0: "PENDING",
		1: "COMPLETE",
		2: "ERROR",
	}
	ServiceStatus_value = map[string]int32{
		"PENDING":  0,
		"COMPLETE": 1,
		"ERROR":    2,
	}
)

Enum value maps for ServiceStatus.

View Source
var File_server_proto protoreflect.FileDescriptor

Functions

func RegisterRemoteConnectionServer

func RegisterRemoteConnectionServer(s *grpc.Server, srv RemoteConnectionServer)

Types

type Closed added in v0.0.2

type Closed struct {
	// contains filtered or unexported fields
}

Closed is sent when a remote connection is closed

func (*Closed) Descriptor deprecated added in v0.0.2

func (*Closed) Descriptor() ([]byte, []int)

Deprecated: Use Closed.ProtoReflect.Descriptor instead.

func (*Closed) ProtoMessage added in v0.0.2

func (*Closed) ProtoMessage()

func (*Closed) ProtoReflect added in v0.0.2

func (x *Closed) ProtoReflect() protoreflect.Message

func (*Closed) Reset added in v0.0.2

func (x *Closed) Reset()

func (*Closed) String added in v0.0.2

func (x *Closed) String() string

type Data added in v0.0.2

type Data struct {
	Id   int32  `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

Data is a message containing data for a connection

func (*Data) Descriptor deprecated added in v0.0.2

func (*Data) Descriptor() ([]byte, []int)

Deprecated: Use Data.ProtoReflect.Descriptor instead.

func (*Data) GetData added in v0.0.2

func (x *Data) GetData() []byte

func (*Data) GetId added in v0.0.16

func (x *Data) GetId() int32

func (*Data) ProtoMessage added in v0.0.2

func (*Data) ProtoMessage()

func (*Data) ProtoReflect added in v0.0.2

func (x *Data) ProtoReflect() protoreflect.Message

func (*Data) Reset added in v0.0.2

func (x *Data) Reset()

func (*Data) String added in v0.0.2

func (x *Data) String() string

type DestroyRequest

type DestroyRequest struct {
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*DestroyRequest) Descriptor deprecated

func (*DestroyRequest) Descriptor() ([]byte, []int)

Deprecated: Use DestroyRequest.ProtoReflect.Descriptor instead.

func (*DestroyRequest) GetId

func (x *DestroyRequest) GetId() string

func (*DestroyRequest) ProtoMessage

func (*DestroyRequest) ProtoMessage()

func (*DestroyRequest) ProtoReflect added in v0.0.2

func (x *DestroyRequest) ProtoReflect() protoreflect.Message

func (*DestroyRequest) Reset

func (x *DestroyRequest) Reset()

func (*DestroyRequest) String

func (x *DestroyRequest) String() string

type ExposeRequest

type ExposeRequest struct {
	Service *Service `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"`
	// contains filtered or unexported fields
}

ExposeRequest is a message indicating that a new TCP Listener should be created ExposeRequests will be replayed when a connection is re-opened

func (*ExposeRequest) Descriptor deprecated

func (*ExposeRequest) Descriptor() ([]byte, []int)

Deprecated: Use ExposeRequest.ProtoReflect.Descriptor instead.

func (*ExposeRequest) GetService added in v0.0.2

func (x *ExposeRequest) GetService() *Service

func (*ExposeRequest) ProtoMessage

func (*ExposeRequest) ProtoMessage()

func (*ExposeRequest) ProtoReflect added in v0.0.2

func (x *ExposeRequest) ProtoReflect() protoreflect.Message

func (*ExposeRequest) Reset

func (x *ExposeRequest) Reset()

func (*ExposeRequest) String

func (x *ExposeRequest) String() string

type ExposeResponse

type ExposeResponse struct {
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // id of the service
	// contains filtered or unexported fields
}

func (*ExposeResponse) Descriptor deprecated

func (*ExposeResponse) Descriptor() ([]byte, []int)

Deprecated: Use ExposeResponse.ProtoReflect.Descriptor instead.

func (*ExposeResponse) GetId

func (x *ExposeResponse) GetId() string

func (*ExposeResponse) ProtoMessage

func (*ExposeResponse) ProtoMessage()

func (*ExposeResponse) ProtoReflect added in v0.0.2

func (x *ExposeResponse) ProtoReflect() protoreflect.Message

func (*ExposeResponse) Reset

func (x *ExposeResponse) Reset()

func (*ExposeResponse) String

func (x *ExposeResponse) String() string

type ListResponse added in v0.0.2

type ListResponse struct {
	Services []*Service `protobuf:"bytes,1,rep,name=services,proto3" json:"services,omitempty"`
	// contains filtered or unexported fields
}

func (*ListResponse) Descriptor deprecated added in v0.0.2

func (*ListResponse) Descriptor() ([]byte, []int)

Deprecated: Use ListResponse.ProtoReflect.Descriptor instead.

func (*ListResponse) GetServices added in v0.0.2

func (x *ListResponse) GetServices() []*Service

func (*ListResponse) ProtoMessage added in v0.0.2

func (*ListResponse) ProtoMessage()

func (*ListResponse) ProtoReflect added in v0.0.2

func (x *ListResponse) ProtoReflect() protoreflect.Message

func (*ListResponse) Reset added in v0.0.2

func (x *ListResponse) Reset()

func (*ListResponse) String added in v0.0.2

func (x *ListResponse) String() string

type NewConnection added in v0.0.2

type NewConnection struct {
	// contains filtered or unexported fields
}

Indicates that a new connection has been received

func (*NewConnection) Descriptor deprecated added in v0.0.2

func (*NewConnection) Descriptor() ([]byte, []int)

Deprecated: Use NewConnection.ProtoReflect.Descriptor instead.

func (*NewConnection) ProtoMessage added in v0.0.2

func (*NewConnection) ProtoMessage()

func (*NewConnection) ProtoReflect added in v0.0.2

func (x *NewConnection) ProtoReflect() protoreflect.Message

func (*NewConnection) Reset added in v0.0.2

func (x *NewConnection) Reset()

func (*NewConnection) String added in v0.0.2

func (x *NewConnection) String() string

type NullMessage added in v0.0.2

type NullMessage struct {
	// contains filtered or unexported fields
}

Expose remote service - allow traffic on remote server 8081 to be exposed locally at 8080

  1. ExposeRequest called on local server name = service name serverAddr = http://remote.server localPort = 8080 remotePort = 8081 type = remote
  2. Call CreateListener on local server to setup a TCP listener name = service name port = 8080
  3. OpenStream called on remote if no stream exists

func (*NullMessage) Descriptor deprecated added in v0.0.2

func (*NullMessage) Descriptor() ([]byte, []int)

Deprecated: Use NullMessage.ProtoReflect.Descriptor instead.

func (*NullMessage) ProtoMessage added in v0.0.2

func (*NullMessage) ProtoMessage()

func (*NullMessage) ProtoReflect added in v0.0.2

func (x *NullMessage) ProtoReflect() protoreflect.Message

func (*NullMessage) Reset added in v0.0.2

func (x *NullMessage) Reset()

func (*NullMessage) String added in v0.0.2

func (x *NullMessage) String() string

type OpenData

type OpenData struct {
	ServiceId    string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"`
	ConnectionId string `protobuf:"bytes,2,opt,name=connection_id,json=connectionId,proto3" json:"connection_id,omitempty"`
	// different messages can be sent to the stream
	//
	// Types that are assignable to Message:
	//	*OpenData_Data
	//	*OpenData_Expose
	//	*OpenData_Destroy
	//	*OpenData_NewConnection
	//	*OpenData_WriteDone
	//	*OpenData_ReadDone
	//	*OpenData_Closed
	//	*OpenData_StatusUpdate
	//	*OpenData_Ping
	//	*OpenData_Error
	Message isOpenData_Message `protobuf_oneof:"message"`
	// contains filtered or unexported fields
}

func (*OpenData) Descriptor deprecated

func (*OpenData) Descriptor() ([]byte, []int)

Deprecated: Use OpenData.ProtoReflect.Descriptor instead.

func (*OpenData) GetClosed added in v0.0.2

func (x *OpenData) GetClosed() *Closed

func (*OpenData) GetConnectionId

func (x *OpenData) GetConnectionId() string

func (*OpenData) GetData

func (x *OpenData) GetData() *Data

func (*OpenData) GetDestroy added in v0.0.2

func (x *OpenData) GetDestroy() *DestroyRequest

func (*OpenData) GetError added in v0.0.2

func (x *OpenData) GetError() *status.Status

func (*OpenData) GetExpose added in v0.0.2

func (x *OpenData) GetExpose() *ExposeRequest

func (*OpenData) GetMessage added in v0.0.2

func (m *OpenData) GetMessage() isOpenData_Message

func (*OpenData) GetNewConnection added in v0.0.2

func (x *OpenData) GetNewConnection() *NewConnection

func (*OpenData) GetPing added in v0.0.3

func (x *OpenData) GetPing() *NullMessage

func (*OpenData) GetReadDone added in v0.0.2

func (x *OpenData) GetReadDone() *ReadDone

func (*OpenData) GetServiceId

func (x *OpenData) GetServiceId() string

func (*OpenData) GetStatusUpdate added in v0.0.2

func (x *OpenData) GetStatusUpdate() *StatusUpdate

func (*OpenData) GetWriteDone added in v0.0.2

func (x *OpenData) GetWriteDone() *WriteDone

func (*OpenData) ProtoMessage

func (*OpenData) ProtoMessage()

func (*OpenData) ProtoReflect added in v0.0.2

func (x *OpenData) ProtoReflect() protoreflect.Message

func (*OpenData) Reset

func (x *OpenData) Reset()

func (*OpenData) String

func (x *OpenData) String() string

type OpenData_Closed added in v0.0.2

type OpenData_Closed struct {
	Closed *Closed `protobuf:"bytes,9,opt,name=closed,proto3,oneof"`
}

type OpenData_Data added in v0.0.2

type OpenData_Data struct {
	Data *Data `protobuf:"bytes,3,opt,name=data,proto3,oneof"`
}

type OpenData_Destroy added in v0.0.2

type OpenData_Destroy struct {
	Destroy *DestroyRequest `protobuf:"bytes,5,opt,name=destroy,proto3,oneof"`
}

type OpenData_Error added in v0.0.2

type OpenData_Error struct {
	Error *status.Status `protobuf:"bytes,12,opt,name=error,proto3,oneof"`
}

type OpenData_Expose added in v0.0.2

type OpenData_Expose struct {
	Expose *ExposeRequest `protobuf:"bytes,4,opt,name=expose,proto3,oneof"`
}

type OpenData_NewConnection added in v0.0.2

type OpenData_NewConnection struct {
	NewConnection *NewConnection `protobuf:"bytes,6,opt,name=new_connection,json=newConnection,proto3,oneof"`
}

type OpenData_Ping added in v0.0.3

type OpenData_Ping struct {
	Ping *NullMessage `protobuf:"bytes,11,opt,name=ping,proto3,oneof"`
}

type OpenData_ReadDone added in v0.0.2

type OpenData_ReadDone struct {
	ReadDone *ReadDone `protobuf:"bytes,8,opt,name=read_done,json=readDone,proto3,oneof"`
}

type OpenData_StatusUpdate added in v0.0.2

type OpenData_StatusUpdate struct {
	StatusUpdate *StatusUpdate `protobuf:"bytes,10,opt,name=status_update,json=statusUpdate,proto3,oneof"`
}

type OpenData_WriteDone added in v0.0.2

type OpenData_WriteDone struct {
	WriteDone *WriteDone `protobuf:"bytes,7,opt,name=write_done,json=writeDone,proto3,oneof"`
}

type ReadDone added in v0.0.2

type ReadDone struct {
	// contains filtered or unexported fields
}

ReadDone is sent when all data has been read from a socket the next step is to write a reply

func (*ReadDone) Descriptor deprecated added in v0.0.2

func (*ReadDone) Descriptor() ([]byte, []int)

Deprecated: Use ReadDone.ProtoReflect.Descriptor instead.

func (*ReadDone) ProtoMessage added in v0.0.2

func (*ReadDone) ProtoMessage()

func (*ReadDone) ProtoReflect added in v0.0.2

func (x *ReadDone) ProtoReflect() protoreflect.Message

func (*ReadDone) Reset added in v0.0.2

func (x *ReadDone) Reset()

func (*ReadDone) String added in v0.0.2

func (x *ReadDone) String() string

type RemoteConnectionClient

type RemoteConnectionClient interface {
	// Open a stream between two servers
	OpenStream(ctx context.Context, opts ...grpc.CallOption) (RemoteConnection_OpenStreamClient, error)
	// Open a new TCP port for the local service on the server and start listening
	ExposeService(ctx context.Context, in *ExposeRequest, opts ...grpc.CallOption) (*ExposeResponse, error)
	// Close the remote TCP port and remove all resources
	DestroyService(ctx context.Context, in *DestroyRequest, opts ...grpc.CallOption) (*NullMessage, error)
	// Close the remote TCP port and remove all resources
	ListServices(ctx context.Context, in *NullMessage, opts ...grpc.CallOption) (*ListResponse, error)
}

RemoteConnectionClient is the client API for RemoteConnection service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

type RemoteConnectionServer

type RemoteConnectionServer interface {
	// Open a stream between two servers
	OpenStream(RemoteConnection_OpenStreamServer) error
	// Open a new TCP port for the local service on the server and start listening
	ExposeService(context.Context, *ExposeRequest) (*ExposeResponse, error)
	// Close the remote TCP port and remove all resources
	DestroyService(context.Context, *DestroyRequest) (*NullMessage, error)
	// Close the remote TCP port and remove all resources
	ListServices(context.Context, *NullMessage) (*ListResponse, error)
}

RemoteConnectionServer is the server API for RemoteConnection service.

type RemoteConnection_OpenStreamClient

type RemoteConnection_OpenStreamClient interface {
	Send(*OpenData) error
	Recv() (*OpenData, error)
	grpc.ClientStream
}

type RemoteConnection_OpenStreamServer

type RemoteConnection_OpenStreamServer interface {
	Send(*OpenData) error
	Recv() (*OpenData, error)
	grpc.ServerStream
}

type Service added in v0.0.2

type Service struct {
	Id                  string        `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`                                   // id for the service
	Name                string        `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`                               // name of the service
	RemoteConnectorAddr string        `protobuf:"bytes,3,opt,name=remoteConnectorAddr,proto3" json:"remoteConnectorAddr,omitempty"` // address of the remote component for the service
	DestinationAddr     string        `protobuf:"bytes,4,opt,name=destinationAddr,proto3" json:"destinationAddr,omitempty"`         // address of the service being exposed
	SourcePort          int32         `protobuf:"varint,5,opt,name=sourcePort,proto3" json:"sourcePort,omitempty"`                  // local port to expose on
	Type                ServiceType   `protobuf:"varint,6,opt,name=type,proto3,enum=shipyard.ServiceType" json:"type,omitempty"`    // is the service running on this machine or the remote machine
	Status              ServiceStatus `protobuf:"varint,7,opt,name=status,proto3,enum=shipyard.ServiceStatus" json:"status,omitempty"`
	// contains filtered or unexported fields
}

func (*Service) Descriptor deprecated added in v0.0.2

func (*Service) Descriptor() ([]byte, []int)

Deprecated: Use Service.ProtoReflect.Descriptor instead.

func (*Service) GetDestinationAddr added in v0.0.2

func (x *Service) GetDestinationAddr() string

func (*Service) GetId added in v0.0.14

func (x *Service) GetId() string

func (*Service) GetName added in v0.0.2

func (x *Service) GetName() string

func (*Service) GetRemoteConnectorAddr added in v0.0.2

func (x *Service) GetRemoteConnectorAddr() string

func (*Service) GetSourcePort added in v0.0.2

func (x *Service) GetSourcePort() int32

func (*Service) GetStatus added in v0.0.2

func (x *Service) GetStatus() ServiceStatus

func (*Service) GetType added in v0.0.2

func (x *Service) GetType() ServiceType

func (*Service) ProtoMessage added in v0.0.2

func (*Service) ProtoMessage()

func (*Service) ProtoReflect added in v0.0.2

func (x *Service) ProtoReflect() protoreflect.Message

func (*Service) Reset added in v0.0.2

func (x *Service) Reset()

func (*Service) String added in v0.0.2

func (x *Service) String() string

type ServiceStatus added in v0.0.2

type ServiceStatus int32
const (
	ServiceStatus_PENDING  ServiceStatus = 0 // Service is pending setup
	ServiceStatus_COMPLETE ServiceStatus = 1 // Service has been setup
	ServiceStatus_ERROR    ServiceStatus = 2 // Service has errored when attempting setup
)

func (ServiceStatus) Descriptor added in v0.0.2

func (ServiceStatus) Enum added in v0.0.2

func (x ServiceStatus) Enum() *ServiceStatus

func (ServiceStatus) EnumDescriptor deprecated added in v0.0.2

func (ServiceStatus) EnumDescriptor() ([]byte, []int)

Deprecated: Use ServiceStatus.Descriptor instead.

func (ServiceStatus) Number added in v0.0.2

func (ServiceStatus) String added in v0.0.2

func (x ServiceStatus) String() string

func (ServiceStatus) Type added in v0.0.2

type ServiceType

type ServiceType int32
const (
	ServiceType_LOCAL  ServiceType = 0 // Service exists on local component
	ServiceType_REMOTE ServiceType = 1 // Service exists  on remote component
)

func (ServiceType) Descriptor added in v0.0.2

func (ServiceType) Enum added in v0.0.2

func (x ServiceType) Enum() *ServiceType

func (ServiceType) EnumDescriptor deprecated

func (ServiceType) EnumDescriptor() ([]byte, []int)

Deprecated: Use ServiceType.Descriptor instead.

func (ServiceType) Number added in v0.0.2

func (x ServiceType) Number() protoreflect.EnumNumber

func (ServiceType) String

func (x ServiceType) String() string

func (ServiceType) Type added in v0.0.2

type StatusUpdate added in v0.0.2

type StatusUpdate struct {
	Status  ServiceStatus `protobuf:"varint,1,opt,name=status,proto3,enum=shipyard.ServiceStatus" json:"status,omitempty"`
	Message string        `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

StatusUpdate is sent by the remote connector when the status of a service changes

func (*StatusUpdate) Descriptor deprecated added in v0.0.2

func (*StatusUpdate) Descriptor() ([]byte, []int)

Deprecated: Use StatusUpdate.ProtoReflect.Descriptor instead.

func (*StatusUpdate) GetMessage added in v0.0.2

func (x *StatusUpdate) GetMessage() string

func (*StatusUpdate) GetStatus added in v0.0.2

func (x *StatusUpdate) GetStatus() ServiceStatus

func (*StatusUpdate) ProtoMessage added in v0.0.2

func (*StatusUpdate) ProtoMessage()

func (*StatusUpdate) ProtoReflect added in v0.0.2

func (x *StatusUpdate) ProtoReflect() protoreflect.Message

func (*StatusUpdate) Reset added in v0.0.2

func (x *StatusUpdate) Reset()

func (*StatusUpdate) String added in v0.0.2

func (x *StatusUpdate) String() string

type UnimplementedRemoteConnectionServer

type UnimplementedRemoteConnectionServer struct {
}

UnimplementedRemoteConnectionServer can be embedded to have forward compatible implementations.

func (*UnimplementedRemoteConnectionServer) DestroyService

func (*UnimplementedRemoteConnectionServer) ExposeService

func (*UnimplementedRemoteConnectionServer) ListServices added in v0.0.2

func (*UnimplementedRemoteConnectionServer) OpenStream

type WriteDone added in v0.0.2

type WriteDone struct {
	// contains filtered or unexported fields
}

WriteDone is sent when writing to a socket has been completed the next step is to read a reply

func (*WriteDone) Descriptor deprecated added in v0.0.2

func (*WriteDone) Descriptor() ([]byte, []int)

Deprecated: Use WriteDone.ProtoReflect.Descriptor instead.

func (*WriteDone) ProtoMessage added in v0.0.2

func (*WriteDone) ProtoMessage()

func (*WriteDone) ProtoReflect added in v0.0.2

func (x *WriteDone) ProtoReflect() protoreflect.Message

func (*WriteDone) Reset added in v0.0.2

func (x *WriteDone) Reset()

func (*WriteDone) String added in v0.0.2

func (x *WriteDone) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL