message_apiv1

package
v0.0.0-...-e21c0d3 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MessageApi_Publish_FullMethodName      = "/xmtp.message_api.v1.MessageApi/Publish"
	MessageApi_Subscribe_FullMethodName    = "/xmtp.message_api.v1.MessageApi/Subscribe"
	MessageApi_Subscribe2_FullMethodName   = "/xmtp.message_api.v1.MessageApi/Subscribe2"
	MessageApi_SubscribeAll_FullMethodName = "/xmtp.message_api.v1.MessageApi/SubscribeAll"
	MessageApi_Query_FullMethodName        = "/xmtp.message_api.v1.MessageApi/Query"
	MessageApi_BatchQuery_FullMethodName   = "/xmtp.message_api.v1.MessageApi/BatchQuery"
)

Variables

View Source
var (
	SortDirection_name = map[int32]string{
		0: "SORT_DIRECTION_UNSPECIFIED",
		1: "SORT_DIRECTION_ASCENDING",
		2: "SORT_DIRECTION_DESCENDING",
	}
	SortDirection_value = map[string]int32{
		"SORT_DIRECTION_UNSPECIFIED": 0,
		"SORT_DIRECTION_ASCENDING":   1,
		"SORT_DIRECTION_DESCENDING":  2,
	}
)

Enum value maps for SortDirection.

View Source
var File_message_api_v1_authn_proto protoreflect.FileDescriptor
View Source
var File_message_api_v1_message_api_proto protoreflect.FileDescriptor
View Source
var MessageApi_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "xmtp.message_api.v1.MessageApi",
	HandlerType: (*MessageApiServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Publish",
			Handler:    _MessageApi_Publish_Handler,
		},
		{
			MethodName: "Query",
			Handler:    _MessageApi_Query_Handler,
		},
		{
			MethodName: "BatchQuery",
			Handler:    _MessageApi_BatchQuery_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Subscribe",
			Handler:       _MessageApi_Subscribe_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "Subscribe2",
			Handler:       _MessageApi_Subscribe2_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
		{
			StreamName:    "SubscribeAll",
			Handler:       _MessageApi_SubscribeAll_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "message_api/v1/message_api.proto",
}

MessageApi_ServiceDesc is the grpc.ServiceDesc for MessageApi service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterMessageApiServer

func RegisterMessageApiServer(s grpc.ServiceRegistrar, srv MessageApiServer)

Types

type AuthData

type AuthData struct {

	// address of the wallet
	WalletAddr string `protobuf:"bytes,1,opt,name=wallet_addr,json=walletAddr,proto3" json:"wallet_addr,omitempty"`
	// time when the token was generated/signed
	CreatedNs uint64 `protobuf:"varint,2,opt,name=created_ns,json=createdNs,proto3" json:"created_ns,omitempty"`
	// contains filtered or unexported fields
}

AuthData carries token parameters that are authenticated by the identity key signature. It is embedded in the Token structure as bytes so that the bytes don't need to be reconstructed to verify the token signature.

func (*AuthData) Descriptor deprecated

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

Deprecated: Use AuthData.ProtoReflect.Descriptor instead.

func (*AuthData) GetCreatedNs

func (x *AuthData) GetCreatedNs() uint64

func (*AuthData) GetWalletAddr

func (x *AuthData) GetWalletAddr() string

func (*AuthData) ProtoMessage

func (*AuthData) ProtoMessage()

func (*AuthData) ProtoReflect

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

func (*AuthData) Reset

func (x *AuthData) Reset()

func (*AuthData) String

func (x *AuthData) String() string

type BatchQueryRequest

type BatchQueryRequest struct {
	Requests []*QueryRequest `protobuf:"bytes,1,rep,name=requests,proto3" json:"requests,omitempty"`
	// contains filtered or unexported fields
}

BatchQuery

func (*BatchQueryRequest) Descriptor deprecated

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

Deprecated: Use BatchQueryRequest.ProtoReflect.Descriptor instead.

func (*BatchQueryRequest) GetRequests

func (x *BatchQueryRequest) GetRequests() []*QueryRequest

func (*BatchQueryRequest) ProtoMessage

func (*BatchQueryRequest) ProtoMessage()

func (*BatchQueryRequest) ProtoReflect

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

func (*BatchQueryRequest) Reset

func (x *BatchQueryRequest) Reset()

func (*BatchQueryRequest) String

func (x *BatchQueryRequest) String() string

type BatchQueryResponse

type BatchQueryResponse struct {
	Responses []*QueryResponse `protobuf:"bytes,1,rep,name=responses,proto3" json:"responses,omitempty"`
	// contains filtered or unexported fields
}

Response containing a list of QueryResponse messages

func (*BatchQueryResponse) Descriptor deprecated

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

Deprecated: Use BatchQueryResponse.ProtoReflect.Descriptor instead.

func (*BatchQueryResponse) GetResponses

func (x *BatchQueryResponse) GetResponses() []*QueryResponse

func (*BatchQueryResponse) ProtoMessage

func (*BatchQueryResponse) ProtoMessage()

func (*BatchQueryResponse) ProtoReflect

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

func (*BatchQueryResponse) Reset

func (x *BatchQueryResponse) Reset()

func (*BatchQueryResponse) String

func (x *BatchQueryResponse) String() string

type Cursor

type Cursor struct {

	// Making the cursor a one-of type, as I would like to change the way we
	// handle pagination to use a precomputed sort field.
	// This way we can handle both methods
	//
	// Types that are assignable to Cursor:
	//
	//	*Cursor_Index
	Cursor isCursor_Cursor `protobuf_oneof:"cursor"`
	// contains filtered or unexported fields
}

Wrapper for potentially multiple types of cursor

func (*Cursor) Descriptor deprecated

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

Deprecated: Use Cursor.ProtoReflect.Descriptor instead.

func (*Cursor) GetCursor

func (m *Cursor) GetCursor() isCursor_Cursor

func (*Cursor) GetIndex

func (x *Cursor) GetIndex() *IndexCursor

func (*Cursor) ProtoMessage

func (*Cursor) ProtoMessage()

func (*Cursor) ProtoReflect

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

func (*Cursor) Reset

func (x *Cursor) Reset()

func (*Cursor) String

func (x *Cursor) String() string

type Cursor_Index

type Cursor_Index struct {
	Index *IndexCursor `protobuf:"bytes,1,opt,name=index,proto3,oneof"`
}

type Envelope

type Envelope struct {

	// The topic the message belongs to,
	// If the message includes the topic as well
	// it MUST be the same as the topic in the envelope.
	ContentTopic string `protobuf:"bytes,1,opt,name=content_topic,json=contentTopic,proto3" json:"content_topic,omitempty"`
	// Message creation timestamp
	// If the message includes the timestamp as well
	// it MUST be equivalent to the timestamp in the envelope.
	TimestampNs uint64 `protobuf:"varint,2,opt,name=timestamp_ns,json=timestampNs,proto3" json:"timestamp_ns,omitempty"`
	Message     []byte `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

Envelope encapsulates a message while in transit.

func (*Envelope) Descriptor deprecated

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

Deprecated: Use Envelope.ProtoReflect.Descriptor instead.

func (*Envelope) GetContentTopic

func (x *Envelope) GetContentTopic() string

func (*Envelope) GetMessage

func (x *Envelope) GetMessage() []byte

func (*Envelope) GetTimestampNs

func (x *Envelope) GetTimestampNs() uint64

func (*Envelope) ProtoMessage

func (*Envelope) ProtoMessage()

func (*Envelope) ProtoReflect

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

func (*Envelope) Reset

func (x *Envelope) Reset()

func (*Envelope) String

func (x *Envelope) String() string

type IndexCursor

type IndexCursor struct {
	Digest       []byte `protobuf:"bytes,1,opt,name=digest,proto3" json:"digest,omitempty"`
	SenderTimeNs uint64 `protobuf:"varint,2,opt,name=sender_time_ns,json=senderTimeNs,proto3" json:"sender_time_ns,omitempty"`
	// contains filtered or unexported fields
}

This is based off of the go-waku Index type, but with the receiverTime and pubsubTopic removed for simplicity. Both removed fields are optional

func (*IndexCursor) Descriptor deprecated

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

Deprecated: Use IndexCursor.ProtoReflect.Descriptor instead.

func (*IndexCursor) GetDigest

func (x *IndexCursor) GetDigest() []byte

func (*IndexCursor) GetSenderTimeNs

func (x *IndexCursor) GetSenderTimeNs() uint64

func (*IndexCursor) ProtoMessage

func (*IndexCursor) ProtoMessage()

func (*IndexCursor) ProtoReflect

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

func (*IndexCursor) Reset

func (x *IndexCursor) Reset()

func (*IndexCursor) String

func (x *IndexCursor) String() string

type MessageApiClient

type MessageApiClient interface {
	// Publish messages to the network
	Publish(ctx context.Context, in *PublishRequest, opts ...grpc.CallOption) (*PublishResponse, error)
	// Subscribe to a stream of new envelopes matching a predicate
	Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (MessageApi_SubscribeClient, error)
	// Subscribe to a stream of new envelopes and your subscription using
	// bidirectional streaming
	// protolint:disable:next RPC_REQUEST_STANDARD_NAME
	Subscribe2(ctx context.Context, opts ...grpc.CallOption) (MessageApi_Subscribe2Client, error)
	// Subscribe to a stream of all messages
	SubscribeAll(ctx context.Context, in *SubscribeAllRequest, opts ...grpc.CallOption) (MessageApi_SubscribeAllClient, error)
	// Query the store for messages
	Query(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error)
	// BatchQuery containing a set of queries to be processed
	BatchQuery(ctx context.Context, in *BatchQueryRequest, opts ...grpc.CallOption) (*BatchQueryResponse, error)
}

MessageApiClient is the client API for MessageApi service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewMessageApiClient

func NewMessageApiClient(cc grpc.ClientConnInterface) MessageApiClient

type MessageApiServer

type MessageApiServer interface {
	// Publish messages to the network
	Publish(context.Context, *PublishRequest) (*PublishResponse, error)
	// Subscribe to a stream of new envelopes matching a predicate
	Subscribe(*SubscribeRequest, MessageApi_SubscribeServer) error
	// Subscribe to a stream of new envelopes and your subscription using
	// bidirectional streaming
	// protolint:disable:next RPC_REQUEST_STANDARD_NAME
	Subscribe2(MessageApi_Subscribe2Server) error
	// Subscribe to a stream of all messages
	SubscribeAll(*SubscribeAllRequest, MessageApi_SubscribeAllServer) error
	// Query the store for messages
	Query(context.Context, *QueryRequest) (*QueryResponse, error)
	// BatchQuery containing a set of queries to be processed
	BatchQuery(context.Context, *BatchQueryRequest) (*BatchQueryResponse, error)
	// contains filtered or unexported methods
}

MessageApiServer is the server API for MessageApi service. All implementations must embed UnimplementedMessageApiServer for forward compatibility

type MessageApi_Subscribe2Client

type MessageApi_Subscribe2Client interface {
	Send(*SubscribeRequest) error
	Recv() (*Envelope, error)
	grpc.ClientStream
}

type MessageApi_Subscribe2Server

type MessageApi_Subscribe2Server interface {
	Send(*Envelope) error
	Recv() (*SubscribeRequest, error)
	grpc.ServerStream
}

type MessageApi_SubscribeAllClient

type MessageApi_SubscribeAllClient interface {
	Recv() (*Envelope, error)
	grpc.ClientStream
}

type MessageApi_SubscribeAllServer

type MessageApi_SubscribeAllServer interface {
	Send(*Envelope) error
	grpc.ServerStream
}

type MessageApi_SubscribeClient

type MessageApi_SubscribeClient interface {
	Recv() (*Envelope, error)
	grpc.ClientStream
}

type MessageApi_SubscribeServer

type MessageApi_SubscribeServer interface {
	Send(*Envelope) error
	grpc.ServerStream
}

type PagingInfo

type PagingInfo struct {

	// Note: this is a uint32, while go-waku's pageSize is a uint64
	Limit     uint32        `protobuf:"varint,1,opt,name=limit,proto3" json:"limit,omitempty"`
	Cursor    *Cursor       `protobuf:"bytes,2,opt,name=cursor,proto3" json:"cursor,omitempty"`
	Direction SortDirection `protobuf:"varint,3,opt,name=direction,proto3,enum=xmtp.message_api.v1.SortDirection" json:"direction,omitempty"`
	// contains filtered or unexported fields
}

This is based off of the go-waku PagingInfo struct, but with the direction changed to our SortDirection enum format

func (*PagingInfo) Descriptor deprecated

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

Deprecated: Use PagingInfo.ProtoReflect.Descriptor instead.

func (*PagingInfo) GetCursor

func (x *PagingInfo) GetCursor() *Cursor

func (*PagingInfo) GetDirection

func (x *PagingInfo) GetDirection() SortDirection

func (*PagingInfo) GetLimit

func (x *PagingInfo) GetLimit() uint32

func (*PagingInfo) ProtoMessage

func (*PagingInfo) ProtoMessage()

func (*PagingInfo) ProtoReflect

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

func (*PagingInfo) Reset

func (x *PagingInfo) Reset()

func (*PagingInfo) String

func (x *PagingInfo) String() string

type PublishRequest

type PublishRequest struct {
	Envelopes []*Envelope `protobuf:"bytes,1,rep,name=envelopes,proto3" json:"envelopes,omitempty"`
	// contains filtered or unexported fields
}

Publish

func (*PublishRequest) Descriptor deprecated

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

Deprecated: Use PublishRequest.ProtoReflect.Descriptor instead.

func (*PublishRequest) GetEnvelopes

func (x *PublishRequest) GetEnvelopes() []*Envelope

func (*PublishRequest) ProtoMessage

func (*PublishRequest) ProtoMessage()

func (*PublishRequest) ProtoReflect

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

func (*PublishRequest) Reset

func (x *PublishRequest) Reset()

func (*PublishRequest) String

func (x *PublishRequest) String() string

type PublishResponse

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

Empty message as a response for Publish

func (*PublishResponse) Descriptor deprecated

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

Deprecated: Use PublishResponse.ProtoReflect.Descriptor instead.

func (*PublishResponse) ProtoMessage

func (*PublishResponse) ProtoMessage()

func (*PublishResponse) ProtoReflect

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

func (*PublishResponse) Reset

func (x *PublishResponse) Reset()

func (*PublishResponse) String

func (x *PublishResponse) String() string

type QueryRequest

type QueryRequest struct {
	ContentTopics []string    `protobuf:"bytes,1,rep,name=content_topics,json=contentTopics,proto3" json:"content_topics,omitempty"`
	StartTimeNs   uint64      `protobuf:"varint,2,opt,name=start_time_ns,json=startTimeNs,proto3" json:"start_time_ns,omitempty"`
	EndTimeNs     uint64      `protobuf:"varint,3,opt,name=end_time_ns,json=endTimeNs,proto3" json:"end_time_ns,omitempty"`
	PagingInfo    *PagingInfo `protobuf:"bytes,4,opt,name=paging_info,json=pagingInfo,proto3" json:"paging_info,omitempty"`
	// contains filtered or unexported fields
}

Query

func (*QueryRequest) Descriptor deprecated

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

Deprecated: Use QueryRequest.ProtoReflect.Descriptor instead.

func (*QueryRequest) GetContentTopics

func (x *QueryRequest) GetContentTopics() []string

func (*QueryRequest) GetEndTimeNs

func (x *QueryRequest) GetEndTimeNs() uint64

func (*QueryRequest) GetPagingInfo

func (x *QueryRequest) GetPagingInfo() *PagingInfo

func (*QueryRequest) GetStartTimeNs

func (x *QueryRequest) GetStartTimeNs() uint64

func (*QueryRequest) ProtoMessage

func (*QueryRequest) ProtoMessage()

func (*QueryRequest) ProtoReflect

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

func (*QueryRequest) Reset

func (x *QueryRequest) Reset()

func (*QueryRequest) String

func (x *QueryRequest) String() string

type QueryResponse

type QueryResponse struct {
	Envelopes  []*Envelope `protobuf:"bytes,1,rep,name=envelopes,proto3" json:"envelopes,omitempty"`
	PagingInfo *PagingInfo `protobuf:"bytes,2,opt,name=paging_info,json=pagingInfo,proto3" json:"paging_info,omitempty"`
	// contains filtered or unexported fields
}

The response, containing envelopes, for a query

func (*QueryResponse) Descriptor deprecated

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

Deprecated: Use QueryResponse.ProtoReflect.Descriptor instead.

func (*QueryResponse) GetEnvelopes

func (x *QueryResponse) GetEnvelopes() []*Envelope

func (*QueryResponse) GetPagingInfo

func (x *QueryResponse) GetPagingInfo() *PagingInfo

func (*QueryResponse) ProtoMessage

func (*QueryResponse) ProtoMessage()

func (*QueryResponse) ProtoReflect

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

func (*QueryResponse) Reset

func (x *QueryResponse) Reset()

func (*QueryResponse) String

func (x *QueryResponse) String() string

type SortDirection

type SortDirection int32

Sort direction

const (
	SortDirection_SORT_DIRECTION_UNSPECIFIED SortDirection = 0
	SortDirection_SORT_DIRECTION_ASCENDING   SortDirection = 1
	SortDirection_SORT_DIRECTION_DESCENDING  SortDirection = 2
)

func (SortDirection) Descriptor

func (SortDirection) Enum

func (x SortDirection) Enum() *SortDirection

func (SortDirection) EnumDescriptor deprecated

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

Deprecated: Use SortDirection.Descriptor instead.

func (SortDirection) Number

func (SortDirection) String

func (x SortDirection) String() string

func (SortDirection) Type

type SubscribeAllRequest

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

SubscribeAll

func (*SubscribeAllRequest) Descriptor deprecated

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

Deprecated: Use SubscribeAllRequest.ProtoReflect.Descriptor instead.

func (*SubscribeAllRequest) ProtoMessage

func (*SubscribeAllRequest) ProtoMessage()

func (*SubscribeAllRequest) ProtoReflect

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

func (*SubscribeAllRequest) Reset

func (x *SubscribeAllRequest) Reset()

func (*SubscribeAllRequest) String

func (x *SubscribeAllRequest) String() string

type SubscribeRequest

type SubscribeRequest struct {
	ContentTopics []string `protobuf:"bytes,1,rep,name=content_topics,json=contentTopics,proto3" json:"content_topics,omitempty"`
	// contains filtered or unexported fields
}

Subscribe

func (*SubscribeRequest) Descriptor deprecated

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

Deprecated: Use SubscribeRequest.ProtoReflect.Descriptor instead.

func (*SubscribeRequest) GetContentTopics

func (x *SubscribeRequest) GetContentTopics() []string

func (*SubscribeRequest) ProtoMessage

func (*SubscribeRequest) ProtoMessage()

func (*SubscribeRequest) ProtoReflect

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

func (*SubscribeRequest) Reset

func (x *SubscribeRequest) Reset()

func (*SubscribeRequest) String

func (x *SubscribeRequest) String() string

type Token

type Token struct {

	// identity key signed by a wallet
	IdentityKey *message_contents.PublicKey `protobuf:"bytes,1,opt,name=identity_key,json=identityKey,proto3" json:"identity_key,omitempty"`
	// encoded bytes of AuthData
	AuthDataBytes []byte `protobuf:"bytes,2,opt,name=auth_data_bytes,json=authDataBytes,proto3" json:"auth_data_bytes,omitempty"`
	// identity key signature of AuthData bytes
	AuthDataSignature *message_contents.Signature `protobuf:"bytes,3,opt,name=auth_data_signature,json=authDataSignature,proto3" json:"auth_data_signature,omitempty"`
	// contains filtered or unexported fields
}

Token is used by clients to prove to the nodes that they are serving a specific wallet.

func (*Token) Descriptor deprecated

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

Deprecated: Use Token.ProtoReflect.Descriptor instead.

func (*Token) GetAuthDataBytes

func (x *Token) GetAuthDataBytes() []byte

func (*Token) GetAuthDataSignature

func (x *Token) GetAuthDataSignature() *message_contents.Signature

func (*Token) GetIdentityKey

func (x *Token) GetIdentityKey() *message_contents.PublicKey

func (*Token) ProtoMessage

func (*Token) ProtoMessage()

func (*Token) ProtoReflect

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

func (*Token) Reset

func (x *Token) Reset()

func (*Token) String

func (x *Token) String() string

type UnimplementedMessageApiServer

type UnimplementedMessageApiServer struct {
}

UnimplementedMessageApiServer must be embedded to have forward compatible implementations.

func (UnimplementedMessageApiServer) BatchQuery

func (UnimplementedMessageApiServer) Publish

func (UnimplementedMessageApiServer) Query

func (UnimplementedMessageApiServer) Subscribe

func (UnimplementedMessageApiServer) Subscribe2

func (UnimplementedMessageApiServer) SubscribeAll

type UnsafeMessageApiServer

type UnsafeMessageApiServer interface {
	// contains filtered or unexported methods
}

UnsafeMessageApiServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to MessageApiServer will result in compilation errors.

Jump to

Keyboard shortcuts

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