Documentation ¶
Overview ¶
Package authpb 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 AuthenticateTokenRequest
- func (*AuthenticateTokenRequest) Descriptor() ([]byte, []int)deprecated
- func (x *AuthenticateTokenRequest) GetToken() string
- func (*AuthenticateTokenRequest) ProtoMessage()
- func (x *AuthenticateTokenRequest) ProtoReflect() protoreflect.Message
- func (x *AuthenticateTokenRequest) Reset()
- func (x *AuthenticateTokenRequest) String() string
- type AuthenticateTokenResponse
- func (*AuthenticateTokenResponse) Descriptor() ([]byte, []int)deprecated
- func (x *AuthenticateTokenResponse) GetAuth() bool
- func (x *AuthenticateTokenResponse) GetUser() *User
- func (*AuthenticateTokenResponse) ProtoMessage()
- func (x *AuthenticateTokenResponse) ProtoReflect() protoreflect.Message
- func (x *AuthenticateTokenResponse) Reset()
- func (x *AuthenticateTokenResponse) String() string
- type EmptyData
- type GetTokenRequest
- func (*GetTokenRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetTokenRequest) GetPassword() string
- func (x *GetTokenRequest) GetUsername() string
- func (*GetTokenRequest) ProtoMessage()
- func (x *GetTokenRequest) ProtoReflect() protoreflect.Message
- func (x *GetTokenRequest) Reset()
- func (x *GetTokenRequest) String() string
- type GetTokenResponse
- func (*GetTokenResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetTokenResponse) GetRefreshToken() string
- func (x *GetTokenResponse) GetToken() string
- func (x *GetTokenResponse) GetUser() *User
- func (*GetTokenResponse) ProtoMessage()
- func (x *GetTokenResponse) ProtoReflect() protoreflect.Message
- func (x *GetTokenResponse) Reset()
- func (x *GetTokenResponse) String() string
- type PingMessage
- 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) AuthenticateToken(context.Context, *AuthenticateTokenRequest) (*AuthenticateTokenResponse, error)
- func (UnimplementedAuthServiceServer) GetToken(context.Context, *GetTokenRequest) (*GetTokenResponse, error)
- func (UnimplementedAuthServiceServer) RefreshToken(context.Context, *RefreshTokenRequest) (*RefreshTokenResponse, error)
- func (UnimplementedAuthServiceServer) SayHello(context.Context, *PingMessage) (*PingMessage, error)
- type UnsafeAuthServiceServer
- type User
Constants ¶
This section is empty.
Variables ¶
var AuthService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "authpb.AuthService", HandlerType: (*AuthServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "SayHello", Handler: _AuthService_SayHello_Handler, }, { MethodName: "GetToken", Handler: _AuthService_GetToken_Handler, }, { MethodName: "AuthenticateToken", Handler: _AuthService_AuthenticateToken_Handler, }, { MethodName: "RefreshToken", Handler: _AuthService_RefreshToken_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "auth_api.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_auth_api_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 { SayHello(ctx context.Context, in *PingMessage, opts ...grpc.CallOption) (*PingMessage, error) GetToken(ctx context.Context, in *GetTokenRequest, opts ...grpc.CallOption) (*GetTokenResponse, error) AuthenticateToken(ctx context.Context, in *AuthenticateTokenRequest, opts ...grpc.CallOption) (*AuthenticateTokenResponse, 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 { SayHello(context.Context, *PingMessage) (*PingMessage, error) GetToken(context.Context, *GetTokenRequest) (*GetTokenResponse, error) AuthenticateToken(context.Context, *AuthenticateTokenRequest) (*AuthenticateTokenResponse, 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 AuthenticateTokenRequest ¶
type AuthenticateTokenRequest struct { Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` // contains filtered or unexported fields }
func (*AuthenticateTokenRequest) Descriptor
deprecated
func (*AuthenticateTokenRequest) Descriptor() ([]byte, []int)
Deprecated: Use AuthenticateTokenRequest.ProtoReflect.Descriptor instead.
func (*AuthenticateTokenRequest) GetToken ¶
func (x *AuthenticateTokenRequest) GetToken() string
func (*AuthenticateTokenRequest) ProtoMessage ¶
func (*AuthenticateTokenRequest) ProtoMessage()
func (*AuthenticateTokenRequest) ProtoReflect ¶
func (x *AuthenticateTokenRequest) ProtoReflect() protoreflect.Message
func (*AuthenticateTokenRequest) Reset ¶
func (x *AuthenticateTokenRequest) Reset()
func (*AuthenticateTokenRequest) String ¶
func (x *AuthenticateTokenRequest) String() string
type AuthenticateTokenResponse ¶
type AuthenticateTokenResponse struct { Auth bool `protobuf:"varint,1,opt,name=auth,proto3" json:"auth,omitempty"` User *User `protobuf:"bytes,2,opt,name=user,proto3" json:"user,omitempty"` // contains filtered or unexported fields }
func (*AuthenticateTokenResponse) Descriptor
deprecated
func (*AuthenticateTokenResponse) Descriptor() ([]byte, []int)
Deprecated: Use AuthenticateTokenResponse.ProtoReflect.Descriptor instead.
func (*AuthenticateTokenResponse) GetAuth ¶
func (x *AuthenticateTokenResponse) GetAuth() bool
func (*AuthenticateTokenResponse) GetUser ¶
func (x *AuthenticateTokenResponse) GetUser() *User
func (*AuthenticateTokenResponse) ProtoMessage ¶
func (*AuthenticateTokenResponse) ProtoMessage()
func (*AuthenticateTokenResponse) ProtoReflect ¶
func (x *AuthenticateTokenResponse) ProtoReflect() protoreflect.Message
func (*AuthenticateTokenResponse) Reset ¶
func (x *AuthenticateTokenResponse) Reset()
func (*AuthenticateTokenResponse) String ¶
func (x *AuthenticateTokenResponse) String() string
type EmptyData ¶
type EmptyData struct {
// contains filtered or unexported fields
}
func (*EmptyData) Descriptor
deprecated
func (*EmptyData) ProtoMessage ¶
func (*EmptyData) ProtoMessage()
func (*EmptyData) ProtoReflect ¶
func (x *EmptyData) ProtoReflect() protoreflect.Message
type GetTokenRequest ¶
type GetTokenRequest struct { Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` // contains filtered or unexported fields }
func (*GetTokenRequest) Descriptor
deprecated
func (*GetTokenRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetTokenRequest.ProtoReflect.Descriptor instead.
func (*GetTokenRequest) GetPassword ¶
func (x *GetTokenRequest) GetPassword() string
func (*GetTokenRequest) GetUsername ¶
func (x *GetTokenRequest) GetUsername() string
func (*GetTokenRequest) ProtoMessage ¶
func (*GetTokenRequest) ProtoMessage()
func (*GetTokenRequest) ProtoReflect ¶
func (x *GetTokenRequest) ProtoReflect() protoreflect.Message
func (*GetTokenRequest) Reset ¶
func (x *GetTokenRequest) Reset()
func (*GetTokenRequest) String ¶
func (x *GetTokenRequest) String() string
type GetTokenResponse ¶
type GetTokenResponse struct { Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` RefreshToken string `protobuf:"bytes,2,opt,name=refreshToken,proto3" json:"refreshToken,omitempty"` User *User `protobuf:"bytes,3,opt,name=user,proto3" json:"user,omitempty"` // contains filtered or unexported fields }
func (*GetTokenResponse) Descriptor
deprecated
func (*GetTokenResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetTokenResponse.ProtoReflect.Descriptor instead.
func (*GetTokenResponse) GetRefreshToken ¶
func (x *GetTokenResponse) GetRefreshToken() string
func (*GetTokenResponse) GetToken ¶
func (x *GetTokenResponse) GetToken() string
func (*GetTokenResponse) GetUser ¶
func (x *GetTokenResponse) GetUser() *User
func (*GetTokenResponse) ProtoMessage ¶
func (*GetTokenResponse) ProtoMessage()
func (*GetTokenResponse) ProtoReflect ¶
func (x *GetTokenResponse) ProtoReflect() protoreflect.Message
func (*GetTokenResponse) Reset ¶
func (x *GetTokenResponse) Reset()
func (*GetTokenResponse) String ¶
func (x *GetTokenResponse) String() string
type PingMessage ¶
type PingMessage struct { Greeting string `protobuf:"bytes,1,opt,name=greeting,proto3" json:"greeting,omitempty"` // contains filtered or unexported fields }
func (*PingMessage) Descriptor
deprecated
func (*PingMessage) Descriptor() ([]byte, []int)
Deprecated: Use PingMessage.ProtoReflect.Descriptor instead.
func (*PingMessage) GetGreeting ¶
func (x *PingMessage) GetGreeting() string
func (*PingMessage) ProtoMessage ¶
func (*PingMessage) ProtoMessage()
func (*PingMessage) ProtoReflect ¶
func (x *PingMessage) ProtoReflect() protoreflect.Message
func (*PingMessage) Reset ¶
func (x *PingMessage) Reset()
func (*PingMessage) String ¶
func (x *PingMessage) 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) AuthenticateToken ¶
func (UnimplementedAuthServiceServer) AuthenticateToken(context.Context, *AuthenticateTokenRequest) (*AuthenticateTokenResponse, error)
func (UnimplementedAuthServiceServer) GetToken ¶
func (UnimplementedAuthServiceServer) GetToken(context.Context, *GetTokenRequest) (*GetTokenResponse, error)
func (UnimplementedAuthServiceServer) RefreshToken ¶
func (UnimplementedAuthServiceServer) RefreshToken(context.Context, *RefreshTokenRequest) (*RefreshTokenResponse, error)
func (UnimplementedAuthServiceServer) SayHello ¶
func (UnimplementedAuthServiceServer) SayHello(context.Context, *PingMessage) (*PingMessage, 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 User ¶
type User struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` Created int64 `protobuf:"varint,3,opt,name=created,proto3" json:"created,omitempty"` // contains filtered or unexported fields }
func (*User) Descriptor
deprecated
func (*User) GetCreated ¶
func (*User) GetUsername ¶
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
func (*User) ProtoReflect ¶
func (x *User) ProtoReflect() protoreflect.Message