apiv1

package
v0.0.0-...-ade549e Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package apiv1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	IdentityApi_PublishIdentityUpdate_FullMethodName = "/xmtp.identity.api.v1.IdentityApi/PublishIdentityUpdate"
	IdentityApi_GetIdentityUpdates_FullMethodName    = "/xmtp.identity.api.v1.IdentityApi/GetIdentityUpdates"
	IdentityApi_GetInboxIds_FullMethodName           = "/xmtp.identity.api.v1.IdentityApi/GetInboxIds"
)

Variables

View Source
var File_identity_api_v1_identity_proto protoreflect.FileDescriptor
View Source
var IdentityApi_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "xmtp.identity.api.v1.IdentityApi",
	HandlerType: (*IdentityApiServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "PublishIdentityUpdate",
			Handler:    _IdentityApi_PublishIdentityUpdate_Handler,
		},
		{
			MethodName: "GetIdentityUpdates",
			Handler:    _IdentityApi_GetIdentityUpdates_Handler,
		},
		{
			MethodName: "GetInboxIds",
			Handler:    _IdentityApi_GetInboxIds_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "identity/api/v1/identity.proto",
}

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

Functions

func RegisterIdentityApiHandler

func RegisterIdentityApiHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterIdentityApiHandler registers the http handlers for service IdentityApi to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterIdentityApiHandlerClient

func RegisterIdentityApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client IdentityApiClient) error

RegisterIdentityApiHandlerClient registers the http handlers for service IdentityApi to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "IdentityApiClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "IdentityApiClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "IdentityApiClient" to call the correct interceptors.

func RegisterIdentityApiHandlerFromEndpoint

func RegisterIdentityApiHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterIdentityApiHandlerFromEndpoint is same as RegisterIdentityApiHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterIdentityApiHandlerServer

func RegisterIdentityApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server IdentityApiServer) error

RegisterIdentityApiHandlerServer registers the http handlers for service IdentityApi to "mux". UnaryRPC :call IdentityApiServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterIdentityApiHandlerFromEndpoint instead.

func RegisterIdentityApiServer

func RegisterIdentityApiServer(s grpc.ServiceRegistrar, srv IdentityApiServer)

Types

type GetIdentityUpdatesRequest

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

Get all updates for an identity since the specified time

func (*GetIdentityUpdatesRequest) Descriptor deprecated

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

Deprecated: Use GetIdentityUpdatesRequest.ProtoReflect.Descriptor instead.

func (*GetIdentityUpdatesRequest) GetRequests

func (*GetIdentityUpdatesRequest) ProtoMessage

func (*GetIdentityUpdatesRequest) ProtoMessage()

func (*GetIdentityUpdatesRequest) ProtoReflect

func (*GetIdentityUpdatesRequest) Reset

func (x *GetIdentityUpdatesRequest) Reset()

func (*GetIdentityUpdatesRequest) String

func (x *GetIdentityUpdatesRequest) String() string

type GetIdentityUpdatesRequest_Request

type GetIdentityUpdatesRequest_Request struct {
	InboxId    string `protobuf:"bytes,1,opt,name=inbox_id,json=inboxId,proto3" json:"inbox_id,omitempty"`
	SequenceId uint64 `protobuf:"varint,2,opt,name=sequence_id,json=sequenceId,proto3" json:"sequence_id,omitempty"`
	// contains filtered or unexported fields
}

Points to the last entry the client has received. The sequence_id should be set to 0 if the client has not received anything.

func (*GetIdentityUpdatesRequest_Request) Descriptor deprecated

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

Deprecated: Use GetIdentityUpdatesRequest_Request.ProtoReflect.Descriptor instead.

func (*GetIdentityUpdatesRequest_Request) GetInboxId

func (x *GetIdentityUpdatesRequest_Request) GetInboxId() string

func (*GetIdentityUpdatesRequest_Request) GetSequenceId

func (x *GetIdentityUpdatesRequest_Request) GetSequenceId() uint64

func (*GetIdentityUpdatesRequest_Request) ProtoMessage

func (*GetIdentityUpdatesRequest_Request) ProtoMessage()

func (*GetIdentityUpdatesRequest_Request) ProtoReflect

func (*GetIdentityUpdatesRequest_Request) Reset

func (*GetIdentityUpdatesRequest_Request) String

type GetIdentityUpdatesResponse

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

Returns all log entries for the requested identities

func (*GetIdentityUpdatesResponse) Descriptor deprecated

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

Deprecated: Use GetIdentityUpdatesResponse.ProtoReflect.Descriptor instead.

func (*GetIdentityUpdatesResponse) GetResponses

func (*GetIdentityUpdatesResponse) ProtoMessage

func (*GetIdentityUpdatesResponse) ProtoMessage()

func (*GetIdentityUpdatesResponse) ProtoReflect

func (*GetIdentityUpdatesResponse) Reset

func (x *GetIdentityUpdatesResponse) Reset()

func (*GetIdentityUpdatesResponse) String

func (x *GetIdentityUpdatesResponse) String() string

type GetIdentityUpdatesResponse_IdentityUpdateLog

type GetIdentityUpdatesResponse_IdentityUpdateLog struct {
	SequenceId        uint64                       `protobuf:"varint,1,opt,name=sequence_id,json=sequenceId,proto3" json:"sequence_id,omitempty"`
	ServerTimestampNs uint64                       `protobuf:"varint,2,opt,name=server_timestamp_ns,json=serverTimestampNs,proto3" json:"server_timestamp_ns,omitempty"`
	Update            *associations.IdentityUpdate `protobuf:"bytes,3,opt,name=update,proto3" json:"update,omitempty"`
	// contains filtered or unexported fields
}

A single entry in the XID log on the server.

func (*GetIdentityUpdatesResponse_IdentityUpdateLog) Descriptor deprecated

Deprecated: Use GetIdentityUpdatesResponse_IdentityUpdateLog.ProtoReflect.Descriptor instead.

func (*GetIdentityUpdatesResponse_IdentityUpdateLog) GetSequenceId

func (*GetIdentityUpdatesResponse_IdentityUpdateLog) GetServerTimestampNs

func (x *GetIdentityUpdatesResponse_IdentityUpdateLog) GetServerTimestampNs() uint64

func (*GetIdentityUpdatesResponse_IdentityUpdateLog) GetUpdate

func (*GetIdentityUpdatesResponse_IdentityUpdateLog) ProtoMessage

func (*GetIdentityUpdatesResponse_IdentityUpdateLog) ProtoReflect

func (*GetIdentityUpdatesResponse_IdentityUpdateLog) Reset

func (*GetIdentityUpdatesResponse_IdentityUpdateLog) String

type GetIdentityUpdatesResponse_Response

type GetIdentityUpdatesResponse_Response struct {
	InboxId string                                          `protobuf:"bytes,1,opt,name=inbox_id,json=inboxId,proto3" json:"inbox_id,omitempty"`
	Updates []*GetIdentityUpdatesResponse_IdentityUpdateLog `protobuf:"bytes,2,rep,name=updates,proto3" json:"updates,omitempty"`
	// contains filtered or unexported fields
}

The update log for a single identity, starting after the last cursor

func (*GetIdentityUpdatesResponse_Response) Descriptor deprecated

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

Deprecated: Use GetIdentityUpdatesResponse_Response.ProtoReflect.Descriptor instead.

func (*GetIdentityUpdatesResponse_Response) GetInboxId

func (*GetIdentityUpdatesResponse_Response) GetUpdates

func (*GetIdentityUpdatesResponse_Response) ProtoMessage

func (*GetIdentityUpdatesResponse_Response) ProtoMessage()

func (*GetIdentityUpdatesResponse_Response) ProtoReflect

func (*GetIdentityUpdatesResponse_Response) Reset

func (*GetIdentityUpdatesResponse_Response) String

type GetInboxIdsRequest

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

Request to retrieve the XIDs for the given addresses

func (*GetInboxIdsRequest) Descriptor deprecated

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

Deprecated: Use GetInboxIdsRequest.ProtoReflect.Descriptor instead.

func (*GetInboxIdsRequest) GetRequests

func (x *GetInboxIdsRequest) GetRequests() []*GetInboxIdsRequest_Request

func (*GetInboxIdsRequest) ProtoMessage

func (*GetInboxIdsRequest) ProtoMessage()

func (*GetInboxIdsRequest) ProtoReflect

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

func (*GetInboxIdsRequest) Reset

func (x *GetInboxIdsRequest) Reset()

func (*GetInboxIdsRequest) String

func (x *GetInboxIdsRequest) String() string

type GetInboxIdsRequest_Request

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

A single request for a given address

func (*GetInboxIdsRequest_Request) Descriptor deprecated

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

Deprecated: Use GetInboxIdsRequest_Request.ProtoReflect.Descriptor instead.

func (*GetInboxIdsRequest_Request) GetAddress

func (x *GetInboxIdsRequest_Request) GetAddress() string

func (*GetInboxIdsRequest_Request) ProtoMessage

func (*GetInboxIdsRequest_Request) ProtoMessage()

func (*GetInboxIdsRequest_Request) ProtoReflect

func (*GetInboxIdsRequest_Request) Reset

func (x *GetInboxIdsRequest_Request) Reset()

func (*GetInboxIdsRequest_Request) String

func (x *GetInboxIdsRequest_Request) String() string

type GetInboxIdsResponse

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

Response with the XIDs for the requested addresses

func (*GetInboxIdsResponse) Descriptor deprecated

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

Deprecated: Use GetInboxIdsResponse.ProtoReflect.Descriptor instead.

func (*GetInboxIdsResponse) GetResponses

func (*GetInboxIdsResponse) ProtoMessage

func (*GetInboxIdsResponse) ProtoMessage()

func (*GetInboxIdsResponse) ProtoReflect

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

func (*GetInboxIdsResponse) Reset

func (x *GetInboxIdsResponse) Reset()

func (*GetInboxIdsResponse) String

func (x *GetInboxIdsResponse) String() string

type GetInboxIdsResponse_Response

type GetInboxIdsResponse_Response struct {
	Address string  `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
	InboxId *string `protobuf:"bytes,2,opt,name=inbox_id,json=inboxId,proto3,oneof" json:"inbox_id,omitempty"`
	// contains filtered or unexported fields
}

A single response for a given address

func (*GetInboxIdsResponse_Response) Descriptor deprecated

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

Deprecated: Use GetInboxIdsResponse_Response.ProtoReflect.Descriptor instead.

func (*GetInboxIdsResponse_Response) GetAddress

func (x *GetInboxIdsResponse_Response) GetAddress() string

func (*GetInboxIdsResponse_Response) GetInboxId

func (x *GetInboxIdsResponse_Response) GetInboxId() string

func (*GetInboxIdsResponse_Response) ProtoMessage

func (*GetInboxIdsResponse_Response) ProtoMessage()

func (*GetInboxIdsResponse_Response) ProtoReflect

func (*GetInboxIdsResponse_Response) Reset

func (x *GetInboxIdsResponse_Response) Reset()

func (*GetInboxIdsResponse_Response) String

type IdentityApiClient

type IdentityApiClient interface {
	// Publishes an identity update for an XID or wallet. An identity update may
	// consist of multiple identity actions that have been batch signed.
	PublishIdentityUpdate(ctx context.Context, in *PublishIdentityUpdateRequest, opts ...grpc.CallOption) (*PublishIdentityUpdateResponse, error)
	// Used to check for changes related to members of a group.
	// Would return an array of any new installations associated with the wallet
	// address, and any revocations that have happened.
	GetIdentityUpdates(ctx context.Context, in *GetIdentityUpdatesRequest, opts ...grpc.CallOption) (*GetIdentityUpdatesResponse, error)
	// Retrieve the XIDs for the given addresses
	GetInboxIds(ctx context.Context, in *GetInboxIdsRequest, opts ...grpc.CallOption) (*GetInboxIdsResponse, error)
}

IdentityApiClient is the client API for IdentityApi 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.

type IdentityApiServer

type IdentityApiServer interface {
	// Publishes an identity update for an XID or wallet. An identity update may
	// consist of multiple identity actions that have been batch signed.
	PublishIdentityUpdate(context.Context, *PublishIdentityUpdateRequest) (*PublishIdentityUpdateResponse, error)
	// Used to check for changes related to members of a group.
	// Would return an array of any new installations associated with the wallet
	// address, and any revocations that have happened.
	GetIdentityUpdates(context.Context, *GetIdentityUpdatesRequest) (*GetIdentityUpdatesResponse, error)
	// Retrieve the XIDs for the given addresses
	GetInboxIds(context.Context, *GetInboxIdsRequest) (*GetInboxIdsResponse, error)
	// contains filtered or unexported methods
}

IdentityApiServer is the server API for IdentityApi service. All implementations must embed UnimplementedIdentityApiServer for forward compatibility

type PublishIdentityUpdateRequest

type PublishIdentityUpdateRequest struct {
	IdentityUpdate *associations.IdentityUpdate `protobuf:"bytes,1,opt,name=identity_update,json=identityUpdate,proto3" json:"identity_update,omitempty"`
	// contains filtered or unexported fields
}

Publishes an identity update to the network

func (*PublishIdentityUpdateRequest) Descriptor deprecated

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

Deprecated: Use PublishIdentityUpdateRequest.ProtoReflect.Descriptor instead.

func (*PublishIdentityUpdateRequest) GetIdentityUpdate

func (*PublishIdentityUpdateRequest) ProtoMessage

func (*PublishIdentityUpdateRequest) ProtoMessage()

func (*PublishIdentityUpdateRequest) ProtoReflect

func (*PublishIdentityUpdateRequest) Reset

func (x *PublishIdentityUpdateRequest) Reset()

func (*PublishIdentityUpdateRequest) String

type PublishIdentityUpdateResponse

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

The response when an identity update is published

func (*PublishIdentityUpdateResponse) Descriptor deprecated

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

Deprecated: Use PublishIdentityUpdateResponse.ProtoReflect.Descriptor instead.

func (*PublishIdentityUpdateResponse) ProtoMessage

func (*PublishIdentityUpdateResponse) ProtoMessage()

func (*PublishIdentityUpdateResponse) ProtoReflect

func (*PublishIdentityUpdateResponse) Reset

func (x *PublishIdentityUpdateResponse) Reset()

func (*PublishIdentityUpdateResponse) String

type UnimplementedIdentityApiServer

type UnimplementedIdentityApiServer struct {
}

UnimplementedIdentityApiServer must be embedded to have forward compatible implementations.

func (UnimplementedIdentityApiServer) GetIdentityUpdates

func (UnimplementedIdentityApiServer) GetInboxIds

type UnsafeIdentityApiServer

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

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

Jump to

Keyboard shortcuts

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