Documentation ¶
Overview ¶
Package v1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterAuthServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterAuthServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AuthServiceClient) error
- func RegisterAuthServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterAuthServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AuthServiceServer) error
- func RegisterAuthServiceServer(s grpc.ServiceRegistrar, srv AuthServiceServer)
- type AuthServiceClient
- type AuthServiceServer
- type GenerateTokenRequest
- func (*GenerateTokenRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GenerateTokenRequest) GetUserId() uint64
- func (*GenerateTokenRequest) ProtoMessage()
- func (x *GenerateTokenRequest) ProtoReflect() protoreflect.Message
- func (x *GenerateTokenRequest) Reset()
- func (x *GenerateTokenRequest) String() string
- type GenerateTokenResponse
- func (*GenerateTokenResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GenerateTokenResponse) GetToken() string
- func (*GenerateTokenResponse) ProtoMessage()
- func (x *GenerateTokenResponse) ProtoReflect() protoreflect.Message
- func (x *GenerateTokenResponse) Reset()
- func (x *GenerateTokenResponse) String() string
- type RefreshTokenRequest
- func (*RefreshTokenRequest) Descriptor() ([]byte, []int)deprecated
- func (x *RefreshTokenRequest) GetToken() string
- func (*RefreshTokenRequest) ProtoMessage()
- func (x *RefreshTokenRequest) ProtoReflect() protoreflect.Message
- func (x *RefreshTokenRequest) Reset()
- func (x *RefreshTokenRequest) String() string
- type RefreshTokenResponse
- func (*RefreshTokenResponse) Descriptor() ([]byte, []int)deprecated
- func (x *RefreshTokenResponse) GetToken() string
- func (*RefreshTokenResponse) ProtoMessage()
- func (x *RefreshTokenResponse) ProtoReflect() protoreflect.Message
- func (x *RefreshTokenResponse) Reset()
- func (x *RefreshTokenResponse) String() string
- type UnimplementedAuthServiceServer
- func (UnimplementedAuthServiceServer) GenerateToken(context.Context, *GenerateTokenRequest) (*GenerateTokenResponse, error)
- func (UnimplementedAuthServiceServer) RefreshToken(context.Context, *RefreshTokenRequest) (*RefreshTokenResponse, error)
- func (UnimplementedAuthServiceServer) ValidateToken(context.Context, *ValidateTokenRequest) (*ValidateTokenResponse, error)
- type UnsafeAuthServiceServer
- type ValidateTokenRequest
- func (*ValidateTokenRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ValidateTokenRequest) GetToken() string
- func (*ValidateTokenRequest) ProtoMessage()
- func (x *ValidateTokenRequest) ProtoReflect() protoreflect.Message
- func (x *ValidateTokenRequest) Reset()
- func (x *ValidateTokenRequest) String() string
- type ValidateTokenResponse
- func (*ValidateTokenResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ValidateTokenResponse) GetValid() bool
- func (*ValidateTokenResponse) ProtoMessage()
- func (x *ValidateTokenResponse) ProtoReflect() protoreflect.Message
- func (x *ValidateTokenResponse) Reset()
- func (x *ValidateTokenResponse) String() string
Constants ¶
This section is empty.
Variables ¶
var AuthService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "api.protobuf.auth.v1.AuthService", HandlerType: (*AuthServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GenerateToken", Handler: _AuthService_GenerateToken_Handler, }, { MethodName: "ValidateToken", Handler: _AuthService_ValidateToken_Handler, }, { MethodName: "RefreshToken", Handler: _AuthService_RefreshToken_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "api/protobuf/auth/v1/auth.proto", }
AuthService_ServiceDesc is the grpc.ServiceDesc for AuthService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_api_protobuf_auth_v1_auth_proto protoreflect.FileDescriptor
Functions ¶
func RegisterAuthServiceHandler ¶
func RegisterAuthServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterAuthServiceHandler registers the http handlers for service AuthService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterAuthServiceHandlerClient ¶
func RegisterAuthServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AuthServiceClient) error
RegisterAuthServiceHandlerClient registers the http handlers for service AuthService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AuthServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AuthServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "AuthServiceClient" to call the correct interceptors.
func RegisterAuthServiceHandlerFromEndpoint ¶
func RegisterAuthServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterAuthServiceHandlerFromEndpoint is same as RegisterAuthServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterAuthServiceHandlerServer ¶
func RegisterAuthServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AuthServiceServer) error
RegisterAuthServiceHandlerServer registers the http handlers for service AuthService to "mux". UnaryRPC :call AuthServiceServer 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 RegisterAuthServiceHandlerFromEndpoint instead.
func RegisterAuthServiceServer ¶
func RegisterAuthServiceServer(s grpc.ServiceRegistrar, srv AuthServiceServer)
Types ¶
type AuthServiceClient ¶
type AuthServiceClient interface { GenerateToken(ctx context.Context, in *GenerateTokenRequest, opts ...grpc.CallOption) (*GenerateTokenResponse, error) ValidateToken(ctx context.Context, in *ValidateTokenRequest, opts ...grpc.CallOption) (*ValidateTokenResponse, error) RefreshToken(ctx context.Context, in *RefreshTokenRequest, opts ...grpc.CallOption) (*RefreshTokenResponse, error) }
AuthServiceClient is the client API for AuthService 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 NewAuthServiceClient ¶
func NewAuthServiceClient(cc grpc.ClientConnInterface) AuthServiceClient
type AuthServiceServer ¶
type AuthServiceServer interface { GenerateToken(context.Context, *GenerateTokenRequest) (*GenerateTokenResponse, error) ValidateToken(context.Context, *ValidateTokenRequest) (*ValidateTokenResponse, error) RefreshToken(context.Context, *RefreshTokenRequest) (*RefreshTokenResponse, error) // contains filtered or unexported methods }
AuthServiceServer is the server API for AuthService service. All implementations must embed UnimplementedAuthServiceServer for forward compatibility
type GenerateTokenRequest ¶
type GenerateTokenRequest struct { UserId uint64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` // contains filtered or unexported fields }
func (*GenerateTokenRequest) Descriptor
deprecated
func (*GenerateTokenRequest) Descriptor() ([]byte, []int)
Deprecated: Use GenerateTokenRequest.ProtoReflect.Descriptor instead.
func (*GenerateTokenRequest) GetUserId ¶
func (x *GenerateTokenRequest) GetUserId() uint64
func (*GenerateTokenRequest) ProtoMessage ¶
func (*GenerateTokenRequest) ProtoMessage()
func (*GenerateTokenRequest) ProtoReflect ¶
func (x *GenerateTokenRequest) ProtoReflect() protoreflect.Message
func (*GenerateTokenRequest) Reset ¶
func (x *GenerateTokenRequest) Reset()
func (*GenerateTokenRequest) String ¶
func (x *GenerateTokenRequest) String() string
type GenerateTokenResponse ¶
type GenerateTokenResponse struct { Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` // contains filtered or unexported fields }
func (*GenerateTokenResponse) Descriptor
deprecated
func (*GenerateTokenResponse) Descriptor() ([]byte, []int)
Deprecated: Use GenerateTokenResponse.ProtoReflect.Descriptor instead.
func (*GenerateTokenResponse) GetToken ¶
func (x *GenerateTokenResponse) GetToken() string
func (*GenerateTokenResponse) ProtoMessage ¶
func (*GenerateTokenResponse) ProtoMessage()
func (*GenerateTokenResponse) ProtoReflect ¶
func (x *GenerateTokenResponse) ProtoReflect() protoreflect.Message
func (*GenerateTokenResponse) Reset ¶
func (x *GenerateTokenResponse) Reset()
func (*GenerateTokenResponse) String ¶
func (x *GenerateTokenResponse) String() string
type RefreshTokenRequest ¶
type RefreshTokenRequest struct { Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` // contains filtered or unexported fields }
func (*RefreshTokenRequest) Descriptor
deprecated
func (*RefreshTokenRequest) Descriptor() ([]byte, []int)
Deprecated: Use RefreshTokenRequest.ProtoReflect.Descriptor instead.
func (*RefreshTokenRequest) GetToken ¶
func (x *RefreshTokenRequest) GetToken() string
func (*RefreshTokenRequest) ProtoMessage ¶
func (*RefreshTokenRequest) ProtoMessage()
func (*RefreshTokenRequest) ProtoReflect ¶
func (x *RefreshTokenRequest) ProtoReflect() protoreflect.Message
func (*RefreshTokenRequest) Reset ¶
func (x *RefreshTokenRequest) Reset()
func (*RefreshTokenRequest) String ¶
func (x *RefreshTokenRequest) String() string
type RefreshTokenResponse ¶
type RefreshTokenResponse struct { Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` // contains filtered or unexported fields }
func (*RefreshTokenResponse) Descriptor
deprecated
func (*RefreshTokenResponse) Descriptor() ([]byte, []int)
Deprecated: Use RefreshTokenResponse.ProtoReflect.Descriptor instead.
func (*RefreshTokenResponse) GetToken ¶
func (x *RefreshTokenResponse) GetToken() string
func (*RefreshTokenResponse) ProtoMessage ¶
func (*RefreshTokenResponse) ProtoMessage()
func (*RefreshTokenResponse) ProtoReflect ¶
func (x *RefreshTokenResponse) ProtoReflect() protoreflect.Message
func (*RefreshTokenResponse) Reset ¶
func (x *RefreshTokenResponse) Reset()
func (*RefreshTokenResponse) String ¶
func (x *RefreshTokenResponse) String() string
type UnimplementedAuthServiceServer ¶
type UnimplementedAuthServiceServer struct { }
UnimplementedAuthServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedAuthServiceServer) GenerateToken ¶
func (UnimplementedAuthServiceServer) GenerateToken(context.Context, *GenerateTokenRequest) (*GenerateTokenResponse, error)
func (UnimplementedAuthServiceServer) RefreshToken ¶
func (UnimplementedAuthServiceServer) RefreshToken(context.Context, *RefreshTokenRequest) (*RefreshTokenResponse, error)
func (UnimplementedAuthServiceServer) ValidateToken ¶
func (UnimplementedAuthServiceServer) ValidateToken(context.Context, *ValidateTokenRequest) (*ValidateTokenResponse, error)
type UnsafeAuthServiceServer ¶
type UnsafeAuthServiceServer interface {
// contains filtered or unexported methods
}
UnsafeAuthServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AuthServiceServer will result in compilation errors.
type ValidateTokenRequest ¶
type ValidateTokenRequest struct { Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` // contains filtered or unexported fields }
func (*ValidateTokenRequest) Descriptor
deprecated
func (*ValidateTokenRequest) Descriptor() ([]byte, []int)
Deprecated: Use ValidateTokenRequest.ProtoReflect.Descriptor instead.
func (*ValidateTokenRequest) GetToken ¶
func (x *ValidateTokenRequest) GetToken() string
func (*ValidateTokenRequest) ProtoMessage ¶
func (*ValidateTokenRequest) ProtoMessage()
func (*ValidateTokenRequest) ProtoReflect ¶
func (x *ValidateTokenRequest) ProtoReflect() protoreflect.Message
func (*ValidateTokenRequest) Reset ¶
func (x *ValidateTokenRequest) Reset()
func (*ValidateTokenRequest) String ¶
func (x *ValidateTokenRequest) String() string
type ValidateTokenResponse ¶
type ValidateTokenResponse struct { Valid bool `protobuf:"varint,1,opt,name=valid,proto3" json:"valid,omitempty"` // contains filtered or unexported fields }
func (*ValidateTokenResponse) Descriptor
deprecated
func (*ValidateTokenResponse) Descriptor() ([]byte, []int)
Deprecated: Use ValidateTokenResponse.ProtoReflect.Descriptor instead.
func (*ValidateTokenResponse) GetValid ¶
func (x *ValidateTokenResponse) GetValid() bool
func (*ValidateTokenResponse) ProtoMessage ¶
func (*ValidateTokenResponse) ProtoMessage()
func (*ValidateTokenResponse) ProtoReflect ¶
func (x *ValidateTokenResponse) ProtoReflect() protoreflect.Message
func (*ValidateTokenResponse) Reset ¶
func (x *ValidateTokenResponse) Reset()
func (*ValidateTokenResponse) String ¶
func (x *ValidateTokenResponse) String() string