Documentation ¶
Overview ¶
Package authv1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterAuthenServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterAuthenServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AuthenServiceClient) error
- func RegisterAuthenServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterAuthenServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AuthenServiceServer) error
- func RegisterAuthenServiceServer(s grpc.ServiceRegistrar, srv AuthenServiceServer)
- type AuthenServiceClient
- type AuthenServiceServer
- type LoginRequest
- func (*LoginRequest) Descriptor() ([]byte, []int)
- func (m *LoginRequest) GetPassword() string
- func (m *LoginRequest) GetUsername() string
- func (m *LoginRequest) Marshal() (dAtA []byte, err error)
- func (m *LoginRequest) MarshalTo(dAtA []byte) (int, error)
- func (m *LoginRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*LoginRequest) ProtoMessage()
- func (m *LoginRequest) Reset()
- func (m *LoginRequest) Size() (n int)
- func (m *LoginRequest) String() string
- func (m *LoginRequest) Unmarshal(dAtA []byte) error
- func (m *LoginRequest) XXX_DiscardUnknown()
- func (m *LoginRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *LoginRequest) XXX_Merge(src proto.Message)
- func (m *LoginRequest) XXX_Size() int
- func (m *LoginRequest) XXX_Unmarshal(b []byte) error
- type LoginResponse
- func (*LoginResponse) Descriptor() ([]byte, []int)
- func (m *LoginResponse) GetAccessToken() string
- func (m *LoginResponse) Marshal() (dAtA []byte, err error)
- func (m *LoginResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *LoginResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*LoginResponse) ProtoMessage()
- func (m *LoginResponse) Reset()
- func (m *LoginResponse) Size() (n int)
- func (m *LoginResponse) String() string
- func (m *LoginResponse) Unmarshal(dAtA []byte) error
- func (m *LoginResponse) XXX_DiscardUnknown()
- func (m *LoginResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *LoginResponse) XXX_Merge(src proto.Message)
- func (m *LoginResponse) XXX_Size() int
- func (m *LoginResponse) XXX_Unmarshal(b []byte) error
- type PingRequest
- func (*PingRequest) Descriptor() ([]byte, []int)
- func (m *PingRequest) Marshal() (dAtA []byte, err error)
- func (m *PingRequest) MarshalTo(dAtA []byte) (int, error)
- func (m *PingRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*PingRequest) ProtoMessage()
- func (m *PingRequest) Reset()
- func (m *PingRequest) Size() (n int)
- func (m *PingRequest) String() string
- func (m *PingRequest) Unmarshal(dAtA []byte) error
- func (m *PingRequest) XXX_DiscardUnknown()
- func (m *PingRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PingRequest) XXX_Merge(src proto.Message)
- func (m *PingRequest) XXX_Size() int
- func (m *PingRequest) XXX_Unmarshal(b []byte) error
- type PingResponse
- func (*PingResponse) Descriptor() ([]byte, []int)
- func (m *PingResponse) Marshal() (dAtA []byte, err error)
- func (m *PingResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *PingResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*PingResponse) ProtoMessage()
- func (m *PingResponse) Reset()
- func (m *PingResponse) Size() (n int)
- func (m *PingResponse) String() string
- func (m *PingResponse) Unmarshal(dAtA []byte) error
- func (m *PingResponse) XXX_DiscardUnknown()
- func (m *PingResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PingResponse) XXX_Merge(src proto.Message)
- func (m *PingResponse) XXX_Size() int
- func (m *PingResponse) XXX_Unmarshal(b []byte) error
- type UnimplementedAuthenServiceServer
- func (UnimplementedAuthenServiceServer) Login(context.Context, *LoginRequest) (*LoginResponse, error)
- func (UnimplementedAuthenServiceServer) Ping(context.Context, *PingRequest) (*PingResponse, error)
- func (UnimplementedAuthenServiceServer) Verify(context.Context, *VerifyRequest) (*VerifyResponse, error)
- type UnsafeAuthenServiceServer
- type VerifyRequest
- func (*VerifyRequest) Descriptor() ([]byte, []int)
- func (m *VerifyRequest) GetToken() string
- func (m *VerifyRequest) Marshal() (dAtA []byte, err error)
- func (m *VerifyRequest) MarshalTo(dAtA []byte) (int, error)
- func (m *VerifyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*VerifyRequest) ProtoMessage()
- func (m *VerifyRequest) Reset()
- func (m *VerifyRequest) Size() (n int)
- func (m *VerifyRequest) String() string
- func (m *VerifyRequest) Unmarshal(dAtA []byte) error
- func (m *VerifyRequest) XXX_DiscardUnknown()
- func (m *VerifyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *VerifyRequest) XXX_Merge(src proto.Message)
- func (m *VerifyRequest) XXX_Size() int
- func (m *VerifyRequest) XXX_Unmarshal(b []byte) error
- type VerifyResponse
- func (*VerifyResponse) Descriptor() ([]byte, []int)
- func (m *VerifyResponse) GetExp() int64
- func (m *VerifyResponse) GetId() uint64
- func (m *VerifyResponse) GetRole() string
- func (m *VerifyResponse) GetUsername() string
- func (m *VerifyResponse) Marshal() (dAtA []byte, err error)
- func (m *VerifyResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *VerifyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*VerifyResponse) ProtoMessage()
- func (m *VerifyResponse) Reset()
- func (m *VerifyResponse) Size() (n int)
- func (m *VerifyResponse) String() string
- func (m *VerifyResponse) Unmarshal(dAtA []byte) error
- func (m *VerifyResponse) XXX_DiscardUnknown()
- func (m *VerifyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *VerifyResponse) XXX_Merge(src proto.Message)
- func (m *VerifyResponse) XXX_Size() int
- func (m *VerifyResponse) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidLengthAuth = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowAuth = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupAuth = fmt.Errorf("proto: unexpected end of group") )
var AuthenService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "auth.v1.AuthenService", HandlerType: (*AuthenServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Ping", Handler: _AuthenService_Ping_Handler, }, { MethodName: "Login", Handler: _AuthenService_Login_Handler, }, { MethodName: "Verify", Handler: _AuthenService_Verify_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "v1/auth/auth.proto", }
AuthenService_ServiceDesc is the grpc.ServiceDesc for AuthenService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterAuthenServiceHandler ¶
func RegisterAuthenServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterAuthenServiceHandler registers the http handlers for service AuthenService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterAuthenServiceHandlerClient ¶
func RegisterAuthenServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AuthenServiceClient) error
RegisterAuthenServiceHandlerClient registers the http handlers for service AuthenService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AuthenServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AuthenServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "AuthenServiceClient" to call the correct interceptors.
func RegisterAuthenServiceHandlerFromEndpoint ¶
func RegisterAuthenServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterAuthenServiceHandlerFromEndpoint is same as RegisterAuthenServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterAuthenServiceHandlerServer ¶
func RegisterAuthenServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AuthenServiceServer) error
RegisterAuthenServiceHandlerServer registers the http handlers for service AuthenService to "mux". UnaryRPC :call AuthenServiceServer 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 (such as grpc.SendHeader, etc) to stop working. Consider using RegisterAuthenServiceHandlerFromEndpoint instead.
func RegisterAuthenServiceServer ¶
func RegisterAuthenServiceServer(s grpc.ServiceRegistrar, srv AuthenServiceServer)
Types ¶
type AuthenServiceClient ¶
type AuthenServiceClient interface { Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error) Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error) Verify(ctx context.Context, in *VerifyRequest, opts ...grpc.CallOption) (*VerifyResponse, error) }
AuthenServiceClient is the client API for AuthenService 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 NewAuthenServiceClient ¶
func NewAuthenServiceClient(cc grpc.ClientConnInterface) AuthenServiceClient
type AuthenServiceServer ¶
type AuthenServiceServer interface { Ping(context.Context, *PingRequest) (*PingResponse, error) Login(context.Context, *LoginRequest) (*LoginResponse, error) Verify(context.Context, *VerifyRequest) (*VerifyResponse, error) }
AuthenServiceServer is the server API for AuthenService service. All implementations should embed UnimplementedAuthenServiceServer for forward compatibility
type LoginRequest ¶
type LoginRequest struct { Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty" validate:"required"` Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty" validate:"required"` }
func (*LoginRequest) Descriptor ¶
func (*LoginRequest) Descriptor() ([]byte, []int)
func (*LoginRequest) GetPassword ¶
func (m *LoginRequest) GetPassword() string
func (*LoginRequest) GetUsername ¶
func (m *LoginRequest) GetUsername() string
func (*LoginRequest) Marshal ¶
func (m *LoginRequest) Marshal() (dAtA []byte, err error)
func (*LoginRequest) MarshalToSizedBuffer ¶
func (m *LoginRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*LoginRequest) ProtoMessage ¶
func (*LoginRequest) ProtoMessage()
func (*LoginRequest) Reset ¶
func (m *LoginRequest) Reset()
func (*LoginRequest) Size ¶
func (m *LoginRequest) Size() (n int)
func (*LoginRequest) String ¶
func (m *LoginRequest) String() string
func (*LoginRequest) Unmarshal ¶
func (m *LoginRequest) Unmarshal(dAtA []byte) error
func (*LoginRequest) XXX_DiscardUnknown ¶
func (m *LoginRequest) XXX_DiscardUnknown()
func (*LoginRequest) XXX_Marshal ¶
func (m *LoginRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*LoginRequest) XXX_Merge ¶
func (m *LoginRequest) XXX_Merge(src proto.Message)
func (*LoginRequest) XXX_Size ¶
func (m *LoginRequest) XXX_Size() int
func (*LoginRequest) XXX_Unmarshal ¶
func (m *LoginRequest) XXX_Unmarshal(b []byte) error
type LoginResponse ¶
type LoginResponse struct {
AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"`
}
func (*LoginResponse) Descriptor ¶
func (*LoginResponse) Descriptor() ([]byte, []int)
func (*LoginResponse) GetAccessToken ¶
func (m *LoginResponse) GetAccessToken() string
func (*LoginResponse) Marshal ¶
func (m *LoginResponse) Marshal() (dAtA []byte, err error)
func (*LoginResponse) MarshalToSizedBuffer ¶
func (m *LoginResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*LoginResponse) ProtoMessage ¶
func (*LoginResponse) ProtoMessage()
func (*LoginResponse) Reset ¶
func (m *LoginResponse) Reset()
func (*LoginResponse) Size ¶
func (m *LoginResponse) Size() (n int)
func (*LoginResponse) String ¶
func (m *LoginResponse) String() string
func (*LoginResponse) Unmarshal ¶
func (m *LoginResponse) Unmarshal(dAtA []byte) error
func (*LoginResponse) XXX_DiscardUnknown ¶
func (m *LoginResponse) XXX_DiscardUnknown()
func (*LoginResponse) XXX_Marshal ¶
func (m *LoginResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*LoginResponse) XXX_Merge ¶
func (m *LoginResponse) XXX_Merge(src proto.Message)
func (*LoginResponse) XXX_Size ¶
func (m *LoginResponse) XXX_Size() int
func (*LoginResponse) XXX_Unmarshal ¶
func (m *LoginResponse) XXX_Unmarshal(b []byte) error
type PingRequest ¶
type PingRequest struct { }
func (*PingRequest) Descriptor ¶
func (*PingRequest) Descriptor() ([]byte, []int)
func (*PingRequest) Marshal ¶
func (m *PingRequest) Marshal() (dAtA []byte, err error)
func (*PingRequest) MarshalToSizedBuffer ¶
func (m *PingRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*PingRequest) ProtoMessage ¶
func (*PingRequest) ProtoMessage()
func (*PingRequest) Reset ¶
func (m *PingRequest) Reset()
func (*PingRequest) Size ¶
func (m *PingRequest) Size() (n int)
func (*PingRequest) String ¶
func (m *PingRequest) String() string
func (*PingRequest) Unmarshal ¶
func (m *PingRequest) Unmarshal(dAtA []byte) error
func (*PingRequest) XXX_DiscardUnknown ¶
func (m *PingRequest) XXX_DiscardUnknown()
func (*PingRequest) XXX_Marshal ¶
func (m *PingRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*PingRequest) XXX_Merge ¶
func (m *PingRequest) XXX_Merge(src proto.Message)
func (*PingRequest) XXX_Size ¶
func (m *PingRequest) XXX_Size() int
func (*PingRequest) XXX_Unmarshal ¶
func (m *PingRequest) XXX_Unmarshal(b []byte) error
type PingResponse ¶
type PingResponse struct { }
func (*PingResponse) Descriptor ¶
func (*PingResponse) Descriptor() ([]byte, []int)
func (*PingResponse) Marshal ¶
func (m *PingResponse) Marshal() (dAtA []byte, err error)
func (*PingResponse) MarshalToSizedBuffer ¶
func (m *PingResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*PingResponse) ProtoMessage ¶
func (*PingResponse) ProtoMessage()
func (*PingResponse) Reset ¶
func (m *PingResponse) Reset()
func (*PingResponse) Size ¶
func (m *PingResponse) Size() (n int)
func (*PingResponse) String ¶
func (m *PingResponse) String() string
func (*PingResponse) Unmarshal ¶
func (m *PingResponse) Unmarshal(dAtA []byte) error
func (*PingResponse) XXX_DiscardUnknown ¶
func (m *PingResponse) XXX_DiscardUnknown()
func (*PingResponse) XXX_Marshal ¶
func (m *PingResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*PingResponse) XXX_Merge ¶
func (m *PingResponse) XXX_Merge(src proto.Message)
func (*PingResponse) XXX_Size ¶
func (m *PingResponse) XXX_Size() int
func (*PingResponse) XXX_Unmarshal ¶
func (m *PingResponse) XXX_Unmarshal(b []byte) error
type UnimplementedAuthenServiceServer ¶
type UnimplementedAuthenServiceServer struct { }
UnimplementedAuthenServiceServer should be embedded to have forward compatible implementations.
func (UnimplementedAuthenServiceServer) Login ¶
func (UnimplementedAuthenServiceServer) Login(context.Context, *LoginRequest) (*LoginResponse, error)
func (UnimplementedAuthenServiceServer) Ping ¶
func (UnimplementedAuthenServiceServer) Ping(context.Context, *PingRequest) (*PingResponse, error)
func (UnimplementedAuthenServiceServer) Verify ¶
func (UnimplementedAuthenServiceServer) Verify(context.Context, *VerifyRequest) (*VerifyResponse, error)
type UnsafeAuthenServiceServer ¶
type UnsafeAuthenServiceServer interface {
// contains filtered or unexported methods
}
UnsafeAuthenServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AuthenServiceServer will result in compilation errors.
type VerifyRequest ¶
type VerifyRequest struct {
Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty" validate:"required"`
}
func (*VerifyRequest) Descriptor ¶
func (*VerifyRequest) Descriptor() ([]byte, []int)
func (*VerifyRequest) GetToken ¶
func (m *VerifyRequest) GetToken() string
func (*VerifyRequest) Marshal ¶
func (m *VerifyRequest) Marshal() (dAtA []byte, err error)
func (*VerifyRequest) MarshalToSizedBuffer ¶
func (m *VerifyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*VerifyRequest) ProtoMessage ¶
func (*VerifyRequest) ProtoMessage()
func (*VerifyRequest) Reset ¶
func (m *VerifyRequest) Reset()
func (*VerifyRequest) Size ¶
func (m *VerifyRequest) Size() (n int)
func (*VerifyRequest) String ¶
func (m *VerifyRequest) String() string
func (*VerifyRequest) Unmarshal ¶
func (m *VerifyRequest) Unmarshal(dAtA []byte) error
func (*VerifyRequest) XXX_DiscardUnknown ¶
func (m *VerifyRequest) XXX_DiscardUnknown()
func (*VerifyRequest) XXX_Marshal ¶
func (m *VerifyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*VerifyRequest) XXX_Merge ¶
func (m *VerifyRequest) XXX_Merge(src proto.Message)
func (*VerifyRequest) XXX_Size ¶
func (m *VerifyRequest) XXX_Size() int
func (*VerifyRequest) XXX_Unmarshal ¶
func (m *VerifyRequest) XXX_Unmarshal(b []byte) error
type VerifyResponse ¶
type VerifyResponse struct { Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` Role string `protobuf:"bytes,3,opt,name=role,proto3" json:"role,omitempty"` Exp int64 `protobuf:"varint,4,opt,name=exp,proto3" json:"exp,omitempty"` }
func (*VerifyResponse) Descriptor ¶
func (*VerifyResponse) Descriptor() ([]byte, []int)
func (*VerifyResponse) GetExp ¶
func (m *VerifyResponse) GetExp() int64
func (*VerifyResponse) GetId ¶
func (m *VerifyResponse) GetId() uint64
func (*VerifyResponse) GetRole ¶
func (m *VerifyResponse) GetRole() string
func (*VerifyResponse) GetUsername ¶
func (m *VerifyResponse) GetUsername() string
func (*VerifyResponse) Marshal ¶
func (m *VerifyResponse) Marshal() (dAtA []byte, err error)
func (*VerifyResponse) MarshalToSizedBuffer ¶
func (m *VerifyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*VerifyResponse) ProtoMessage ¶
func (*VerifyResponse) ProtoMessage()
func (*VerifyResponse) Reset ¶
func (m *VerifyResponse) Reset()
func (*VerifyResponse) Size ¶
func (m *VerifyResponse) Size() (n int)
func (*VerifyResponse) String ¶
func (m *VerifyResponse) String() string
func (*VerifyResponse) Unmarshal ¶
func (m *VerifyResponse) Unmarshal(dAtA []byte) error
func (*VerifyResponse) XXX_DiscardUnknown ¶
func (m *VerifyResponse) XXX_DiscardUnknown()
func (*VerifyResponse) XXX_Marshal ¶
func (m *VerifyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*VerifyResponse) XXX_Merge ¶
func (m *VerifyResponse) XXX_Merge(src proto.Message)
func (*VerifyResponse) XXX_Size ¶
func (m *VerifyResponse) XXX_Size() int
func (*VerifyResponse) XXX_Unmarshal ¶
func (m *VerifyResponse) XXX_Unmarshal(b []byte) error