Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var File_api_v1_snowflake_proto protoreflect.FileDescriptor
var SnowflakeID_ServiceDesc = grpc.ServiceDesc{ ServiceName: "SnowflakeID", HandlerType: (*SnowflakeIDServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "nextID", Handler: _SnowflakeID_NextID_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "nextMultipleIDs", Handler: _SnowflakeID_NextMultipleIDs_Handler, ServerStreams: true, }, }, Metadata: "api/v1/snowflake.proto", }
SnowflakeID_ServiceDesc is the grpc.ServiceDesc for SnowflakeID service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterSnowflakeIDServer ¶
func RegisterSnowflakeIDServer(s grpc.ServiceRegistrar, srv SnowflakeIDServer)
Types ¶
type IDResponse ¶
type IDResponse struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*IDResponse) Descriptor
deprecated
func (*IDResponse) Descriptor() ([]byte, []int)
Deprecated: Use IDResponse.ProtoReflect.Descriptor instead.
func (*IDResponse) GetId ¶
func (x *IDResponse) GetId() int64
func (*IDResponse) ProtoMessage ¶
func (*IDResponse) ProtoMessage()
func (*IDResponse) ProtoReflect ¶
func (x *IDResponse) ProtoReflect() protoreflect.Message
func (*IDResponse) Reset ¶
func (x *IDResponse) Reset()
func (*IDResponse) String ¶
func (x *IDResponse) String() string
type SnowflakeIDClient ¶
type SnowflakeIDClient interface { NextID(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*IDResponse, error) NextMultipleIDs(ctx context.Context, in *wrapperspb.UInt32Value, opts ...grpc.CallOption) (SnowflakeID_NextMultipleIDsClient, error) }
SnowflakeIDClient is the client API for SnowflakeID 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 NewSnowflakeIDClient ¶
func NewSnowflakeIDClient(cc grpc.ClientConnInterface) SnowflakeIDClient
type SnowflakeIDServer ¶
type SnowflakeIDServer interface { NextID(context.Context, *emptypb.Empty) (*IDResponse, error) NextMultipleIDs(*wrapperspb.UInt32Value, SnowflakeID_NextMultipleIDsServer) error // contains filtered or unexported methods }
SnowflakeIDServer is the server API for SnowflakeID service. All implementations must embed UnimplementedSnowflakeIDServer for forward compatibility
type SnowflakeID_NextMultipleIDsClient ¶
type SnowflakeID_NextMultipleIDsClient interface { Recv() (*IDResponse, error) grpc.ClientStream }
type SnowflakeID_NextMultipleIDsServer ¶
type SnowflakeID_NextMultipleIDsServer interface { Send(*IDResponse) error grpc.ServerStream }
type UnimplementedSnowflakeIDServer ¶
type UnimplementedSnowflakeIDServer struct { }
UnimplementedSnowflakeIDServer must be embedded to have forward compatible implementations.
func (UnimplementedSnowflakeIDServer) NextID ¶
func (UnimplementedSnowflakeIDServer) NextID(context.Context, *emptypb.Empty) (*IDResponse, error)
func (UnimplementedSnowflakeIDServer) NextMultipleIDs ¶
func (UnimplementedSnowflakeIDServer) NextMultipleIDs(*wrapperspb.UInt32Value, SnowflakeID_NextMultipleIDsServer) error
type UnsafeSnowflakeIDServer ¶
type UnsafeSnowflakeIDServer interface {
// contains filtered or unexported methods
}
UnsafeSnowflakeIDServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to SnowflakeIDServer will result in compilation errors.