pubsub_api

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DRPCRegisterPubSubService

func DRPCRegisterPubSubService(mux drpc.Mux, impl DRPCPubSubServiceServer) error

Types

type DRPCPubSubServiceClient

type DRPCPubSubServiceClient interface {
	DRPCConn() drpc.Conn

	Subscribe(ctx context.Context) (DRPCPubSubService_SubscribeClient, error)
}

func NewDRPCPubSubServiceClient

func NewDRPCPubSubServiceClient(cc drpc.Conn) DRPCPubSubServiceClient

type DRPCPubSubServiceDescription

type DRPCPubSubServiceDescription struct{}

func (DRPCPubSubServiceDescription) Method

func (DRPCPubSubServiceDescription) Method(n int) (string, drpc.Encoding, drpc.Receiver, interface{}, bool)

func (DRPCPubSubServiceDescription) NumMethods

func (DRPCPubSubServiceDescription) NumMethods() int

type DRPCPubSubServiceServer

type DRPCPubSubServiceServer interface {
	Subscribe(DRPCPubSubService_SubscribeStream) error
}

type DRPCPubSubServiceUnimplementedServer

type DRPCPubSubServiceUnimplementedServer struct{}

func (*DRPCPubSubServiceUnimplementedServer) Subscribe

type DRPCPubSubService_SubscribeClient

type DRPCPubSubService_SubscribeClient interface {
	drpc.Stream
	Send(*SubscribeRequest) error
	Recv() (*SubscribeResponse, error)
}

type DRPCPubSubService_SubscribeStream

type DRPCPubSubService_SubscribeStream interface {
	drpc.Stream
	Send(*SubscribeResponse) error
	Recv() (*SubscribeRequest, error)
}

type IncomingMessage

type IncomingMessage struct {
	// FromPeerId is the peer identifier of the sender.
	FromPeerId string `protobuf:"bytes,1,opt,name=from_peer_id,json=fromPeerId,proto3" json:"from_peer_id,omitempty"`
	// Authenticated indicates if the message is verified to be from the sender.
	Authenticated bool `protobuf:"varint,2,opt,name=authenticated,proto3" json:"authenticated,omitempty"`
	// Data is the inner data.
	Data                 []byte   `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

IncomingMessage implements Message with a proto object.

func (*IncomingMessage) Descriptor

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

func (*IncomingMessage) GetAuthenticated

func (m *IncomingMessage) GetAuthenticated() bool

func (*IncomingMessage) GetData

func (m *IncomingMessage) GetData() []byte

func (*IncomingMessage) GetFromPeerId

func (m *IncomingMessage) GetFromPeerId() string

func (*IncomingMessage) ProtoMessage

func (*IncomingMessage) ProtoMessage()

func (*IncomingMessage) Reset

func (m *IncomingMessage) Reset()

func (*IncomingMessage) String

func (m *IncomingMessage) String() string

func (*IncomingMessage) XXX_DiscardUnknown

func (m *IncomingMessage) XXX_DiscardUnknown()

func (*IncomingMessage) XXX_Marshal

func (m *IncomingMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*IncomingMessage) XXX_Merge

func (m *IncomingMessage) XXX_Merge(src proto.Message)

func (*IncomingMessage) XXX_Size

func (m *IncomingMessage) XXX_Size() int

func (*IncomingMessage) XXX_Unmarshal

func (m *IncomingMessage) XXX_Unmarshal(b []byte) error

type OutgoingStatus

type OutgoingStatus struct {
	// Identifier is the request-provided identifier for the message.
	Identifier uint32 `protobuf:"varint,1,opt,name=identifier,proto3" json:"identifier,omitempty"`
	// Sent indicates if the message was sent.
	Sent                 bool     `protobuf:"varint,2,opt,name=sent,proto3" json:"sent,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

OutgoingStatus is status of an outgoing message.

func (*OutgoingStatus) Descriptor

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

func (*OutgoingStatus) GetIdentifier

func (m *OutgoingStatus) GetIdentifier() uint32

func (*OutgoingStatus) GetSent

func (m *OutgoingStatus) GetSent() bool

func (*OutgoingStatus) ProtoMessage

func (*OutgoingStatus) ProtoMessage()

func (*OutgoingStatus) Reset

func (m *OutgoingStatus) Reset()

func (*OutgoingStatus) String

func (m *OutgoingStatus) String() string

func (*OutgoingStatus) XXX_DiscardUnknown

func (m *OutgoingStatus) XXX_DiscardUnknown()

func (*OutgoingStatus) XXX_Marshal

func (m *OutgoingStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*OutgoingStatus) XXX_Merge

func (m *OutgoingStatus) XXX_Merge(src proto.Message)

func (*OutgoingStatus) XXX_Size

func (m *OutgoingStatus) XXX_Size() int

func (*OutgoingStatus) XXX_Unmarshal

func (m *OutgoingStatus) XXX_Unmarshal(b []byte) error

type PublishRequest

type PublishRequest struct {
	// Data is the published data.
	Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	// Identifier is a uint32 identifier to use for outgoing status.
	// If zero, no outgoing status response will be sent.
	Identifier           uint32   `protobuf:"varint,2,opt,name=identifier,proto3" json:"identifier,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

PublishRequest is a message published via the subscribe channel.

func (*PublishRequest) Descriptor

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

func (*PublishRequest) GetData

func (m *PublishRequest) GetData() []byte

func (*PublishRequest) GetIdentifier

func (m *PublishRequest) GetIdentifier() uint32

func (*PublishRequest) ProtoMessage

func (*PublishRequest) ProtoMessage()

func (*PublishRequest) Reset

func (m *PublishRequest) Reset()

func (*PublishRequest) String

func (m *PublishRequest) String() string

func (*PublishRequest) XXX_DiscardUnknown

func (m *PublishRequest) XXX_DiscardUnknown()

func (*PublishRequest) XXX_Marshal

func (m *PublishRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PublishRequest) XXX_Merge

func (m *PublishRequest) XXX_Merge(src proto.Message)

func (*PublishRequest) XXX_Size

func (m *PublishRequest) XXX_Size() int

func (*PublishRequest) XXX_Unmarshal

func (m *PublishRequest) XXX_Unmarshal(b []byte) error

type SubscribeRequest

type SubscribeRequest struct {
	// ChannelId is the channel id to subscribe to.
	// Must be sent before / with publish.
	// Cannot change the channel ID after first transmission.
	ChannelId string `protobuf:"bytes,1,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"`
	// PeerId is the peer identifier of the publisher/subscriber.
	// The peer ID will be used to acquire the peer private key.
	PeerId string `protobuf:"bytes,2,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"`
	// PrivKeyPem is an alternate to PeerId, specify private key inline.
	// Overrides PeerId if set.
	PrivKeyPem string `protobuf:"bytes,3,opt,name=priv_key_pem,json=privKeyPem,proto3" json:"priv_key_pem,omitempty"`
	// PublishRequest contains a publish message request.
	PublishRequest       *PublishRequest `protobuf:"bytes,4,opt,name=publish_request,json=publishRequest,proto3" json:"publish_request,omitempty"`
	XXX_NoUnkeyedLiteral struct{}        `json:"-"`
	XXX_unrecognized     []byte          `json:"-"`
	XXX_sizecache        int32           `json:"-"`
}

SubcribeRequest is a pubsub subscription request message.

func (*SubscribeRequest) Descriptor

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

func (*SubscribeRequest) GetChannelId

func (m *SubscribeRequest) GetChannelId() string

func (*SubscribeRequest) GetPeerId

func (m *SubscribeRequest) GetPeerId() string

func (*SubscribeRequest) GetPrivKeyPem

func (m *SubscribeRequest) GetPrivKeyPem() string

func (*SubscribeRequest) GetPublishRequest

func (m *SubscribeRequest) GetPublishRequest() *PublishRequest

func (*SubscribeRequest) ProtoMessage

func (*SubscribeRequest) ProtoMessage()

func (*SubscribeRequest) Reset

func (m *SubscribeRequest) Reset()

func (*SubscribeRequest) String

func (m *SubscribeRequest) String() string

func (*SubscribeRequest) XXX_DiscardUnknown

func (m *SubscribeRequest) XXX_DiscardUnknown()

func (*SubscribeRequest) XXX_Marshal

func (m *SubscribeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SubscribeRequest) XXX_Merge

func (m *SubscribeRequest) XXX_Merge(src proto.Message)

func (*SubscribeRequest) XXX_Size

func (m *SubscribeRequest) XXX_Size() int

func (*SubscribeRequest) XXX_Unmarshal

func (m *SubscribeRequest) XXX_Unmarshal(b []byte) error

type SubscribeResponse

type SubscribeResponse struct {
	// IncomingMessage is an incoming message.
	IncomingMessage *IncomingMessage `protobuf:"bytes,1,opt,name=incoming_message,json=incomingMessage,proto3" json:"incoming_message,omitempty"`
	// OutgoingStatus is status of an outgoing message.
	// Sent when a Publish request finishes.
	OutgoingStatus *OutgoingStatus `protobuf:"bytes,2,opt,name=outgoing_status,json=outgoingStatus,proto3" json:"outgoing_status,omitempty"`
	// SubscriptionStatus is the status of the subscription
	SubscriptionStatus   *SubscriptionStatus `protobuf:"bytes,3,opt,name=subscription_status,json=subscriptionStatus,proto3" json:"subscription_status,omitempty"`
	XXX_NoUnkeyedLiteral struct{}            `json:"-"`
	XXX_unrecognized     []byte              `json:"-"`
	XXX_sizecache        int32               `json:"-"`
}

SubcribeResponse is a pubsub subscription response message.

func (*SubscribeResponse) Descriptor

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

func (*SubscribeResponse) GetIncomingMessage

func (m *SubscribeResponse) GetIncomingMessage() *IncomingMessage

func (*SubscribeResponse) GetOutgoingStatus

func (m *SubscribeResponse) GetOutgoingStatus() *OutgoingStatus

func (*SubscribeResponse) GetSubscriptionStatus

func (m *SubscribeResponse) GetSubscriptionStatus() *SubscriptionStatus

func (*SubscribeResponse) ProtoMessage

func (*SubscribeResponse) ProtoMessage()

func (*SubscribeResponse) Reset

func (m *SubscribeResponse) Reset()

func (*SubscribeResponse) String

func (m *SubscribeResponse) String() string

func (*SubscribeResponse) XXX_DiscardUnknown

func (m *SubscribeResponse) XXX_DiscardUnknown()

func (*SubscribeResponse) XXX_Marshal

func (m *SubscribeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SubscribeResponse) XXX_Merge

func (m *SubscribeResponse) XXX_Merge(src proto.Message)

func (*SubscribeResponse) XXX_Size

func (m *SubscribeResponse) XXX_Size() int

func (*SubscribeResponse) XXX_Unmarshal

func (m *SubscribeResponse) XXX_Unmarshal(b []byte) error

type SubscriptionStatus

type SubscriptionStatus struct {
	// Subscribed indicates the subscription is established.
	Subscribed           bool     `protobuf:"varint,1,opt,name=subscribed,proto3" json:"subscribed,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

SubscripionStatus is the status of the subscription handle.

func (*SubscriptionStatus) Descriptor

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

func (*SubscriptionStatus) GetSubscribed

func (m *SubscriptionStatus) GetSubscribed() bool

func (*SubscriptionStatus) ProtoMessage

func (*SubscriptionStatus) ProtoMessage()

func (*SubscriptionStatus) Reset

func (m *SubscriptionStatus) Reset()

func (*SubscriptionStatus) String

func (m *SubscriptionStatus) String() string

func (*SubscriptionStatus) XXX_DiscardUnknown

func (m *SubscriptionStatus) XXX_DiscardUnknown()

func (*SubscriptionStatus) XXX_Marshal

func (m *SubscriptionStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SubscriptionStatus) XXX_Merge

func (m *SubscriptionStatus) XXX_Merge(src proto.Message)

func (*SubscriptionStatus) XXX_Size

func (m *SubscriptionStatus) XXX_Size() int

func (*SubscriptionStatus) XXX_Unmarshal

func (m *SubscriptionStatus) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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