auth

package
v0.0.0-...-ae89c11 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	Auth_UserLogin_FullMethodName    = "/atreus.auth.Auth/userLogin"
	Auth_UserToken_FullMethodName    = "/atreus.auth.Auth/userToken"
	Auth_GetUserToken_FullMethodName = "/atreus.auth.Auth/getUserToken"
	Auth_ForceLogout_FullMethodName  = "/atreus.auth.Auth/forceLogout"
	Auth_ParseToken_FullMethodName   = "/atreus.auth.Auth/parseToken"
)
View Source
const OperationAuthforceLogout = "/atreus.auth.Auth/forceLogout"
View Source
const OperationAuthgetUserToken = "/atreus.auth.Auth/getUserToken"
View Source
const OperationAuthparseToken = "/atreus.auth.Auth/parseToken"
View Source
const OperationAuthuserLogin = "/atreus.auth.Auth/userLogin"
View Source
const OperationAuthuserToken = "/atreus.auth.Auth/userToken"

Variables

View Source
var Auth_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "atreus.auth.Auth",
	HandlerType: (*AuthServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "userLogin",
			Handler:    _Auth_UserLogin_Handler,
		},
		{
			MethodName: "userToken",
			Handler:    _Auth_UserToken_Handler,
		},
		{
			MethodName: "getUserToken",
			Handler:    _Auth_GetUserToken_Handler,
		},
		{
			MethodName: "forceLogout",
			Handler:    _Auth_ForceLogout_Handler,
		},
		{
			MethodName: "parseToken",
			Handler:    _Auth_ParseToken_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "api/auth/auth.proto",
}

Auth_ServiceDesc is the grpc.ServiceDesc for Auth service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var File_api_auth_auth_proto protoreflect.FileDescriptor

Functions

func RegisterAuthHTTPServer

func RegisterAuthHTTPServer(s *http.Server, srv AuthHTTPServer)

func RegisterAuthServer

func RegisterAuthServer(s grpc.ServiceRegistrar, srv AuthServer)

Types

type AuthClient

type AuthClient interface {
	// login
	UserLogin(ctx context.Context, in *UserLoginReq, opts ...grpc.CallOption) (*UserTokenResp, error)
	// 生成token
	UserToken(ctx context.Context, in *UserTokenReq, opts ...grpc.CallOption) (*UserTokenResp, error)
	// 管理员获取用户 token
	GetUserToken(ctx context.Context, in *GetUserTokenReq, opts ...grpc.CallOption) (*GetUserTokenResp, error)
	// 强制退出登录
	ForceLogout(ctx context.Context, in *ForceLogoutReq, opts ...grpc.CallOption) (*ForceLogoutResp, error)
	// 解析token
	ParseToken(ctx context.Context, in *ParseTokenReq, opts ...grpc.CallOption) (*ParseTokenResp, error)
}

AuthClient is the client API for Auth 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 NewAuthClient

func NewAuthClient(cc grpc.ClientConnInterface) AuthClient

type AuthHTTPClient

type AuthHTTPClient interface {
	ForceLogout(ctx context.Context, req *ForceLogoutReq, opts ...http.CallOption) (rsp *ForceLogoutResp, err error)
	GetUserToken(ctx context.Context, req *GetUserTokenReq, opts ...http.CallOption) (rsp *GetUserTokenResp, err error)
	ParseToken(ctx context.Context, req *ParseTokenReq, opts ...http.CallOption) (rsp *ParseTokenResp, err error)
	UserLogin(ctx context.Context, req *UserLoginReq, opts ...http.CallOption) (rsp *UserTokenResp, err error)
	UserToken(ctx context.Context, req *UserTokenReq, opts ...http.CallOption) (rsp *UserTokenResp, err error)
}

func NewAuthHTTPClient

func NewAuthHTTPClient(client *http.Client) AuthHTTPClient

type AuthHTTPClientImpl

type AuthHTTPClientImpl struct {
	// contains filtered or unexported fields
}

func (*AuthHTTPClientImpl) ForceLogout

func (c *AuthHTTPClientImpl) ForceLogout(ctx context.Context, in *ForceLogoutReq, opts ...http.CallOption) (*ForceLogoutResp, error)

func (*AuthHTTPClientImpl) GetUserToken

func (c *AuthHTTPClientImpl) GetUserToken(ctx context.Context, in *GetUserTokenReq, opts ...http.CallOption) (*GetUserTokenResp, error)

func (*AuthHTTPClientImpl) ParseToken

func (c *AuthHTTPClientImpl) ParseToken(ctx context.Context, in *ParseTokenReq, opts ...http.CallOption) (*ParseTokenResp, error)

func (*AuthHTTPClientImpl) UserLogin

func (c *AuthHTTPClientImpl) UserLogin(ctx context.Context, in *UserLoginReq, opts ...http.CallOption) (*UserTokenResp, error)

func (*AuthHTTPClientImpl) UserToken

func (c *AuthHTTPClientImpl) UserToken(ctx context.Context, in *UserTokenReq, opts ...http.CallOption) (*UserTokenResp, error)

type AuthHTTPServer

type AuthHTTPServer interface {
	// ForceLogout强制退出登录
	ForceLogout(context.Context, *ForceLogoutReq) (*ForceLogoutResp, error)
	// GetUserToken 管理员获取用户 token
	GetUserToken(context.Context, *GetUserTokenReq) (*GetUserTokenResp, error)
	// ParseToken解析token
	ParseToken(context.Context, *ParseTokenReq) (*ParseTokenResp, error)
	// UserLoginlogin
	UserLogin(context.Context, *UserLoginReq) (*UserTokenResp, error)
	// UserToken生成token
	UserToken(context.Context, *UserTokenReq) (*UserTokenResp, error)
}

type AuthImpl

type AuthImpl struct {
	// contains filtered or unexported fields
}

func NewAuthImpl

func NewAuthImpl(conn *grpc.ClientConn) *AuthImpl

func (*AuthImpl) ForceLogout

func (c *AuthImpl) ForceLogout(ctx context.Context, in *ForceLogoutReq) (*ForceLogoutResp, error)

func (*AuthImpl) GetUserToken

func (c *AuthImpl) GetUserToken(ctx context.Context, in *GetUserTokenReq) (*GetUserTokenResp, error)

func (*AuthImpl) ParseToken

func (c *AuthImpl) ParseToken(ctx context.Context, in *ParseTokenReq) (*ParseTokenResp, error)

func (*AuthImpl) UserLogin

func (c *AuthImpl) UserLogin(ctx context.Context, in *UserLoginReq) (*UserTokenResp, error)

func (*AuthImpl) UserToken

func (c *AuthImpl) UserToken(ctx context.Context, in *UserTokenReq) (*UserTokenResp, error)

type AuthServer

type AuthServer interface {
	// login
	UserLogin(context.Context, *UserLoginReq) (*UserTokenResp, error)
	// 生成token
	UserToken(context.Context, *UserTokenReq) (*UserTokenResp, error)
	// 管理员获取用户 token
	GetUserToken(context.Context, *GetUserTokenReq) (*GetUserTokenResp, error)
	// 强制退出登录
	ForceLogout(context.Context, *ForceLogoutReq) (*ForceLogoutResp, error)
	// 解析token
	ParseToken(context.Context, *ParseTokenReq) (*ParseTokenResp, error)
}

AuthServer is the server API for Auth service. All implementations should embed UnimplementedAuthServer for forward compatibility

type ForceLogoutReq

type ForceLogoutReq struct {
	PlatformID int32  `protobuf:"varint,1,opt,name=platformID,proto3" json:"platformID,omitempty"`
	UserID     string `protobuf:"bytes,2,opt,name=userID,proto3" json:"userID,omitempty"`
	// contains filtered or unexported fields
}

func (*ForceLogoutReq) Descriptor deprecated

func (*ForceLogoutReq) Descriptor() ([]byte, []int)

Deprecated: Use ForceLogoutReq.ProtoReflect.Descriptor instead.

func (*ForceLogoutReq) GetPlatformID

func (x *ForceLogoutReq) GetPlatformID() int32

func (*ForceLogoutReq) GetUserID

func (x *ForceLogoutReq) GetUserID() string

func (*ForceLogoutReq) ProtoMessage

func (*ForceLogoutReq) ProtoMessage()

func (*ForceLogoutReq) ProtoReflect

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

func (*ForceLogoutReq) Reset

func (x *ForceLogoutReq) Reset()

func (*ForceLogoutReq) String

func (x *ForceLogoutReq) String() string

type ForceLogoutResp

type ForceLogoutResp struct {
	// contains filtered or unexported fields
}

func (*ForceLogoutResp) Descriptor deprecated

func (*ForceLogoutResp) Descriptor() ([]byte, []int)

Deprecated: Use ForceLogoutResp.ProtoReflect.Descriptor instead.

func (*ForceLogoutResp) ProtoMessage

func (*ForceLogoutResp) ProtoMessage()

func (*ForceLogoutResp) ProtoReflect

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

func (*ForceLogoutResp) Reset

func (x *ForceLogoutResp) Reset()

func (*ForceLogoutResp) String

func (x *ForceLogoutResp) String() string

type GetUserTokenReq

type GetUserTokenReq struct {
	PlatformID int32  `protobuf:"varint,1,opt,name=platformID,proto3" json:"platformID,omitempty"`
	UserID     string `protobuf:"bytes,2,opt,name=userID,proto3" json:"userID,omitempty"`
	// contains filtered or unexported fields
}

func (*GetUserTokenReq) Descriptor deprecated

func (*GetUserTokenReq) Descriptor() ([]byte, []int)

Deprecated: Use GetUserTokenReq.ProtoReflect.Descriptor instead.

func (*GetUserTokenReq) GetPlatformID

func (x *GetUserTokenReq) GetPlatformID() int32

func (*GetUserTokenReq) GetUserID

func (x *GetUserTokenReq) GetUserID() string

func (*GetUserTokenReq) ProtoMessage

func (*GetUserTokenReq) ProtoMessage()

func (*GetUserTokenReq) ProtoReflect

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

func (*GetUserTokenReq) Reset

func (x *GetUserTokenReq) Reset()

func (*GetUserTokenReq) String

func (x *GetUserTokenReq) String() string

type GetUserTokenResp

type GetUserTokenResp struct {
	Token             string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
	ExpireTimeSeconds int64  `protobuf:"varint,2,opt,name=expireTimeSeconds,proto3" json:"expireTimeSeconds,omitempty"`
	// contains filtered or unexported fields
}

func (*GetUserTokenResp) Descriptor deprecated

func (*GetUserTokenResp) Descriptor() ([]byte, []int)

Deprecated: Use GetUserTokenResp.ProtoReflect.Descriptor instead.

func (*GetUserTokenResp) GetExpireTimeSeconds

func (x *GetUserTokenResp) GetExpireTimeSeconds() int64

func (*GetUserTokenResp) GetToken

func (x *GetUserTokenResp) GetToken() string

func (*GetUserTokenResp) ProtoMessage

func (*GetUserTokenResp) ProtoMessage()

func (*GetUserTokenResp) ProtoReflect

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

func (*GetUserTokenResp) Reset

func (x *GetUserTokenResp) Reset()

func (*GetUserTokenResp) String

func (x *GetUserTokenResp) String() string

type ParseTokenReq

type ParseTokenReq struct {
	Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
	// contains filtered or unexported fields
}

func (*ParseTokenReq) Descriptor deprecated

func (*ParseTokenReq) Descriptor() ([]byte, []int)

Deprecated: Use ParseTokenReq.ProtoReflect.Descriptor instead.

func (*ParseTokenReq) GetToken

func (x *ParseTokenReq) GetToken() string

func (*ParseTokenReq) ProtoMessage

func (*ParseTokenReq) ProtoMessage()

func (*ParseTokenReq) ProtoReflect

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

func (*ParseTokenReq) Reset

func (x *ParseTokenReq) Reset()

func (*ParseTokenReq) String

func (x *ParseTokenReq) String() string

type ParseTokenResp

type ParseTokenResp struct {
	UserID            string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID,omitempty"`
	Platform          string `protobuf:"bytes,2,opt,name=platform,proto3" json:"platform,omitempty"`
	ExpireTimeSeconds int64  `protobuf:"varint,4,opt,name=expireTimeSeconds,proto3" json:"expireTimeSeconds,omitempty"`
	// contains filtered or unexported fields
}

func (*ParseTokenResp) Descriptor deprecated

func (*ParseTokenResp) Descriptor() ([]byte, []int)

Deprecated: Use ParseTokenResp.ProtoReflect.Descriptor instead.

func (*ParseTokenResp) GetExpireTimeSeconds

func (x *ParseTokenResp) GetExpireTimeSeconds() int64

func (*ParseTokenResp) GetPlatform

func (x *ParseTokenResp) GetPlatform() string

func (*ParseTokenResp) GetUserID

func (x *ParseTokenResp) GetUserID() string

func (*ParseTokenResp) ProtoMessage

func (*ParseTokenResp) ProtoMessage()

func (*ParseTokenResp) ProtoReflect

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

func (*ParseTokenResp) Reset

func (x *ParseTokenResp) Reset()

func (*ParseTokenResp) String

func (x *ParseTokenResp) String() string

type UnimplementedAuthServer

type UnimplementedAuthServer struct {
}

UnimplementedAuthServer should be embedded to have forward compatible implementations.

func (UnimplementedAuthServer) ForceLogout

func (UnimplementedAuthServer) GetUserToken

func (UnimplementedAuthServer) ParseToken

func (UnimplementedAuthServer) UserLogin

func (UnimplementedAuthServer) UserToken

type UnsafeAuthServer

type UnsafeAuthServer interface {
	// contains filtered or unexported methods
}

UnsafeAuthServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AuthServer will result in compilation errors.

type UserLoginReq

type UserLoginReq 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 (*UserLoginReq) Descriptor deprecated

func (*UserLoginReq) Descriptor() ([]byte, []int)

Deprecated: Use UserLoginReq.ProtoReflect.Descriptor instead.

func (*UserLoginReq) GetPassword

func (x *UserLoginReq) GetPassword() string

func (*UserLoginReq) GetUsername

func (x *UserLoginReq) GetUsername() string

func (*UserLoginReq) ProtoMessage

func (*UserLoginReq) ProtoMessage()

func (*UserLoginReq) ProtoReflect

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

func (*UserLoginReq) Reset

func (x *UserLoginReq) Reset()

func (*UserLoginReq) String

func (x *UserLoginReq) String() string

type UserTokenReq

type UserTokenReq struct {
	Secret     string `protobuf:"bytes,1,opt,name=secret,proto3" json:"secret,omitempty"`
	PlatformID int32  `protobuf:"varint,2,opt,name=platformID,proto3" json:"platformID,omitempty"`
	UserID     string `protobuf:"bytes,3,opt,name=userID,proto3" json:"userID,omitempty"`
	// contains filtered or unexported fields
}

func (*UserTokenReq) Descriptor deprecated

func (*UserTokenReq) Descriptor() ([]byte, []int)

Deprecated: Use UserTokenReq.ProtoReflect.Descriptor instead.

func (*UserTokenReq) GetPlatformID

func (x *UserTokenReq) GetPlatformID() int32

func (*UserTokenReq) GetSecret

func (x *UserTokenReq) GetSecret() string

func (*UserTokenReq) GetUserID

func (x *UserTokenReq) GetUserID() string

func (*UserTokenReq) ProtoMessage

func (*UserTokenReq) ProtoMessage()

func (*UserTokenReq) ProtoReflect

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

func (*UserTokenReq) Reset

func (x *UserTokenReq) Reset()

func (*UserTokenReq) String

func (x *UserTokenReq) String() string

type UserTokenResp

type UserTokenResp struct {
	Token             string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"`
	ExpireTimeSeconds int64  `protobuf:"varint,3,opt,name=expireTimeSeconds,proto3" json:"expireTimeSeconds,omitempty"`
	// contains filtered or unexported fields
}

func (*UserTokenResp) Descriptor deprecated

func (*UserTokenResp) Descriptor() ([]byte, []int)

Deprecated: Use UserTokenResp.ProtoReflect.Descriptor instead.

func (*UserTokenResp) GetExpireTimeSeconds

func (x *UserTokenResp) GetExpireTimeSeconds() int64

func (*UserTokenResp) GetToken

func (x *UserTokenResp) GetToken() string

func (*UserTokenResp) ProtoMessage

func (*UserTokenResp) ProtoMessage()

func (*UserTokenResp) ProtoReflect

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

func (*UserTokenResp) Reset

func (x *UserTokenResp) Reset()

func (*UserTokenResp) String

func (x *UserTokenResp) String() string

Jump to

Keyboard shortcuts

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