Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterTokenServiceServer(s grpc.ServiceRegistrar, srv TokenServiceServer)
- type IssueReq
- type RefreshReq
- type Token
- func (*Token) Descriptor() ([]byte, []int)deprecated
- func (x *Token) GetAccessToken() string
- func (x *Token) GetAccessType() string
- func (x *Token) GetRefreshToken() string
- func (*Token) ProtoMessage()
- func (x *Token) ProtoReflect() protoreflect.Message
- func (x *Token) Reset()
- func (x *Token) String() string
- type TokenServiceClient
- type TokenServiceServer
- type UnimplementedTokenServiceServer
- type UnsafeTokenServiceServer
Constants ¶
const ( TokenService_Issue_FullMethodName = "/token.v1.TokenService/Issue" TokenService_Refresh_FullMethodName = "/token.v1.TokenService/Refresh" )
Variables ¶
var File_token_v1_token_proto protoreflect.FileDescriptor
var TokenService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "token.v1.TokenService", HandlerType: (*TokenServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Issue", Handler: _TokenService_Issue_Handler, }, { MethodName: "Refresh", Handler: _TokenService_Refresh_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "token/v1/token.proto", }
TokenService_ServiceDesc is the grpc.ServiceDesc for TokenService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterTokenServiceServer ¶
func RegisterTokenServiceServer(s grpc.ServiceRegistrar, srv TokenServiceServer)
Types ¶
type IssueReq ¶
type IssueReq struct { UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` Type uint32 `protobuf:"varint,3,opt,name=type,proto3" json:"type,omitempty"` // contains filtered or unexported fields }
func (*IssueReq) Descriptor
deprecated
func (*IssueReq) ProtoMessage ¶
func (*IssueReq) ProtoMessage()
func (*IssueReq) ProtoReflect ¶
func (x *IssueReq) ProtoReflect() protoreflect.Message
type RefreshReq ¶
type RefreshReq struct { RefreshToken string `protobuf:"bytes,1,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"` // contains filtered or unexported fields }
func (*RefreshReq) Descriptor
deprecated
func (*RefreshReq) Descriptor() ([]byte, []int)
Deprecated: Use RefreshReq.ProtoReflect.Descriptor instead.
func (*RefreshReq) GetRefreshToken ¶
func (x *RefreshReq) GetRefreshToken() string
func (*RefreshReq) ProtoMessage ¶
func (*RefreshReq) ProtoMessage()
func (*RefreshReq) ProtoReflect ¶
func (x *RefreshReq) ProtoReflect() protoreflect.Message
func (*RefreshReq) Reset ¶
func (x *RefreshReq) Reset()
func (*RefreshReq) String ¶
func (x *RefreshReq) String() string
type Token ¶
type Token struct { AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` RefreshToken *string `protobuf:"bytes,2,opt,name=refresh_token,json=refreshToken,proto3,oneof" json:"refresh_token,omitempty"` AccessType string `protobuf:"bytes,3,opt,name=access_type,json=accessType,proto3" json:"access_type,omitempty"` // contains filtered or unexported fields }
If a token is not carrying any information itself, the type field can be used to determine how to validate the token. Also, different tokens can be encoded in different ways.
func (*Token) Descriptor
deprecated
func (*Token) GetAccessToken ¶
func (*Token) GetAccessType ¶
func (*Token) GetRefreshToken ¶
func (*Token) ProtoMessage ¶
func (*Token) ProtoMessage()
func (*Token) ProtoReflect ¶
func (x *Token) ProtoReflect() protoreflect.Message
type TokenServiceClient ¶
type TokenServiceClient interface { Issue(ctx context.Context, in *IssueReq, opts ...grpc.CallOption) (*Token, error) Refresh(ctx context.Context, in *RefreshReq, opts ...grpc.CallOption) (*Token, error) }
TokenServiceClient is the client API for TokenService 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 NewTokenServiceClient ¶
func NewTokenServiceClient(cc grpc.ClientConnInterface) TokenServiceClient
type TokenServiceServer ¶
type TokenServiceServer interface { Issue(context.Context, *IssueReq) (*Token, error) Refresh(context.Context, *RefreshReq) (*Token, error) // contains filtered or unexported methods }
TokenServiceServer is the server API for TokenService service. All implementations must embed UnimplementedTokenServiceServer for forward compatibility.
type UnimplementedTokenServiceServer ¶
type UnimplementedTokenServiceServer struct{}
UnimplementedTokenServiceServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedTokenServiceServer) Refresh ¶
func (UnimplementedTokenServiceServer) Refresh(context.Context, *RefreshReq) (*Token, error)
type UnsafeTokenServiceServer ¶
type UnsafeTokenServiceServer interface {
// contains filtered or unexported methods
}
UnsafeTokenServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to TokenServiceServer will result in compilation errors.