Documentation ¶
Overview ¶
Package auth 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 IdentifyRequest
- type Identity
- type IssueRequest
- func (*IssueRequest) Descriptor() ([]byte, []int)deprecated
- func (x *IssueRequest) GetSessionId() string
- func (x *IssueRequest) GetTTL() int64
- func (*IssueRequest) ProtoMessage()
- func (x *IssueRequest) ProtoReflect() protoreflect.Message
- func (x *IssueRequest) Reset()
- func (x *IssueRequest) String() string
- type Key
- type UnimplementedAuthServiceServer
- type UnsafeAuthServiceServer
Constants ¶
This section is empty.
Variables ¶
var AuthService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "auth.AuthService", HandlerType: (*AuthServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Identify", Handler: _AuthService_Identify_Handler, }, { MethodName: "Issue", Handler: _AuthService_Issue_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "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_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 { Identify(ctx context.Context, in *IdentifyRequest, opts ...grpc.CallOption) (*Identity, error) Issue(ctx context.Context, in *IssueRequest, opts ...grpc.CallOption) (*Key, 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 { Identify(context.Context, *IdentifyRequest) (*Identity, error) Issue(context.Context, *IssueRequest) (*Key, error) // contains filtered or unexported methods }
AuthServiceServer is the server API for AuthService service. All implementations must embed UnimplementedAuthServiceServer for forward compatibility
type IdentifyRequest ¶
type IdentifyRequest struct { Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` // contains filtered or unexported fields }
func (*IdentifyRequest) Descriptor
deprecated
func (*IdentifyRequest) Descriptor() ([]byte, []int)
Deprecated: Use IdentifyRequest.ProtoReflect.Descriptor instead.
func (*IdentifyRequest) GetToken ¶
func (x *IdentifyRequest) GetToken() string
func (*IdentifyRequest) ProtoMessage ¶
func (*IdentifyRequest) ProtoMessage()
func (*IdentifyRequest) ProtoReflect ¶
func (x *IdentifyRequest) ProtoReflect() protoreflect.Message
func (*IdentifyRequest) Reset ¶
func (x *IdentifyRequest) Reset()
func (*IdentifyRequest) String ¶
func (x *IdentifyRequest) String() string
type Identity ¶
type Identity struct { SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` // contains filtered or unexported fields }
func (*Identity) Descriptor
deprecated
func (*Identity) GetSessionId ¶
func (*Identity) ProtoMessage ¶
func (*Identity) ProtoMessage()
func (*Identity) ProtoReflect ¶
func (x *Identity) ProtoReflect() protoreflect.Message
type IssueRequest ¶
type IssueRequest struct { SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` TTL int64 `protobuf:"varint,2,opt,name=TTL,proto3" json:"TTL,omitempty"` // contains filtered or unexported fields }
func (*IssueRequest) Descriptor
deprecated
func (*IssueRequest) Descriptor() ([]byte, []int)
Deprecated: Use IssueRequest.ProtoReflect.Descriptor instead.
func (*IssueRequest) GetSessionId ¶
func (x *IssueRequest) GetSessionId() string
func (*IssueRequest) GetTTL ¶
func (x *IssueRequest) GetTTL() int64
func (*IssueRequest) ProtoMessage ¶
func (*IssueRequest) ProtoMessage()
func (*IssueRequest) ProtoReflect ¶
func (x *IssueRequest) ProtoReflect() protoreflect.Message
func (*IssueRequest) Reset ¶
func (x *IssueRequest) Reset()
func (*IssueRequest) String ¶
func (x *IssueRequest) String() string
type Key ¶
type Key struct { Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` // contains filtered or unexported fields }
func (*Key) Descriptor
deprecated
func (*Key) ProtoMessage ¶
func (*Key) ProtoMessage()
func (*Key) ProtoReflect ¶
func (x *Key) ProtoReflect() protoreflect.Message
type UnimplementedAuthServiceServer ¶
type UnimplementedAuthServiceServer struct { }
UnimplementedAuthServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedAuthServiceServer) Identify ¶
func (UnimplementedAuthServiceServer) Identify(context.Context, *IdentifyRequest) (*Identity, error)
func (UnimplementedAuthServiceServer) Issue ¶
func (UnimplementedAuthServiceServer) Issue(context.Context, *IssueRequest) (*Key, 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.