v1

package
v0.16.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 11, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TokenService_Issue_FullMethodName   = "/token.v1.TokenService/Issue"
	TokenService_Refresh_FullMethodName = "/token.v1.TokenService/Refresh"
)

Variables

View Source
var File_token_v1_token_proto protoreflect.FileDescriptor
View Source
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) Descriptor() ([]byte, []int)

Deprecated: Use IssueReq.ProtoReflect.Descriptor instead.

func (*IssueReq) GetType

func (x *IssueReq) GetType() uint32

func (*IssueReq) GetUserId

func (x *IssueReq) GetUserId() string

func (*IssueReq) ProtoMessage

func (*IssueReq) ProtoMessage()

func (*IssueReq) ProtoReflect

func (x *IssueReq) ProtoReflect() protoreflect.Message

func (*IssueReq) Reset

func (x *IssueReq) Reset()

func (*IssueReq) String

func (x *IssueReq) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Token.ProtoReflect.Descriptor instead.

func (*Token) GetAccessToken

func (x *Token) GetAccessToken() string

func (*Token) GetAccessType

func (x *Token) GetAccessType() string

func (*Token) GetRefreshToken

func (x *Token) GetRefreshToken() string

func (*Token) ProtoMessage

func (*Token) ProtoMessage()

func (*Token) ProtoReflect

func (x *Token) ProtoReflect() protoreflect.Message

func (*Token) Reset

func (x *Token) Reset()

func (*Token) String

func (x *Token) String() string

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.

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) Issue

func (UnimplementedTokenServiceServer) Refresh

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL