Documentation ¶
Index ¶
- Variables
- func HttpEntry() *http.EntrySet
- func RegisterAdminServiceServer(s *grpc.Server, srv AdminServiceServer)
- func RegisterUserServiceServer(s *grpc.Server, srv UserServiceServer)
- type AdminServiceClient
- type AdminServiceServer
- type DescribeSessionRequest
- func (*DescribeSessionRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DescribeSessionRequest) GetAccount() string
- func (x *DescribeSessionRequest) GetDomain() string
- func (x *DescribeSessionRequest) GetLogin() bool
- func (x *DescribeSessionRequest) GetSessionId() string
- func (req *DescribeSessionRequest) HasAccount() bool
- func (*DescribeSessionRequest) ProtoMessage()
- func (x *DescribeSessionRequest) ProtoReflect() protoreflect.Message
- func (x *DescribeSessionRequest) Reset()
- func (x *DescribeSessionRequest) String() string
- func (req *DescribeSessionRequest) Validate() error
- type IPInfo
- func (*IPInfo) Descriptor() ([]byte, []int)deprecated
- func (x *IPInfo) GetCity() string
- func (x *IPInfo) GetCityId() int64
- func (x *IPInfo) GetCountry() string
- func (x *IPInfo) GetIsp() string
- func (x *IPInfo) GetProvince() string
- func (x *IPInfo) GetRegion() string
- func (*IPInfo) ProtoMessage()
- func (x *IPInfo) ProtoReflect() protoreflect.Message
- func (x *IPInfo) Reset()
- func (x *IPInfo) String() string
- type LogoutRequest
- func (*LogoutRequest) Descriptor() ([]byte, []int)deprecated
- func (x *LogoutRequest) GetAccount() string
- func (x *LogoutRequest) GetSessionId() string
- func (*LogoutRequest) ProtoMessage()
- func (x *LogoutRequest) ProtoReflect() protoreflect.Message
- func (x *LogoutRequest) Reset()
- func (x *LogoutRequest) String() string
- type QuerySessionRequest
- func (*QuerySessionRequest) Descriptor() ([]byte, []int)deprecated
- func (x *QuerySessionRequest) GetAccount() string
- func (x *QuerySessionRequest) GetApplicationId() string
- func (x *QuerySessionRequest) GetEndLoginTime() int64
- func (x *QuerySessionRequest) GetGrantType() token.GrantType
- func (x *QuerySessionRequest) GetLoginCity() string
- func (x *QuerySessionRequest) GetLoginIp() string
- func (x *QuerySessionRequest) GetPage() *page.PageRequest
- func (x *QuerySessionRequest) GetStartLoginTime() int64
- func (*QuerySessionRequest) ProtoMessage()
- func (x *QuerySessionRequest) ProtoReflect() protoreflect.Message
- func (x *QuerySessionRequest) Reset()
- func (x *QuerySessionRequest) String() string
- func (req *QuerySessionRequest) Validate() error
- type QueryUserLastSessionRequest
- func (*QueryUserLastSessionRequest) Descriptor() ([]byte, []int)deprecated
- func (x *QueryUserLastSessionRequest) GetAccount() string
- func (*QueryUserLastSessionRequest) ProtoMessage()
- func (x *QueryUserLastSessionRequest) ProtoReflect() protoreflect.Message
- func (x *QueryUserLastSessionRequest) Reset()
- func (x *QueryUserLastSessionRequest) String() string
- func (req *QueryUserLastSessionRequest) Validate() error
- type Session
- func (*Session) Descriptor() ([]byte, []int)deprecated
- func (x *Session) GetAccessToken() string
- func (x *Session) GetAccount() string
- func (x *Session) GetApplicationId() string
- func (x *Session) GetApplicationName() string
- func (x *Session) GetDomain() string
- func (x *Session) GetGrantType() token.GrantType
- func (x *Session) GetId() string
- func (x *Session) GetIpInfo() *IPInfo
- func (x *Session) GetLoginAt() int64
- func (x *Session) GetLoginIp() string
- func (x *Session) GetLogoutAt() int64
- func (x *Session) GetUserAgent() *UserAgent
- func (x *Session) GetUserType() types.UserType
- func (s *Session) ParseUserAgent(userAgent string)
- func (*Session) ProtoMessage()
- func (x *Session) ProtoReflect() protoreflect.Message
- func (x *Session) Reset()
- func (x *Session) String() string
- type Set
- func (s *Set) Add(item *Session)
- func (*Set) Descriptor() ([]byte, []int)deprecated
- func (x *Set) GetItems() []*Session
- func (x *Set) GetTotal() int64
- func (s *Set) IsEmpty() bool
- func (s *Set) Length() int
- func (*Set) ProtoMessage()
- func (x *Set) ProtoReflect() protoreflect.Message
- func (x *Set) Reset()
- func (x *Set) String() string
- type UnimplementedAdminServiceServer
- type UnimplementedUserServiceServer
- func (UnimplementedUserServiceServer) DescribeSession(context.Context, *DescribeSessionRequest) (*Session, error)
- func (UnimplementedUserServiceServer) Login(context.Context, *token.Token) (*Session, error)
- func (UnimplementedUserServiceServer) Logout(context.Context, *LogoutRequest) (*Session, error)
- func (UnimplementedUserServiceServer) QuerySession(context.Context, *QuerySessionRequest) (*Set, error)
- type UnsafeAdminServiceServer
- type UnsafeUserServiceServer
- type UserAgent
- func (*UserAgent) Descriptor() ([]byte, []int)deprecated
- func (x *UserAgent) GetBrowserName() string
- func (x *UserAgent) GetBrowserVersion() string
- func (x *UserAgent) GetEngineName() string
- func (x *UserAgent) GetEngineVersion() string
- func (x *UserAgent) GetOs() string
- func (x *UserAgent) GetPlatform() string
- func (*UserAgent) ProtoMessage()
- func (x *UserAgent) ProtoReflect() protoreflect.Message
- func (x *UserAgent) Reset()
- func (x *UserAgent) String() string
- type UserServiceClient
- type UserServiceServer
Constants ¶
This section is empty.
Variables ¶
var File_pkg_session_pb_request_proto protoreflect.FileDescriptor
var File_pkg_session_pb_service_proto protoreflect.FileDescriptor
var File_pkg_session_pb_session_proto protoreflect.FileDescriptor
Functions ¶
func RegisterAdminServiceServer ¶
func RegisterAdminServiceServer(s *grpc.Server, srv AdminServiceServer)
func RegisterUserServiceServer ¶
func RegisterUserServiceServer(s *grpc.Server, srv UserServiceServer)
Types ¶
type AdminServiceClient ¶
type AdminServiceClient interface {
QueryUserLastSession(ctx context.Context, in *QueryUserLastSessionRequest, opts ...grpc.CallOption) (*Session, error)
}
AdminServiceClient is the client API for AdminService 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 NewAdminServiceClient ¶
func NewAdminServiceClient(cc grpc.ClientConnInterface) AdminServiceClient
type AdminServiceServer ¶
type AdminServiceServer interface { QueryUserLastSession(context.Context, *QueryUserLastSessionRequest) (*Session, error) // contains filtered or unexported methods }
AdminServiceServer is the server API for AdminService service. All implementations must embed UnimplementedAdminServiceServer for forward compatibility
type DescribeSessionRequest ¶
type DescribeSessionRequest struct { SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain,omitempty"` Account string `protobuf:"bytes,3,opt,name=account,proto3" json:"account,omitempty"` Login bool `protobuf:"varint,4,opt,name=login,proto3" json:"login,omitempty"` // contains filtered or unexported fields }
DescribeSessionRequest todo
func NewDescribeSessionRequestWithID ¶
func NewDescribeSessionRequestWithID(id string) *DescribeSessionRequest
NewDescribeSessionRequestWithID todo
func NewDescribeSessionRequestWithToken ¶
func NewDescribeSessionRequestWithToken(tk *token.Token) *DescribeSessionRequest
NewDescribeSessionRequestWithToken todo
func (*DescribeSessionRequest) Descriptor
deprecated
func (*DescribeSessionRequest) Descriptor() ([]byte, []int)
Deprecated: Use DescribeSessionRequest.ProtoReflect.Descriptor instead.
func (*DescribeSessionRequest) GetAccount ¶
func (x *DescribeSessionRequest) GetAccount() string
func (*DescribeSessionRequest) GetDomain ¶
func (x *DescribeSessionRequest) GetDomain() string
func (*DescribeSessionRequest) GetLogin ¶
func (x *DescribeSessionRequest) GetLogin() bool
func (*DescribeSessionRequest) GetSessionId ¶
func (x *DescribeSessionRequest) GetSessionId() string
func (*DescribeSessionRequest) HasAccount ¶
func (req *DescribeSessionRequest) HasAccount() bool
HasAccount todo
func (*DescribeSessionRequest) ProtoMessage ¶
func (*DescribeSessionRequest) ProtoMessage()
func (*DescribeSessionRequest) ProtoReflect ¶
func (x *DescribeSessionRequest) ProtoReflect() protoreflect.Message
func (*DescribeSessionRequest) Reset ¶
func (x *DescribeSessionRequest) Reset()
func (*DescribeSessionRequest) String ¶
func (x *DescribeSessionRequest) String() string
func (*DescribeSessionRequest) Validate ¶
func (req *DescribeSessionRequest) Validate() error
Validate todo
type IPInfo ¶
type IPInfo struct { CityId int64 `protobuf:"varint,1,opt,name=city_id,json=cityId,proto3" json:"city_id" bson:"city_id"` Country string `protobuf:"bytes,2,opt,name=country,proto3" json:"country" bson:"country"` Region string `protobuf:"bytes,3,opt,name=region,proto3" json:"region" bson:"region"` Province string `protobuf:"bytes,4,opt,name=province,proto3" json:"province" bson:"province"` City string `protobuf:"bytes,5,opt,name=city,proto3" json:"city" bson:"city"` Isp string `protobuf:"bytes,6,opt,name=isp,proto3" json:"isp" bson:"isp"` // contains filtered or unexported fields }
IPInfo todo
func (*IPInfo) Descriptor
deprecated
func (*IPInfo) GetCountry ¶
func (*IPInfo) GetProvince ¶
func (*IPInfo) ProtoMessage ¶
func (*IPInfo) ProtoMessage()
func (*IPInfo) ProtoReflect ¶
func (x *IPInfo) ProtoReflect() protoreflect.Message
type LogoutRequest ¶
type LogoutRequest struct { SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` Account string `protobuf:"bytes,2,opt,name=account,proto3" json:"account,omitempty"` // contains filtered or unexported fields }
LogoutRequest 登出请求
func NewLogoutRequest ¶
func NewLogoutRequest(sessionID string) *LogoutRequest
NewLogoutRequest todo
func (*LogoutRequest) Descriptor
deprecated
func (*LogoutRequest) Descriptor() ([]byte, []int)
Deprecated: Use LogoutRequest.ProtoReflect.Descriptor instead.
func (*LogoutRequest) GetAccount ¶
func (x *LogoutRequest) GetAccount() string
func (*LogoutRequest) GetSessionId ¶
func (x *LogoutRequest) GetSessionId() string
func (*LogoutRequest) ProtoMessage ¶
func (*LogoutRequest) ProtoMessage()
func (*LogoutRequest) ProtoReflect ¶
func (x *LogoutRequest) ProtoReflect() protoreflect.Message
func (*LogoutRequest) Reset ¶
func (x *LogoutRequest) Reset()
func (*LogoutRequest) String ¶
func (x *LogoutRequest) String() string
type QuerySessionRequest ¶
type QuerySessionRequest struct { Page *page.PageRequest `protobuf:"bytes,1,opt,name=page,proto3" json:"page,omitempty"` Account string `protobuf:"bytes,2,opt,name=account,proto3" json:"account,omitempty"` LoginIp string `protobuf:"bytes,3,opt,name=login_ip,json=loginIp,proto3" json:"login_ip,omitempty"` LoginCity string `protobuf:"bytes,4,opt,name=login_city,json=loginCity,proto3" json:"login_city,omitempty"` ApplicationId string `protobuf:"bytes,5,opt,name=application_id,json=applicationId,proto3" json:"application_id,omitempty"` GrantType token.GrantType `protobuf:"varint,6,opt,name=grant_type,json=grantType,proto3,enum=keyauth.token.GrantType" json:"grant_type,omitempty"` StartLoginTime int64 `protobuf:"varint,7,opt,name=start_login_time,json=startLoginTime,proto3" json:"start_login_time,omitempty"` EndLoginTime int64 `protobuf:"varint,8,opt,name=end_login_time,json=endLoginTime,proto3" json:"end_login_time,omitempty"` // contains filtered or unexported fields }
QuerySessionRequest todo
func NewQuerySessionRequest ¶
func NewQuerySessionRequest(pageReq *request.PageRequest) *QuerySessionRequest
NewQuerySessionRequest 列表查询请求
func NewQuerySessionRequestFromHTTP ¶
func NewQuerySessionRequestFromHTTP(r *http.Request) (*QuerySessionRequest, error)
NewQuerySessionRequestFromHTTP 列表查询请求
func NewQuerySessionRequestFromToken ¶
func NewQuerySessionRequestFromToken(tk *token.Token) *QuerySessionRequest
NewQuerySessionRequestFromToken 列表查询请求
func (*QuerySessionRequest) Descriptor
deprecated
func (*QuerySessionRequest) Descriptor() ([]byte, []int)
Deprecated: Use QuerySessionRequest.ProtoReflect.Descriptor instead.
func (*QuerySessionRequest) GetAccount ¶
func (x *QuerySessionRequest) GetAccount() string
func (*QuerySessionRequest) GetApplicationId ¶
func (x *QuerySessionRequest) GetApplicationId() string
func (*QuerySessionRequest) GetEndLoginTime ¶
func (x *QuerySessionRequest) GetEndLoginTime() int64
func (*QuerySessionRequest) GetGrantType ¶
func (x *QuerySessionRequest) GetGrantType() token.GrantType
func (*QuerySessionRequest) GetLoginCity ¶
func (x *QuerySessionRequest) GetLoginCity() string
func (*QuerySessionRequest) GetLoginIp ¶
func (x *QuerySessionRequest) GetLoginIp() string
func (*QuerySessionRequest) GetPage ¶
func (x *QuerySessionRequest) GetPage() *page.PageRequest
func (*QuerySessionRequest) GetStartLoginTime ¶
func (x *QuerySessionRequest) GetStartLoginTime() int64
func (*QuerySessionRequest) ProtoMessage ¶
func (*QuerySessionRequest) ProtoMessage()
func (*QuerySessionRequest) ProtoReflect ¶
func (x *QuerySessionRequest) ProtoReflect() protoreflect.Message
func (*QuerySessionRequest) Reset ¶
func (x *QuerySessionRequest) Reset()
func (*QuerySessionRequest) String ¶
func (x *QuerySessionRequest) String() string
func (*QuerySessionRequest) Validate ¶
func (req *QuerySessionRequest) Validate() error
Validate todo
type QueryUserLastSessionRequest ¶
type QueryUserLastSessionRequest struct { Account string `protobuf:"bytes,2,opt,name=account,proto3" json:"account,omitempty" validate:"required"` // contains filtered or unexported fields }
QueryUserLastSessionRequest todo
func NewQueryUserLastSessionRequest ¶
func NewQueryUserLastSessionRequest(account string) *QueryUserLastSessionRequest
NewQueryUserLastSessionRequest todo
func (*QueryUserLastSessionRequest) Descriptor
deprecated
func (*QueryUserLastSessionRequest) Descriptor() ([]byte, []int)
Deprecated: Use QueryUserLastSessionRequest.ProtoReflect.Descriptor instead.
func (*QueryUserLastSessionRequest) GetAccount ¶
func (x *QueryUserLastSessionRequest) GetAccount() string
func (*QueryUserLastSessionRequest) ProtoMessage ¶
func (*QueryUserLastSessionRequest) ProtoMessage()
func (*QueryUserLastSessionRequest) ProtoReflect ¶
func (x *QueryUserLastSessionRequest) ProtoReflect() protoreflect.Message
func (*QueryUserLastSessionRequest) Reset ¶
func (x *QueryUserLastSessionRequest) Reset()
func (*QueryUserLastSessionRequest) String ¶
func (x *QueryUserLastSessionRequest) String() string
func (*QueryUserLastSessionRequest) Validate ¶
func (req *QueryUserLastSessionRequest) Validate() error
Validate todo
type Session ¶
type Session struct { // 唯一ID Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` // 所处域 Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain" bson:"domain"` // 用户名称 Account string `protobuf:"bytes,3,opt,name=account,proto3" json:"account" bson:"account"` // 用户类型 UserType types.UserType `protobuf:"varint,4,opt,name=user_type,json=userType,proto3,enum=keyauth.user.UserType" json:"user_type" bson:"user_type"` // 用户通过哪个端登录的 ApplicationId string `protobuf:"bytes,5,opt,name=application_id,json=applicationId,proto3" json:"application_id" bson:"application_id"` // 用户通过哪个端登录的 ApplicationName string `protobuf:"bytes,6,opt,name=application_name,json=applicationName,proto3" json:"application_name" bson:"application_name"` // 登录方式 GrantType token.GrantType `` /* 126-byte string literal not displayed */ // 登录时间 LoginAt int64 `protobuf:"varint,8,opt,name=login_at,json=loginAt,proto3" json:"login_at" bson:"login_at"` // 登录IP LoginIp string `protobuf:"bytes,9,opt,name=login_ip,json=loginIp,proto3" json:"login_ip" bson:"login_ip"` // 登出时间 LogoutAt int64 `protobuf:"varint,10,opt,name=logout_at,json=logoutAt,proto3" json:"logout_at" bson:"logout_at"` // 应用的网站地址 AccessToken string `protobuf:"bytes,11,opt,name=access_token,json=accessToken,proto3" json:"access_token" bson:"access_token"` UserAgent *UserAgent `protobuf:"bytes,12,opt,name=user_agent,json=userAgent,proto3" json:"user_agent" bson:"user_agent"` IpInfo *IPInfo `protobuf:"bytes,13,opt,name=ip_info,json=ipInfo,proto3" json:"ip_info" bson:"ip_info"` // contains filtered or unexported fields }
Session 登录回话
func NewSession ¶
NewSession todo
func (*Session) Descriptor
deprecated
func (*Session) GetAccessToken ¶
func (*Session) GetAccount ¶
func (*Session) GetApplicationId ¶
func (*Session) GetApplicationName ¶
func (*Session) GetGrantType ¶
func (*Session) GetLoginAt ¶
func (*Session) GetLoginIp ¶
func (*Session) GetLogoutAt ¶
func (*Session) GetUserAgent ¶
func (*Session) GetUserType ¶
func (*Session) ParseUserAgent ¶
ParseUserAgent todo
func (*Session) ProtoMessage ¶
func (*Session) ProtoMessage()
func (*Session) ProtoReflect ¶
func (x *Session) ProtoReflect() protoreflect.Message
type Set ¶
type Set struct { Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total" bson:"total"` Items []*Session `protobuf:"bytes,2,rep,name=items,proto3" json:"items" bson:"items"` // contains filtered or unexported fields }
func (*Set) Descriptor
deprecated
func (*Set) ProtoMessage ¶
func (*Set) ProtoMessage()
func (*Set) ProtoReflect ¶
func (x *Set) ProtoReflect() protoreflect.Message
type UnimplementedAdminServiceServer ¶
type UnimplementedAdminServiceServer struct { }
UnimplementedAdminServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedAdminServiceServer) QueryUserLastSession ¶
func (UnimplementedAdminServiceServer) QueryUserLastSession(context.Context, *QueryUserLastSessionRequest) (*Session, error)
type UnimplementedUserServiceServer ¶
type UnimplementedUserServiceServer struct { }
UnimplementedUserServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedUserServiceServer) DescribeSession ¶
func (UnimplementedUserServiceServer) DescribeSession(context.Context, *DescribeSessionRequest) (*Session, error)
func (UnimplementedUserServiceServer) Logout ¶
func (UnimplementedUserServiceServer) Logout(context.Context, *LogoutRequest) (*Session, error)
func (UnimplementedUserServiceServer) QuerySession ¶
func (UnimplementedUserServiceServer) QuerySession(context.Context, *QuerySessionRequest) (*Set, error)
type UnsafeAdminServiceServer ¶
type UnsafeAdminServiceServer interface {
// contains filtered or unexported methods
}
UnsafeAdminServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AdminServiceServer will result in compilation errors.
type UnsafeUserServiceServer ¶
type UnsafeUserServiceServer interface {
// contains filtered or unexported methods
}
UnsafeUserServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to UserServiceServer will result in compilation errors.
type UserAgent ¶
type UserAgent struct { Os string `protobuf:"bytes,1,opt,name=os,proto3" json:"os" bson:"os"` Platform string `protobuf:"bytes,2,opt,name=platform,proto3" json:"platform" bson:"platform"` EngineName string `protobuf:"bytes,3,opt,name=engine_name,json=engineName,proto3" json:"engine_name" bson:"engine_name"` EngineVersion string `protobuf:"bytes,4,opt,name=engine_version,json=engineVersion,proto3" json:"engine_version" bson:"engine_version"` BrowserName string `protobuf:"bytes,5,opt,name=browser_name,json=browserName,proto3" json:"browser_name" bson:"browser_name"` BrowserVersion string `protobuf:"bytes,6,opt,name=browser_version,json=browserVersion,proto3" json:"browser_version" bson:"browser_version"` // contains filtered or unexported fields }
UserAgent todo
func (*UserAgent) Descriptor
deprecated
func (*UserAgent) GetBrowserName ¶
func (*UserAgent) GetBrowserVersion ¶
func (*UserAgent) GetEngineName ¶
func (*UserAgent) GetEngineVersion ¶
func (*UserAgent) GetPlatform ¶
func (*UserAgent) ProtoMessage ¶
func (*UserAgent) ProtoMessage()
func (*UserAgent) ProtoReflect ¶
func (x *UserAgent) ProtoReflect() protoreflect.Message
type UserServiceClient ¶
type UserServiceClient interface { Login(ctx context.Context, in *token.Token, opts ...grpc.CallOption) (*Session, error) Logout(ctx context.Context, in *LogoutRequest, opts ...grpc.CallOption) (*Session, error) DescribeSession(ctx context.Context, in *DescribeSessionRequest, opts ...grpc.CallOption) (*Session, error) QuerySession(ctx context.Context, in *QuerySessionRequest, opts ...grpc.CallOption) (*Set, error) }
UserServiceClient is the client API for UserService 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 NewUserServiceClient ¶
func NewUserServiceClient(cc grpc.ClientConnInterface) UserServiceClient
type UserServiceServer ¶
type UserServiceServer interface { Login(context.Context, *token.Token) (*Session, error) Logout(context.Context, *LogoutRequest) (*Session, error) DescribeSession(context.Context, *DescribeSessionRequest) (*Session, error) QuerySession(context.Context, *QuerySessionRequest) (*Set, error) // contains filtered or unexported methods }
UserServiceServer is the server API for UserService service. All implementations must embed UnimplementedUserServiceServer for forward compatibility