pubsub_api

package
v0.30.6 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const SRPCPubSubServiceServiceID = "pubsub.api.PubSubService"

Variables

This section is empty.

Functions

func NewSRPCPubSubServiceHandler added in v0.7.2

func NewSRPCPubSubServiceHandler(impl SRPCPubSubServiceServer, serviceID string) srpc.Handler

NewSRPCPubSubServiceHandler constructs a new RPC handler. serviceID: if empty, uses default: pubsub.api.PubSubService

func SRPCRegisterPubSubService added in v0.3.0

func SRPCRegisterPubSubService(mux srpc.Mux, impl SRPCPubSubServiceServer) error

SRPCRegisterPubSubService registers the implementation with the mux. Uses the default serviceID: pubsub.api.PubSubService

Types

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:"fromPeerId,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"`
	// contains filtered or unexported fields
}

IncomingMessage implements Message with a proto object.

func (*IncomingMessage) CloneMessageVT added in v0.15.6

func (m *IncomingMessage) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*IncomingMessage) CloneVT added in v0.8.3

func (m *IncomingMessage) CloneVT() *IncomingMessage

func (*IncomingMessage) EqualMessageVT added in v0.15.6

func (this *IncomingMessage) EqualMessageVT(thatMsg any) bool

func (*IncomingMessage) EqualVT added in v0.3.0

func (this *IncomingMessage) EqualVT(that *IncomingMessage) bool

func (*IncomingMessage) GetAuthenticated

func (x *IncomingMessage) GetAuthenticated() bool

func (*IncomingMessage) GetData

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

func (*IncomingMessage) GetFromPeerId

func (x *IncomingMessage) GetFromPeerId() string

func (*IncomingMessage) MarshalJSON added in v0.29.0

func (x *IncomingMessage) MarshalJSON() ([]byte, error)

MarshalJSON marshals the IncomingMessage to JSON.

func (*IncomingMessage) MarshalProtoJSON added in v0.29.0

func (x *IncomingMessage) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the IncomingMessage message to JSON.

func (*IncomingMessage) MarshalProtoText added in v0.29.2

func (x *IncomingMessage) MarshalProtoText() string

func (*IncomingMessage) MarshalToSizedBufferVT added in v0.2.0

func (m *IncomingMessage) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*IncomingMessage) MarshalToVT added in v0.2.0

func (m *IncomingMessage) MarshalToVT(dAtA []byte) (int, error)

func (*IncomingMessage) MarshalVT added in v0.2.0

func (m *IncomingMessage) MarshalVT() (dAtA []byte, err error)

func (*IncomingMessage) ProtoMessage

func (*IncomingMessage) ProtoMessage()

func (*IncomingMessage) Reset

func (x *IncomingMessage) Reset()

func (*IncomingMessage) SizeVT added in v0.2.0

func (m *IncomingMessage) SizeVT() (n int)

func (*IncomingMessage) String

func (x *IncomingMessage) String() string

func (*IncomingMessage) UnmarshalJSON added in v0.29.0

func (x *IncomingMessage) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the IncomingMessage from JSON.

func (*IncomingMessage) UnmarshalProtoJSON added in v0.29.0

func (x *IncomingMessage) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the IncomingMessage message from JSON.

func (*IncomingMessage) UnmarshalVT added in v0.2.0

func (m *IncomingMessage) UnmarshalVT(dAtA []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"`
	// contains filtered or unexported fields
}

OutgoingStatus is status of an outgoing message.

func (*OutgoingStatus) CloneMessageVT added in v0.15.6

func (m *OutgoingStatus) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*OutgoingStatus) CloneVT added in v0.8.3

func (m *OutgoingStatus) CloneVT() *OutgoingStatus

func (*OutgoingStatus) EqualMessageVT added in v0.15.6

func (this *OutgoingStatus) EqualMessageVT(thatMsg any) bool

func (*OutgoingStatus) EqualVT added in v0.3.0

func (this *OutgoingStatus) EqualVT(that *OutgoingStatus) bool

func (*OutgoingStatus) GetIdentifier

func (x *OutgoingStatus) GetIdentifier() uint32

func (*OutgoingStatus) GetSent

func (x *OutgoingStatus) GetSent() bool

func (*OutgoingStatus) MarshalJSON added in v0.29.0

func (x *OutgoingStatus) MarshalJSON() ([]byte, error)

MarshalJSON marshals the OutgoingStatus to JSON.

func (*OutgoingStatus) MarshalProtoJSON added in v0.29.0

func (x *OutgoingStatus) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the OutgoingStatus message to JSON.

func (*OutgoingStatus) MarshalProtoText added in v0.29.2

func (x *OutgoingStatus) MarshalProtoText() string

func (*OutgoingStatus) MarshalToSizedBufferVT added in v0.2.0

func (m *OutgoingStatus) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*OutgoingStatus) MarshalToVT added in v0.2.0

func (m *OutgoingStatus) MarshalToVT(dAtA []byte) (int, error)

func (*OutgoingStatus) MarshalVT added in v0.2.0

func (m *OutgoingStatus) MarshalVT() (dAtA []byte, err error)

func (*OutgoingStatus) ProtoMessage

func (*OutgoingStatus) ProtoMessage()

func (*OutgoingStatus) Reset

func (x *OutgoingStatus) Reset()

func (*OutgoingStatus) SizeVT added in v0.2.0

func (m *OutgoingStatus) SizeVT() (n int)

func (*OutgoingStatus) String

func (x *OutgoingStatus) String() string

func (*OutgoingStatus) UnmarshalJSON added in v0.29.0

func (x *OutgoingStatus) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the OutgoingStatus from JSON.

func (*OutgoingStatus) UnmarshalProtoJSON added in v0.29.0

func (x *OutgoingStatus) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the OutgoingStatus message from JSON.

func (*OutgoingStatus) UnmarshalVT added in v0.2.0

func (m *OutgoingStatus) UnmarshalVT(dAtA []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"`
	// contains filtered or unexported fields
}

PublishRequest is a message published via the subscribe channel.

func (*PublishRequest) CloneMessageVT added in v0.15.6

func (m *PublishRequest) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*PublishRequest) CloneVT added in v0.8.3

func (m *PublishRequest) CloneVT() *PublishRequest

func (*PublishRequest) EqualMessageVT added in v0.15.6

func (this *PublishRequest) EqualMessageVT(thatMsg any) bool

func (*PublishRequest) EqualVT added in v0.3.0

func (this *PublishRequest) EqualVT(that *PublishRequest) bool

func (*PublishRequest) GetData

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

func (*PublishRequest) GetIdentifier

func (x *PublishRequest) GetIdentifier() uint32

func (*PublishRequest) MarshalJSON added in v0.29.0

func (x *PublishRequest) MarshalJSON() ([]byte, error)

MarshalJSON marshals the PublishRequest to JSON.

func (*PublishRequest) MarshalProtoJSON added in v0.29.0

func (x *PublishRequest) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the PublishRequest message to JSON.

func (*PublishRequest) MarshalProtoText added in v0.29.2

func (x *PublishRequest) MarshalProtoText() string

func (*PublishRequest) MarshalToSizedBufferVT added in v0.2.0

func (m *PublishRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*PublishRequest) MarshalToVT added in v0.2.0

func (m *PublishRequest) MarshalToVT(dAtA []byte) (int, error)

func (*PublishRequest) MarshalVT added in v0.2.0

func (m *PublishRequest) MarshalVT() (dAtA []byte, err error)

func (*PublishRequest) ProtoMessage

func (*PublishRequest) ProtoMessage()

func (*PublishRequest) Reset

func (x *PublishRequest) Reset()

func (*PublishRequest) SizeVT added in v0.2.0

func (m *PublishRequest) SizeVT() (n int)

func (*PublishRequest) String

func (x *PublishRequest) String() string

func (*PublishRequest) UnmarshalJSON added in v0.29.0

func (x *PublishRequest) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the PublishRequest from JSON.

func (*PublishRequest) UnmarshalProtoJSON added in v0.29.0

func (x *PublishRequest) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the PublishRequest message from JSON.

func (*PublishRequest) UnmarshalVT added in v0.2.0

func (m *PublishRequest) UnmarshalVT(dAtA []byte) error

type SRPCPubSubServiceClient added in v0.3.0

type SRPCPubSubServiceClient interface {
	SRPCClient() srpc.Client

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

func NewSRPCPubSubServiceClient added in v0.3.0

func NewSRPCPubSubServiceClient(cc srpc.Client) SRPCPubSubServiceClient

func NewSRPCPubSubServiceClientWithServiceID added in v0.7.2

func NewSRPCPubSubServiceClientWithServiceID(cc srpc.Client, serviceID string) SRPCPubSubServiceClient

type SRPCPubSubServiceHandler added in v0.3.0

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

func (SRPCPubSubServiceHandler) GetMethodIDs added in v0.3.0

func (SRPCPubSubServiceHandler) GetMethodIDs() []string

func (*SRPCPubSubServiceHandler) GetServiceID added in v0.3.0

func (d *SRPCPubSubServiceHandler) GetServiceID() string

func (*SRPCPubSubServiceHandler) InvokeMethod added in v0.3.0

func (d *SRPCPubSubServiceHandler) InvokeMethod(
	serviceID, methodID string,
	strm srpc.Stream,
) (bool, error)

func (SRPCPubSubServiceHandler) InvokeMethod_Subscribe added in v0.3.0

func (SRPCPubSubServiceHandler) InvokeMethod_Subscribe(impl SRPCPubSubServiceServer, strm srpc.Stream) error

type SRPCPubSubServiceServer added in v0.3.0

type SRPCPubSubServiceServer interface {
	Subscribe(SRPCPubSubService_SubscribeStream) error
}

type SRPCPubSubServiceUnimplementedServer added in v0.3.0

type SRPCPubSubServiceUnimplementedServer struct{}

func (*SRPCPubSubServiceUnimplementedServer) Subscribe added in v0.3.0

type SRPCPubSubService_SubscribeClient added in v0.3.0

type SRPCPubSubService_SubscribeClient interface {
	srpc.Stream
	Send(*SubscribeRequest) error
	Recv() (*SubscribeResponse, error)
	RecvTo(*SubscribeResponse) error
}

type SRPCPubSubService_SubscribeStream added in v0.3.0

type SRPCPubSubService_SubscribeStream interface {
	srpc.Stream
	Send(*SubscribeResponse) error
	SendAndClose(*SubscribeResponse) error
	Recv() (*SubscribeRequest, error)
	RecvTo(*SubscribeRequest) 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:"channelId,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:"peerId,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:"privKeyPem,omitempty"`
	// PublishRequest contains a publish message request.
	PublishRequest *PublishRequest `protobuf:"bytes,4,opt,name=publish_request,json=publishRequest,proto3" json:"publishRequest,omitempty"`
	// contains filtered or unexported fields
}

SubcribeRequest is a pubsub subscription request message.

func (*SubscribeRequest) CloneMessageVT added in v0.15.6

func (m *SubscribeRequest) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*SubscribeRequest) CloneVT added in v0.8.3

func (m *SubscribeRequest) CloneVT() *SubscribeRequest

func (*SubscribeRequest) EqualMessageVT added in v0.15.6

func (this *SubscribeRequest) EqualMessageVT(thatMsg any) bool

func (*SubscribeRequest) EqualVT added in v0.3.0

func (this *SubscribeRequest) EqualVT(that *SubscribeRequest) bool

func (*SubscribeRequest) GetChannelId

func (x *SubscribeRequest) GetChannelId() string

func (*SubscribeRequest) GetPeerId

func (x *SubscribeRequest) GetPeerId() string

func (*SubscribeRequest) GetPrivKeyPem

func (x *SubscribeRequest) GetPrivKeyPem() string

func (*SubscribeRequest) GetPublishRequest

func (x *SubscribeRequest) GetPublishRequest() *PublishRequest

func (*SubscribeRequest) MarshalJSON added in v0.29.0

func (x *SubscribeRequest) MarshalJSON() ([]byte, error)

MarshalJSON marshals the SubscribeRequest to JSON.

func (*SubscribeRequest) MarshalProtoJSON added in v0.29.0

func (x *SubscribeRequest) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the SubscribeRequest message to JSON.

func (*SubscribeRequest) MarshalProtoText added in v0.29.2

func (x *SubscribeRequest) MarshalProtoText() string

func (*SubscribeRequest) MarshalToSizedBufferVT added in v0.2.0

func (m *SubscribeRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SubscribeRequest) MarshalToVT added in v0.2.0

func (m *SubscribeRequest) MarshalToVT(dAtA []byte) (int, error)

func (*SubscribeRequest) MarshalVT added in v0.2.0

func (m *SubscribeRequest) MarshalVT() (dAtA []byte, err error)

func (*SubscribeRequest) ProtoMessage

func (*SubscribeRequest) ProtoMessage()

func (*SubscribeRequest) Reset

func (x *SubscribeRequest) Reset()

func (*SubscribeRequest) SizeVT added in v0.2.0

func (m *SubscribeRequest) SizeVT() (n int)

func (*SubscribeRequest) String

func (x *SubscribeRequest) String() string

func (*SubscribeRequest) UnmarshalJSON added in v0.29.0

func (x *SubscribeRequest) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SubscribeRequest from JSON.

func (*SubscribeRequest) UnmarshalProtoJSON added in v0.29.0

func (x *SubscribeRequest) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the SubscribeRequest message from JSON.

func (*SubscribeRequest) UnmarshalVT added in v0.2.0

func (m *SubscribeRequest) UnmarshalVT(dAtA []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:"incomingMessage,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:"outgoingStatus,omitempty"`
	// SubscriptionStatus is the status of the subscription
	SubscriptionStatus *SubscriptionStatus `protobuf:"bytes,3,opt,name=subscription_status,json=subscriptionStatus,proto3" json:"subscriptionStatus,omitempty"`
	// contains filtered or unexported fields
}

SubcribeResponse is a pubsub subscription response message.

func (*SubscribeResponse) CloneMessageVT added in v0.15.6

func (m *SubscribeResponse) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*SubscribeResponse) CloneVT added in v0.8.3

func (m *SubscribeResponse) CloneVT() *SubscribeResponse

func (*SubscribeResponse) EqualMessageVT added in v0.15.6

func (this *SubscribeResponse) EqualMessageVT(thatMsg any) bool

func (*SubscribeResponse) EqualVT added in v0.3.0

func (this *SubscribeResponse) EqualVT(that *SubscribeResponse) bool

func (*SubscribeResponse) GetIncomingMessage

func (x *SubscribeResponse) GetIncomingMessage() *IncomingMessage

func (*SubscribeResponse) GetOutgoingStatus

func (x *SubscribeResponse) GetOutgoingStatus() *OutgoingStatus

func (*SubscribeResponse) GetSubscriptionStatus

func (x *SubscribeResponse) GetSubscriptionStatus() *SubscriptionStatus

func (*SubscribeResponse) MarshalJSON added in v0.29.0

func (x *SubscribeResponse) MarshalJSON() ([]byte, error)

MarshalJSON marshals the SubscribeResponse to JSON.

func (*SubscribeResponse) MarshalProtoJSON added in v0.29.0

func (x *SubscribeResponse) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the SubscribeResponse message to JSON.

func (*SubscribeResponse) MarshalProtoText added in v0.29.2

func (x *SubscribeResponse) MarshalProtoText() string

func (*SubscribeResponse) MarshalToSizedBufferVT added in v0.2.0

func (m *SubscribeResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SubscribeResponse) MarshalToVT added in v0.2.0

func (m *SubscribeResponse) MarshalToVT(dAtA []byte) (int, error)

func (*SubscribeResponse) MarshalVT added in v0.2.0

func (m *SubscribeResponse) MarshalVT() (dAtA []byte, err error)

func (*SubscribeResponse) ProtoMessage

func (*SubscribeResponse) ProtoMessage()

func (*SubscribeResponse) Reset

func (x *SubscribeResponse) Reset()

func (*SubscribeResponse) SizeVT added in v0.2.0

func (m *SubscribeResponse) SizeVT() (n int)

func (*SubscribeResponse) String

func (x *SubscribeResponse) String() string

func (*SubscribeResponse) UnmarshalJSON added in v0.29.0

func (x *SubscribeResponse) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SubscribeResponse from JSON.

func (*SubscribeResponse) UnmarshalProtoJSON added in v0.29.0

func (x *SubscribeResponse) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the SubscribeResponse message from JSON.

func (*SubscribeResponse) UnmarshalVT added in v0.2.0

func (m *SubscribeResponse) UnmarshalVT(dAtA []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"`
	// contains filtered or unexported fields
}

SubscripionStatus is the status of the subscription handle.

func (*SubscriptionStatus) CloneMessageVT added in v0.15.6

func (m *SubscriptionStatus) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*SubscriptionStatus) CloneVT added in v0.8.3

func (m *SubscriptionStatus) CloneVT() *SubscriptionStatus

func (*SubscriptionStatus) EqualMessageVT added in v0.15.6

func (this *SubscriptionStatus) EqualMessageVT(thatMsg any) bool

func (*SubscriptionStatus) EqualVT added in v0.3.0

func (this *SubscriptionStatus) EqualVT(that *SubscriptionStatus) bool

func (*SubscriptionStatus) GetSubscribed

func (x *SubscriptionStatus) GetSubscribed() bool

func (*SubscriptionStatus) MarshalJSON added in v0.29.0

func (x *SubscriptionStatus) MarshalJSON() ([]byte, error)

MarshalJSON marshals the SubscriptionStatus to JSON.

func (*SubscriptionStatus) MarshalProtoJSON added in v0.29.0

func (x *SubscriptionStatus) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the SubscriptionStatus message to JSON.

func (*SubscriptionStatus) MarshalProtoText added in v0.29.2

func (x *SubscriptionStatus) MarshalProtoText() string

func (*SubscriptionStatus) MarshalToSizedBufferVT added in v0.2.0

func (m *SubscriptionStatus) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SubscriptionStatus) MarshalToVT added in v0.2.0

func (m *SubscriptionStatus) MarshalToVT(dAtA []byte) (int, error)

func (*SubscriptionStatus) MarshalVT added in v0.2.0

func (m *SubscriptionStatus) MarshalVT() (dAtA []byte, err error)

func (*SubscriptionStatus) ProtoMessage

func (*SubscriptionStatus) ProtoMessage()

func (*SubscriptionStatus) Reset

func (x *SubscriptionStatus) Reset()

func (*SubscriptionStatus) SizeVT added in v0.2.0

func (m *SubscriptionStatus) SizeVT() (n int)

func (*SubscriptionStatus) String

func (x *SubscriptionStatus) String() string

func (*SubscriptionStatus) UnmarshalJSON added in v0.29.0

func (x *SubscriptionStatus) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SubscriptionStatus from JSON.

func (*SubscriptionStatus) UnmarshalProtoJSON added in v0.29.0

func (x *SubscriptionStatus) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the SubscriptionStatus message from JSON.

func (*SubscriptionStatus) UnmarshalVT added in v0.2.0

func (m *SubscriptionStatus) UnmarshalVT(dAtA []byte) error

Jump to

Keyboard shortcuts

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