Documentation ¶
Overview ¶
Package protobuf is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterSigninHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterSigninHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SigninClient) error
- func RegisterSigninHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterSigninHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SigninServer) error
- func RegisterSigninServer(s grpc.ServiceRegistrar, srv SigninServer)
- type RegisterRequest
- func (*RegisterRequest) Descriptor() ([]byte, []int)deprecated
- func (x *RegisterRequest) GetBirthday() string
- func (x *RegisterRequest) GetEmail() string
- func (x *RegisterRequest) GetFirstname() string
- func (x *RegisterRequest) GetLastname() string
- func (x *RegisterRequest) GetPassword() string
- func (*RegisterRequest) ProtoMessage()
- func (x *RegisterRequest) ProtoReflect() protoreflect.Message
- func (x *RegisterRequest) Reset()
- func (x *RegisterRequest) String() string
- type SigninClient
- type SigninServer
- type UnimplementedSigninServer
- type UnsafeSigninServer
- type ValidateSigninRequest
- func (*ValidateSigninRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ValidateSigninRequest) GetId() string
- func (x *ValidateSigninRequest) GetValidationToken() string
- func (*ValidateSigninRequest) ProtoMessage()
- func (x *ValidateSigninRequest) ProtoReflect() protoreflect.Message
- func (x *ValidateSigninRequest) Reset()
- func (x *ValidateSigninRequest) String() string
Constants ¶
const ( Signin_Register_FullMethodName = "/go.micro.service.signin.Signin/Register" Signin_Validate_FullMethodName = "/go.micro.service.signin.Signin/Validate" )
Variables ¶
var File_services_signin_protobuf_signin_proto protoreflect.FileDescriptor
var Signin_ServiceDesc = grpc.ServiceDesc{ ServiceName: "go.micro.service.signin.Signin", HandlerType: (*SigninServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Register", Handler: _Signin_Register_Handler, }, { MethodName: "Validate", Handler: _Signin_Validate_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "services/signin/protobuf/signin.proto", }
Signin_ServiceDesc is the grpc.ServiceDesc for Signin service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterSigninHandler ¶
RegisterSigninHandler registers the http handlers for service Signin to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterSigninHandlerClient ¶
func RegisterSigninHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SigninClient) error
RegisterSigninHandlerClient registers the http handlers for service Signin to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "SigninClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "SigninClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "SigninClient" to call the correct interceptors.
func RegisterSigninHandlerFromEndpoint ¶
func RegisterSigninHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterSigninHandlerFromEndpoint is same as RegisterSigninHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterSigninHandlerServer ¶
func RegisterSigninHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SigninServer) error
RegisterSigninHandlerServer registers the http handlers for service Signin to "mux". UnaryRPC :call SigninServer 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 RegisterSigninHandlerFromEndpoint instead.
func RegisterSigninServer ¶
func RegisterSigninServer(s grpc.ServiceRegistrar, srv SigninServer)
Types ¶
type RegisterRequest ¶
type RegisterRequest struct { Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email" db:"email" validate:"required,email"` // @gotags: json:"email" db:"email" validate:"required,email"` Firstname string `protobuf:"bytes,2,opt,name=firstname,proto3" json:"firstname" db:"firstname" validate:"required,alphanumunicode"` // @gotags: json:"firstname" db:"firstname" validate:"required,alphanumunicode"` Lastname string `protobuf:"bytes,3,opt,name=lastname,proto3" json:"lastname" db:"lastname" validate:"required,alphanumunicode"` // @gotags: json:"lastname" db:"lastname" validate:"required,alphanumunicode"` Birthday string `protobuf:"bytes,4,opt,name=birthday,proto3" json:"birthday" db:"birthday" validate:"required"` // @gotags: json:"birthday" db:"birthday" validate:"required"` Password string `protobuf:"bytes,5,opt,name=password,proto3" json:"password" db:"password" validate:"required,alphanumunicode"` // @gotags: json:"password" db:"password" validate:"required,alphanumunicode"` // contains filtered or unexported fields }
func (*RegisterRequest) Descriptor
deprecated
func (*RegisterRequest) Descriptor() ([]byte, []int)
Deprecated: Use RegisterRequest.ProtoReflect.Descriptor instead.
func (*RegisterRequest) GetBirthday ¶
func (x *RegisterRequest) GetBirthday() string
func (*RegisterRequest) GetEmail ¶
func (x *RegisterRequest) GetEmail() string
func (*RegisterRequest) GetFirstname ¶
func (x *RegisterRequest) GetFirstname() string
func (*RegisterRequest) GetLastname ¶
func (x *RegisterRequest) GetLastname() string
func (*RegisterRequest) GetPassword ¶
func (x *RegisterRequest) GetPassword() string
func (*RegisterRequest) ProtoMessage ¶
func (*RegisterRequest) ProtoMessage()
func (*RegisterRequest) ProtoReflect ¶
func (x *RegisterRequest) ProtoReflect() protoreflect.Message
func (*RegisterRequest) Reset ¶
func (x *RegisterRequest) Reset()
func (*RegisterRequest) String ¶
func (x *RegisterRequest) String() string
type SigninClient ¶
type SigninClient interface { Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*protobuf.Response, error) Validate(ctx context.Context, in *ValidateSigninRequest, opts ...grpc.CallOption) (*protobuf.Response, error) }
SigninClient is the client API for Signin 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 NewSigninClient ¶
func NewSigninClient(cc grpc.ClientConnInterface) SigninClient
type SigninServer ¶
type SigninServer interface { Register(context.Context, *RegisterRequest) (*protobuf.Response, error) Validate(context.Context, *ValidateSigninRequest) (*protobuf.Response, error) // contains filtered or unexported methods }
SigninServer is the server API for Signin service. All implementations must embed UnimplementedSigninServer for forward compatibility
type UnimplementedSigninServer ¶
type UnimplementedSigninServer struct { }
UnimplementedSigninServer must be embedded to have forward compatible implementations.
func (UnimplementedSigninServer) Register ¶
func (UnimplementedSigninServer) Register(context.Context, *RegisterRequest) (*protobuf.Response, error)
func (UnimplementedSigninServer) Validate ¶
func (UnimplementedSigninServer) Validate(context.Context, *ValidateSigninRequest) (*protobuf.Response, error)
type UnsafeSigninServer ¶
type UnsafeSigninServer interface {
// contains filtered or unexported methods
}
UnsafeSigninServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to SigninServer will result in compilation errors.
type ValidateSigninRequest ¶
type ValidateSigninRequest struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" db:"id" validate:"required,uuid4_rfc4122"` // @gotags: json:"id" db:"id" validate:"required,uuid4_rfc4122"` ValidationToken string `protobuf:"bytes,2,opt,name=validation_token,json=validationToken,proto3" json:"validation_token" db:"validation_token"` // @gotags: json:"validation_token" db:"validation_token" // contains filtered or unexported fields }
func (*ValidateSigninRequest) Descriptor
deprecated
func (*ValidateSigninRequest) Descriptor() ([]byte, []int)
Deprecated: Use ValidateSigninRequest.ProtoReflect.Descriptor instead.
func (*ValidateSigninRequest) GetId ¶
func (x *ValidateSigninRequest) GetId() string
func (*ValidateSigninRequest) GetValidationToken ¶
func (x *ValidateSigninRequest) GetValidationToken() string
func (*ValidateSigninRequest) ProtoMessage ¶
func (*ValidateSigninRequest) ProtoMessage()
func (*ValidateSigninRequest) ProtoReflect ¶
func (x *ValidateSigninRequest) ProtoReflect() protoreflect.Message
func (*ValidateSigninRequest) Reset ¶
func (x *ValidateSigninRequest) Reset()
func (*ValidateSigninRequest) String ¶
func (x *ValidateSigninRequest) String() string