replicationtypes

package
v2.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2024 License: Apache-2.0, MIT Imports: 19 Imported by: 2

Documentation

Overview

Package replicationtypes is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	ReplicationService_ReplicateGroup_FullMethodName       = "/weshnet.replication.v1.ReplicationService/ReplicateGroup"
	ReplicationService_ReplicateGlobalStats_FullMethodName = "/weshnet.replication.v1.ReplicationService/ReplicateGlobalStats"
	ReplicationService_ReplicateGroupStats_FullMethodName  = "/weshnet.replication.v1.ReplicationService/ReplicateGroupStats"
)
View Source
const (
	ServiceReplicationRegisteredPrefix = "user_registration"
	ServiceReplicationKeyGroupPrefix   = "group"
)

Variables

View Source
var File_replicationtypes_bertyreplication_proto protoreflect.FileDescriptor
View Source
var ReplicationService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "weshnet.replication.v1.ReplicationService",
	HandlerType: (*ReplicationServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ReplicateGroup",
			Handler:    _ReplicationService_ReplicateGroup_Handler,
		},
		{
			MethodName: "ReplicateGlobalStats",
			Handler:    _ReplicationService_ReplicateGlobalStats_Handler,
		},
		{
			MethodName: "ReplicateGroupStats",
			Handler:    _ReplicationService_ReplicateGroupStats_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "replicationtypes/bertyreplication.proto",
}

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

Functions

func RegisterReplicationServiceHandler

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

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

func RegisterReplicationServiceHandlerClient

func RegisterReplicationServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ReplicationServiceClient) error

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

func RegisterReplicationServiceHandlerFromEndpoint

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

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

func RegisterReplicationServiceHandlerServer

func RegisterReplicationServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ReplicationServiceServer) error

RegisterReplicationServiceHandlerServer registers the http handlers for service ReplicationService to "mux". UnaryRPC :call ReplicationServiceServer 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 RegisterReplicationServiceHandlerFromEndpoint instead.

func RegisterReplicationServiceServer

func RegisterReplicationServiceServer(s grpc.ServiceRegistrar, srv ReplicationServiceServer)

Types

type ReplicateGlobalStats

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

func (*ReplicateGlobalStats) Descriptor deprecated

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

Deprecated: Use ReplicateGlobalStats.ProtoReflect.Descriptor instead.

func (*ReplicateGlobalStats) ProtoMessage

func (*ReplicateGlobalStats) ProtoMessage()

func (*ReplicateGlobalStats) ProtoReflect

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

func (*ReplicateGlobalStats) Reset

func (x *ReplicateGlobalStats) Reset()

func (*ReplicateGlobalStats) String

func (x *ReplicateGlobalStats) String() string

type ReplicateGlobalStats_Reply

type ReplicateGlobalStats_Reply struct {
	StartedAt            int64 `protobuf:"varint,1,opt,name=started_at,json=startedAt,proto3" json:"started_at,omitempty"`
	ReplicatedGroups     int64 `protobuf:"varint,2,opt,name=replicated_groups,json=replicatedGroups,proto3" json:"replicated_groups,omitempty"`
	TotalMetadataEntries int64 `protobuf:"varint,3,opt,name=total_metadata_entries,json=totalMetadataEntries,proto3" json:"total_metadata_entries,omitempty"`
	TotalMessageEntries  int64 `protobuf:"varint,4,opt,name=total_message_entries,json=totalMessageEntries,proto3" json:"total_message_entries,omitempty"`
	// contains filtered or unexported fields
}

func (*ReplicateGlobalStats_Reply) Descriptor deprecated

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

Deprecated: Use ReplicateGlobalStats_Reply.ProtoReflect.Descriptor instead.

func (*ReplicateGlobalStats_Reply) GetReplicatedGroups

func (x *ReplicateGlobalStats_Reply) GetReplicatedGroups() int64

func (*ReplicateGlobalStats_Reply) GetStartedAt

func (x *ReplicateGlobalStats_Reply) GetStartedAt() int64

func (*ReplicateGlobalStats_Reply) GetTotalMessageEntries

func (x *ReplicateGlobalStats_Reply) GetTotalMessageEntries() int64

func (*ReplicateGlobalStats_Reply) GetTotalMetadataEntries

func (x *ReplicateGlobalStats_Reply) GetTotalMetadataEntries() int64

func (*ReplicateGlobalStats_Reply) ProtoMessage

func (*ReplicateGlobalStats_Reply) ProtoMessage()

func (*ReplicateGlobalStats_Reply) ProtoReflect

func (*ReplicateGlobalStats_Reply) Reset

func (x *ReplicateGlobalStats_Reply) Reset()

func (*ReplicateGlobalStats_Reply) String

func (x *ReplicateGlobalStats_Reply) String() string

type ReplicateGlobalStats_Request

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

func (*ReplicateGlobalStats_Request) Descriptor deprecated

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

Deprecated: Use ReplicateGlobalStats_Request.ProtoReflect.Descriptor instead.

func (*ReplicateGlobalStats_Request) ProtoMessage

func (*ReplicateGlobalStats_Request) ProtoMessage()

func (*ReplicateGlobalStats_Request) ProtoReflect

func (*ReplicateGlobalStats_Request) Reset

func (x *ReplicateGlobalStats_Request) Reset()

func (*ReplicateGlobalStats_Request) String

type ReplicateGroupStats

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

func (*ReplicateGroupStats) Descriptor deprecated

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

Deprecated: Use ReplicateGroupStats.ProtoReflect.Descriptor instead.

func (*ReplicateGroupStats) ProtoMessage

func (*ReplicateGroupStats) ProtoMessage()

func (*ReplicateGroupStats) ProtoReflect

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

func (*ReplicateGroupStats) Reset

func (x *ReplicateGroupStats) Reset()

func (*ReplicateGroupStats) String

func (x *ReplicateGroupStats) String() string

type ReplicateGroupStats_Reply

type ReplicateGroupStats_Reply struct {
	Group *ReplicatedGroup `protobuf:"bytes,1,opt,name=group,proto3" json:"group,omitempty"`
	// contains filtered or unexported fields
}

func (*ReplicateGroupStats_Reply) Descriptor deprecated

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

Deprecated: Use ReplicateGroupStats_Reply.ProtoReflect.Descriptor instead.

func (*ReplicateGroupStats_Reply) GetGroup

func (*ReplicateGroupStats_Reply) ProtoMessage

func (*ReplicateGroupStats_Reply) ProtoMessage()

func (*ReplicateGroupStats_Reply) ProtoReflect

func (*ReplicateGroupStats_Reply) Reset

func (x *ReplicateGroupStats_Reply) Reset()

func (*ReplicateGroupStats_Reply) String

func (x *ReplicateGroupStats_Reply) String() string

type ReplicateGroupStats_Request

type ReplicateGroupStats_Request struct {
	GroupPublicKey string `protobuf:"bytes,1,opt,name=group_public_key,json=groupPublicKey,proto3" json:"group_public_key,omitempty"`
	// contains filtered or unexported fields
}

func (*ReplicateGroupStats_Request) Descriptor deprecated

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

Deprecated: Use ReplicateGroupStats_Request.ProtoReflect.Descriptor instead.

func (*ReplicateGroupStats_Request) GetGroupPublicKey

func (x *ReplicateGroupStats_Request) GetGroupPublicKey() string

func (*ReplicateGroupStats_Request) ProtoMessage

func (*ReplicateGroupStats_Request) ProtoMessage()

func (*ReplicateGroupStats_Request) ProtoReflect

func (*ReplicateGroupStats_Request) Reset

func (x *ReplicateGroupStats_Request) Reset()

func (*ReplicateGroupStats_Request) String

func (x *ReplicateGroupStats_Request) String() string

type ReplicatedGroup

type ReplicatedGroup struct {
	PublicKey            string `protobuf:"bytes,1,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty" gorm:"primaryKey"`
	SignPub              string `protobuf:"bytes,2,opt,name=sign_pub,json=signPub,proto3" json:"sign_pub,omitempty"`
	LinkKey              string `protobuf:"bytes,3,opt,name=link_key,json=linkKey,proto3" json:"link_key,omitempty"`
	CreatedAt            int64  `protobuf:"varint,100,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	UpdatedAt            int64  `protobuf:"varint,101,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
	MetadataEntriesCount int64  `` /* 126-byte string literal not displayed */
	MetadataLatestHead   string `protobuf:"bytes,103,opt,name=metadata_latest_head,json=metadataLatestHead,proto3" json:"metadata_latest_head,omitempty"`
	MessageEntriesCount  int64  `protobuf:"varint,104,opt,name=message_entries_count,json=messageEntriesCount,proto3" json:"message_entries_count,omitempty"`
	MessageLatestHead    string `protobuf:"bytes,105,opt,name=message_latest_head,json=messageLatestHead,proto3" json:"message_latest_head,omitempty"`
	// contains filtered or unexported fields
}

func (*ReplicatedGroup) Descriptor deprecated

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

Deprecated: Use ReplicatedGroup.ProtoReflect.Descriptor instead.

func (*ReplicatedGroup) GetCreatedAt

func (x *ReplicatedGroup) GetCreatedAt() int64

func (*ReplicatedGroup) GetLinkKey

func (x *ReplicatedGroup) GetLinkKey() string

func (*ReplicatedGroup) GetMessageEntriesCount

func (x *ReplicatedGroup) GetMessageEntriesCount() int64

func (*ReplicatedGroup) GetMessageLatestHead

func (x *ReplicatedGroup) GetMessageLatestHead() string

func (*ReplicatedGroup) GetMetadataEntriesCount

func (x *ReplicatedGroup) GetMetadataEntriesCount() int64

func (*ReplicatedGroup) GetMetadataLatestHead

func (x *ReplicatedGroup) GetMetadataLatestHead() string

func (*ReplicatedGroup) GetPublicKey

func (x *ReplicatedGroup) GetPublicKey() string

func (*ReplicatedGroup) GetSignPub

func (x *ReplicatedGroup) GetSignPub() string

func (*ReplicatedGroup) GetUpdatedAt

func (x *ReplicatedGroup) GetUpdatedAt() int64

func (*ReplicatedGroup) ProtoMessage

func (*ReplicatedGroup) ProtoMessage()

func (*ReplicatedGroup) ProtoReflect

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

func (*ReplicatedGroup) Reset

func (x *ReplicatedGroup) Reset()

func (*ReplicatedGroup) String

func (x *ReplicatedGroup) String() string

func (*ReplicatedGroup) ToGroup

func (m *ReplicatedGroup) ToGroup() (*protocoltypes.Group, error)

type ReplicatedGroupToken

type ReplicatedGroupToken struct {
	ReplicatedGroupPublicKey string           `` /* 181-byte string literal not displayed */
	ReplicatedGroup          *ReplicatedGroup `protobuf:"bytes,2,opt,name=replicated_group,json=replicatedGroup,proto3" json:"replicated_group,omitempty"`
	TokenIssuer              string           `` /* 132-byte string literal not displayed */
	TokenId                  string           `protobuf:"bytes,4,opt,name=token_id,json=tokenId,proto3" json:"token_id,omitempty" gorm:"primaryKey;autoIncrement:false"`
	CreatedAt                int64            `protobuf:"varint,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	// contains filtered or unexported fields
}

func (*ReplicatedGroupToken) Descriptor deprecated

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

Deprecated: Use ReplicatedGroupToken.ProtoReflect.Descriptor instead.

func (*ReplicatedGroupToken) GetCreatedAt

func (x *ReplicatedGroupToken) GetCreatedAt() int64

func (*ReplicatedGroupToken) GetReplicatedGroup

func (x *ReplicatedGroupToken) GetReplicatedGroup() *ReplicatedGroup

func (*ReplicatedGroupToken) GetReplicatedGroupPublicKey

func (x *ReplicatedGroupToken) GetReplicatedGroupPublicKey() string

func (*ReplicatedGroupToken) GetTokenId

func (x *ReplicatedGroupToken) GetTokenId() string

func (*ReplicatedGroupToken) GetTokenIssuer

func (x *ReplicatedGroupToken) GetTokenIssuer() string

func (*ReplicatedGroupToken) ProtoMessage

func (*ReplicatedGroupToken) ProtoMessage()

func (*ReplicatedGroupToken) ProtoReflect

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

func (*ReplicatedGroupToken) Reset

func (x *ReplicatedGroupToken) Reset()

func (*ReplicatedGroupToken) String

func (x *ReplicatedGroupToken) String() string

type ReplicationServiceClient

type ReplicationServiceClient interface {
	// ReplicateGroup
	ReplicateGroup(ctx context.Context, in *ReplicationServiceReplicateGroup_Request, opts ...grpc.CallOption) (*ReplicationServiceReplicateGroup_Reply, error)
	ReplicateGlobalStats(ctx context.Context, in *ReplicateGlobalStats_Request, opts ...grpc.CallOption) (*ReplicateGlobalStats_Reply, error)
	ReplicateGroupStats(ctx context.Context, in *ReplicateGroupStats_Request, opts ...grpc.CallOption) (*ReplicateGroupStats_Reply, error)
}

ReplicationServiceClient is the client API for ReplicationService 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.

ReplicationService

type ReplicationServiceReplicateGroup

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

func (*ReplicationServiceReplicateGroup) Descriptor deprecated

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

Deprecated: Use ReplicationServiceReplicateGroup.ProtoReflect.Descriptor instead.

func (*ReplicationServiceReplicateGroup) ProtoMessage

func (*ReplicationServiceReplicateGroup) ProtoMessage()

func (*ReplicationServiceReplicateGroup) ProtoReflect

func (*ReplicationServiceReplicateGroup) Reset

func (*ReplicationServiceReplicateGroup) String

type ReplicationServiceReplicateGroup_Reply

type ReplicationServiceReplicateGroup_Reply struct {
	Ok bool `protobuf:"varint,1,opt,name=ok,proto3" json:"ok,omitempty"`
	// contains filtered or unexported fields
}

func (*ReplicationServiceReplicateGroup_Reply) Descriptor deprecated

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

Deprecated: Use ReplicationServiceReplicateGroup_Reply.ProtoReflect.Descriptor instead.

func (*ReplicationServiceReplicateGroup_Reply) GetOk

func (*ReplicationServiceReplicateGroup_Reply) ProtoMessage

func (*ReplicationServiceReplicateGroup_Reply) ProtoReflect

func (*ReplicationServiceReplicateGroup_Reply) Reset

func (*ReplicationServiceReplicateGroup_Reply) String

type ReplicationServiceReplicateGroup_Request

type ReplicationServiceReplicateGroup_Request struct {
	Group *protocoltypes.Group `protobuf:"bytes,1,opt,name=group,proto3" json:"group,omitempty"`
	// contains filtered or unexported fields
}

func (*ReplicationServiceReplicateGroup_Request) Descriptor deprecated

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

Deprecated: Use ReplicationServiceReplicateGroup_Request.ProtoReflect.Descriptor instead.

func (*ReplicationServiceReplicateGroup_Request) GetGroup

func (*ReplicationServiceReplicateGroup_Request) ProtoMessage

func (*ReplicationServiceReplicateGroup_Request) ProtoReflect

func (*ReplicationServiceReplicateGroup_Request) Reset

func (*ReplicationServiceReplicateGroup_Request) String

type ReplicationServiceServer

type ReplicationServiceServer interface {
	// ReplicateGroup
	ReplicateGroup(context.Context, *ReplicationServiceReplicateGroup_Request) (*ReplicationServiceReplicateGroup_Reply, error)
	ReplicateGlobalStats(context.Context, *ReplicateGlobalStats_Request) (*ReplicateGlobalStats_Reply, error)
	ReplicateGroupStats(context.Context, *ReplicateGroupStats_Request) (*ReplicateGroupStats_Reply, error)
	// contains filtered or unexported methods
}

ReplicationServiceServer is the server API for ReplicationService service. All implementations must embed UnimplementedReplicationServiceServer for forward compatibility.

ReplicationService

type UnimplementedReplicationServiceServer

type UnimplementedReplicationServiceServer struct{}

UnimplementedReplicationServiceServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedReplicationServiceServer) ReplicateGlobalStats

func (UnimplementedReplicationServiceServer) ReplicateGroupStats

type UnsafeReplicationServiceServer

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

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

Jump to

Keyboard shortcuts

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