Documentation ¶
Index ¶
- Variables
- func RegisterGcpServiceServer(s grpc.ServiceRegistrar, srv GcpServiceServer)
- type CreatePrefixRequest
- func (*CreatePrefixRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreatePrefixRequest) GetPrefix() string
- func (x *CreatePrefixRequest) GetStartNumber() int64
- func (*CreatePrefixRequest) ProtoMessage()
- func (x *CreatePrefixRequest) ProtoReflect() protoreflect.Message
- func (x *CreatePrefixRequest) Reset()
- func (x *CreatePrefixRequest) String() string
- type GcpServiceClient
- type GcpServiceServer
- type GetSerialNumberRequest
- func (*GetSerialNumberRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetSerialNumberRequest) GetPrefix() string
- func (*GetSerialNumberRequest) ProtoMessage()
- func (x *GetSerialNumberRequest) ProtoReflect() protoreflect.Message
- func (x *GetSerialNumberRequest) Reset()
- func (x *GetSerialNumberRequest) String() string
- type SerialNumberRespose
- func (*SerialNumberRespose) Descriptor() ([]byte, []int)deprecated
- func (x *SerialNumberRespose) GetPrefix() string
- func (x *SerialNumberRespose) GetSerialNumber() int64
- func (*SerialNumberRespose) ProtoMessage()
- func (x *SerialNumberRespose) ProtoReflect() protoreflect.Message
- func (x *SerialNumberRespose) Reset()
- func (x *SerialNumberRespose) String() string
- type UnimplementedGcpServiceServer
- func (UnimplementedGcpServiceServer) ClearPrefix(context.Context, *GetSerialNumberRequest) (*emptypb.Empty, error)
- func (UnimplementedGcpServiceServer) CreatePrefix(context.Context, *CreatePrefixRequest) (*emptypb.Empty, error)
- func (UnimplementedGcpServiceServer) GetSerialNumber(context.Context, *GetSerialNumberRequest) (*SerialNumberRespose, error)
- func (UnimplementedGcpServiceServer) UpdateStartNumber(context.Context, *CreatePrefixRequest) (*emptypb.Empty, error)
- type UnsafeGcpServiceServer
Constants ¶
This section is empty.
Variables ¶
var File_grpc_proto_gcp_proto protoreflect.FileDescriptor
var GcpService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "serial_number.GcpService", HandlerType: (*GcpServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CreatePrefix", Handler: _GcpService_CreatePrefix_Handler, }, { MethodName: "UpdateStartNumber", Handler: _GcpService_UpdateStartNumber_Handler, }, { MethodName: "GetSerialNumber", Handler: _GcpService_GetSerialNumber_Handler, }, { MethodName: "ClearPrefix", Handler: _GcpService_ClearPrefix_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "grpc/proto/gcp.proto", }
GcpService_ServiceDesc is the grpc.ServiceDesc for GcpService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterGcpServiceServer ¶
func RegisterGcpServiceServer(s grpc.ServiceRegistrar, srv GcpServiceServer)
Types ¶
type CreatePrefixRequest ¶
type CreatePrefixRequest struct { Prefix string `protobuf:"bytes,1,opt,name=prefix,proto3" json:"prefix,omitempty"` StartNumber int64 `protobuf:"varint,2,opt,name=start_number,json=startNumber,proto3" json:"start_number,omitempty"` // contains filtered or unexported fields }
func (*CreatePrefixRequest) Descriptor
deprecated
func (*CreatePrefixRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreatePrefixRequest.ProtoReflect.Descriptor instead.
func (*CreatePrefixRequest) GetPrefix ¶
func (x *CreatePrefixRequest) GetPrefix() string
func (*CreatePrefixRequest) GetStartNumber ¶
func (x *CreatePrefixRequest) GetStartNumber() int64
func (*CreatePrefixRequest) ProtoMessage ¶
func (*CreatePrefixRequest) ProtoMessage()
func (*CreatePrefixRequest) ProtoReflect ¶
func (x *CreatePrefixRequest) ProtoReflect() protoreflect.Message
func (*CreatePrefixRequest) Reset ¶
func (x *CreatePrefixRequest) Reset()
func (*CreatePrefixRequest) String ¶
func (x *CreatePrefixRequest) String() string
type GcpServiceClient ¶
type GcpServiceClient interface { // 建立前綴 CreatePrefix(ctx context.Context, in *CreatePrefixRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) // 更新序號 UpdateStartNumber(ctx context.Context, in *CreatePrefixRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) // 取得序號 GetSerialNumber(ctx context.Context, in *GetSerialNumberRequest, opts ...grpc.CallOption) (*SerialNumberRespose, error) // 清除前綴 ClearPrefix(ctx context.Context, in *GetSerialNumberRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) }
GcpServiceClient is the client API for GcpService 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 NewGcpServiceClient ¶
func NewGcpServiceClient(cc grpc.ClientConnInterface) GcpServiceClient
type GcpServiceServer ¶
type GcpServiceServer interface { // 建立前綴 CreatePrefix(context.Context, *CreatePrefixRequest) (*emptypb.Empty, error) // 更新序號 UpdateStartNumber(context.Context, *CreatePrefixRequest) (*emptypb.Empty, error) // 取得序號 GetSerialNumber(context.Context, *GetSerialNumberRequest) (*SerialNumberRespose, error) // 清除前綴 ClearPrefix(context.Context, *GetSerialNumberRequest) (*emptypb.Empty, error) // contains filtered or unexported methods }
GcpServiceServer is the server API for GcpService service. All implementations must embed UnimplementedGcpServiceServer for forward compatibility
type GetSerialNumberRequest ¶
type GetSerialNumberRequest struct { Prefix string `protobuf:"bytes,1,opt,name=prefix,proto3" json:"prefix,omitempty"` // contains filtered or unexported fields }
func (*GetSerialNumberRequest) Descriptor
deprecated
func (*GetSerialNumberRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetSerialNumberRequest.ProtoReflect.Descriptor instead.
func (*GetSerialNumberRequest) GetPrefix ¶
func (x *GetSerialNumberRequest) GetPrefix() string
func (*GetSerialNumberRequest) ProtoMessage ¶
func (*GetSerialNumberRequest) ProtoMessage()
func (*GetSerialNumberRequest) ProtoReflect ¶
func (x *GetSerialNumberRequest) ProtoReflect() protoreflect.Message
func (*GetSerialNumberRequest) Reset ¶
func (x *GetSerialNumberRequest) Reset()
func (*GetSerialNumberRequest) String ¶
func (x *GetSerialNumberRequest) String() string
type SerialNumberRespose ¶
type SerialNumberRespose struct { Prefix string `protobuf:"bytes,1,opt,name=prefix,proto3" json:"prefix,omitempty"` SerialNumber int64 `protobuf:"varint,2,opt,name=serial_number,json=serialNumber,proto3" json:"serial_number,omitempty"` // contains filtered or unexported fields }
func (*SerialNumberRespose) Descriptor
deprecated
func (*SerialNumberRespose) Descriptor() ([]byte, []int)
Deprecated: Use SerialNumberRespose.ProtoReflect.Descriptor instead.
func (*SerialNumberRespose) GetPrefix ¶
func (x *SerialNumberRespose) GetPrefix() string
func (*SerialNumberRespose) GetSerialNumber ¶
func (x *SerialNumberRespose) GetSerialNumber() int64
func (*SerialNumberRespose) ProtoMessage ¶
func (*SerialNumberRespose) ProtoMessage()
func (*SerialNumberRespose) ProtoReflect ¶
func (x *SerialNumberRespose) ProtoReflect() protoreflect.Message
func (*SerialNumberRespose) Reset ¶
func (x *SerialNumberRespose) Reset()
func (*SerialNumberRespose) String ¶
func (x *SerialNumberRespose) String() string
type UnimplementedGcpServiceServer ¶
type UnimplementedGcpServiceServer struct { }
UnimplementedGcpServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedGcpServiceServer) ClearPrefix ¶
func (UnimplementedGcpServiceServer) ClearPrefix(context.Context, *GetSerialNumberRequest) (*emptypb.Empty, error)
func (UnimplementedGcpServiceServer) CreatePrefix ¶
func (UnimplementedGcpServiceServer) CreatePrefix(context.Context, *CreatePrefixRequest) (*emptypb.Empty, error)
func (UnimplementedGcpServiceServer) GetSerialNumber ¶
func (UnimplementedGcpServiceServer) GetSerialNumber(context.Context, *GetSerialNumberRequest) (*SerialNumberRespose, error)
func (UnimplementedGcpServiceServer) UpdateStartNumber ¶
func (UnimplementedGcpServiceServer) UpdateStartNumber(context.Context, *CreatePrefixRequest) (*emptypb.Empty, error)
type UnsafeGcpServiceServer ¶
type UnsafeGcpServiceServer interface {
// contains filtered or unexported methods
}
UnsafeGcpServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to GcpServiceServer will result in compilation errors.