Documentation ¶
Overview ¶
Package authv1 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 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 UnimplementedAuthServiceServer
- type UnsafeAuthServiceServer
- type UserLoginRequest
- func (*UserLoginRequest) Descriptor() ([]byte, []int)
- func (m *UserLoginRequest) GetPassword() string
- func (m *UserLoginRequest) GetUsername() string
- func (m *UserLoginRequest) Marshal() (dAtA []byte, err error)
- func (m *UserLoginRequest) MarshalTo(dAtA []byte) (int, error)
- func (m *UserLoginRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*UserLoginRequest) ProtoMessage()
- func (m *UserLoginRequest) Reset()
- func (m *UserLoginRequest) Size() (n int)
- func (m *UserLoginRequest) String() string
- func (m *UserLoginRequest) Unmarshal(dAtA []byte) error
- func (m *UserLoginRequest) XXX_DiscardUnknown()
- func (m *UserLoginRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *UserLoginRequest) XXX_Merge(src proto.Message)
- func (m *UserLoginRequest) XXX_Size() int
- func (m *UserLoginRequest) XXX_Unmarshal(b []byte) error
- type UserLoginResponse
- func (*UserLoginResponse) Descriptor() ([]byte, []int)
- func (m *UserLoginResponse) GetAccessToken() string
- func (m *UserLoginResponse) Marshal() (dAtA []byte, err error)
- func (m *UserLoginResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *UserLoginResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*UserLoginResponse) ProtoMessage()
- func (m *UserLoginResponse) Reset()
- func (m *UserLoginResponse) Size() (n int)
- func (m *UserLoginResponse) String() string
- func (m *UserLoginResponse) Unmarshal(dAtA []byte) error
- func (m *UserLoginResponse) XXX_DiscardUnknown()
- func (m *UserLoginResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *UserLoginResponse) XXX_Merge(src proto.Message)
- func (m *UserLoginResponse) XXX_Size() int
- func (m *UserLoginResponse) 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 AuthService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "auth.v1.AuthService", HandlerType: (*AuthServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Ping", Handler: _AuthService_Ping_Handler, }, { MethodName: "Login", Handler: _AuthService_Login_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "authen/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)
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 (such as grpc.SendHeader, etc) to stop working. Consider using RegisterAuthServiceHandlerFromEndpoint instead.
func RegisterAuthServiceServer ¶
func RegisterAuthServiceServer(s grpc.ServiceRegistrar, srv AuthServiceServer)
Types ¶
type AuthServiceClient ¶
type AuthServiceClient interface { Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error) Login(ctx context.Context, in *UserLoginRequest, opts ...grpc.CallOption) (*UserLoginResponse, 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 { Ping(context.Context, *PingRequest) (*PingResponse, error) Login(context.Context, *UserLoginRequest) (*UserLoginResponse, error) }
AuthServiceServer is the server API for AuthService service. All implementations should embed UnimplementedAuthServiceServer for forward compatibility
type PingRequest ¶
type PingRequest struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
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 { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
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 UnimplementedAuthServiceServer ¶
type UnimplementedAuthServiceServer struct { }
UnimplementedAuthServiceServer should be embedded to have forward compatible implementations.
func (UnimplementedAuthServiceServer) Login ¶
func (UnimplementedAuthServiceServer) Login(context.Context, *UserLoginRequest) (*UserLoginResponse, error)
func (UnimplementedAuthServiceServer) Ping ¶
func (UnimplementedAuthServiceServer) Ping(context.Context, *PingRequest) (*PingResponse, 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 UserLoginRequest ¶
type UserLoginRequest 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"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*UserLoginRequest) Descriptor ¶
func (*UserLoginRequest) Descriptor() ([]byte, []int)
func (*UserLoginRequest) GetPassword ¶
func (m *UserLoginRequest) GetPassword() string
func (*UserLoginRequest) GetUsername ¶
func (m *UserLoginRequest) GetUsername() string
func (*UserLoginRequest) Marshal ¶
func (m *UserLoginRequest) Marshal() (dAtA []byte, err error)
func (*UserLoginRequest) MarshalToSizedBuffer ¶
func (m *UserLoginRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*UserLoginRequest) ProtoMessage ¶
func (*UserLoginRequest) ProtoMessage()
func (*UserLoginRequest) Reset ¶
func (m *UserLoginRequest) Reset()
func (*UserLoginRequest) Size ¶
func (m *UserLoginRequest) Size() (n int)
func (*UserLoginRequest) String ¶
func (m *UserLoginRequest) String() string
func (*UserLoginRequest) Unmarshal ¶
func (m *UserLoginRequest) Unmarshal(dAtA []byte) error
func (*UserLoginRequest) XXX_DiscardUnknown ¶
func (m *UserLoginRequest) XXX_DiscardUnknown()
func (*UserLoginRequest) XXX_Marshal ¶
func (m *UserLoginRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*UserLoginRequest) XXX_Merge ¶
func (m *UserLoginRequest) XXX_Merge(src proto.Message)
func (*UserLoginRequest) XXX_Size ¶
func (m *UserLoginRequest) XXX_Size() int
func (*UserLoginRequest) XXX_Unmarshal ¶
func (m *UserLoginRequest) XXX_Unmarshal(b []byte) error
type UserLoginResponse ¶
type UserLoginResponse struct { AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*UserLoginResponse) Descriptor ¶
func (*UserLoginResponse) Descriptor() ([]byte, []int)
func (*UserLoginResponse) GetAccessToken ¶
func (m *UserLoginResponse) GetAccessToken() string
func (*UserLoginResponse) Marshal ¶
func (m *UserLoginResponse) Marshal() (dAtA []byte, err error)
func (*UserLoginResponse) MarshalTo ¶
func (m *UserLoginResponse) MarshalTo(dAtA []byte) (int, error)
func (*UserLoginResponse) MarshalToSizedBuffer ¶
func (m *UserLoginResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*UserLoginResponse) ProtoMessage ¶
func (*UserLoginResponse) ProtoMessage()
func (*UserLoginResponse) Reset ¶
func (m *UserLoginResponse) Reset()
func (*UserLoginResponse) Size ¶
func (m *UserLoginResponse) Size() (n int)
func (*UserLoginResponse) String ¶
func (m *UserLoginResponse) String() string
func (*UserLoginResponse) Unmarshal ¶
func (m *UserLoginResponse) Unmarshal(dAtA []byte) error
func (*UserLoginResponse) XXX_DiscardUnknown ¶
func (m *UserLoginResponse) XXX_DiscardUnknown()
func (*UserLoginResponse) XXX_Marshal ¶
func (m *UserLoginResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*UserLoginResponse) XXX_Merge ¶
func (m *UserLoginResponse) XXX_Merge(src proto.Message)
func (*UserLoginResponse) XXX_Size ¶
func (m *UserLoginResponse) XXX_Size() int
func (*UserLoginResponse) XXX_Unmarshal ¶
func (m *UserLoginResponse) XXX_Unmarshal(b []byte) error