Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterAuth(h IAuth, e *edge.Server, preHandlers ...edge.Handler)
- func RegisterAuthCli(h IAuthCli, c edgec.Client, rootCmd *cobra.Command)
- func RegisterAuthWithFunc(h IAuth, e *edge.Server, handlerFunc func(c uint64) []edge.Handler)
- func TunnelRequestAuthLogin(ctx *edge.RequestCtx, replicaSet uint64, req *LoginRequest, res *Authorization, ...) error
- func TunnelRequestAuthRegister(ctx *edge.RequestCtx, replicaSet uint64, req *RegisterRequest, ...) error
- type AuthClient
- type Authorization
- func (x *Authorization) Clone() *Authorization
- func (x *Authorization) DeepCopy(z *Authorization)
- func (*Authorization) Descriptor() ([]byte, []int)deprecated
- func (x *Authorization) GetSessionID() string
- func (x *Authorization) Marshal() ([]byte, error)
- func (x *Authorization) MarshalJSON() ([]byte, error)
- func (*Authorization) ProtoMessage()
- func (x *Authorization) ProtoReflect() protoreflect.Message
- func (x *Authorization) PushToContext(ctx *edge.RequestCtx)
- func (x *Authorization) Reset()
- func (x *Authorization) String() string
- func (x *Authorization) Unmarshal(b []byte) error
- func (x *Authorization) UnmarshalJSON(b []byte) error
- type IAuth
- type IAuthCli
- type LocalRepos
- type LoginRequest
- func (x *LoginRequest) Clone() *LoginRequest
- func (x *LoginRequest) DeepCopy(z *LoginRequest)
- func (*LoginRequest) Descriptor() ([]byte, []int)deprecated
- func (x *LoginRequest) GetPassword() string
- func (x *LoginRequest) GetUsername() string
- func (x *LoginRequest) Marshal() ([]byte, error)
- func (x *LoginRequest) MarshalJSON() ([]byte, error)
- func (*LoginRequest) ProtoMessage()
- func (x *LoginRequest) ProtoReflect() protoreflect.Message
- func (x *LoginRequest) PushToContext(ctx *edge.RequestCtx)
- func (x *LoginRequest) Reset()
- func (x *LoginRequest) String() string
- func (x *LoginRequest) Unmarshal(b []byte) error
- func (x *LoginRequest) UnmarshalJSON(b []byte) error
- type ModuleBase
- type RegisterRequest
- func (x *RegisterRequest) Clone() *RegisterRequest
- func (x *RegisterRequest) DeepCopy(z *RegisterRequest)
- func (*RegisterRequest) Descriptor() ([]byte, []int)deprecated
- func (x *RegisterRequest) GetFirstName() string
- func (x *RegisterRequest) GetLastName() string
- func (x *RegisterRequest) GetPassword() string
- func (x *RegisterRequest) GetUsername() string
- func (x *RegisterRequest) Marshal() ([]byte, error)
- func (x *RegisterRequest) MarshalJSON() ([]byte, error)
- func (*RegisterRequest) ProtoMessage()
- func (x *RegisterRequest) ProtoReflect() protoreflect.Message
- func (x *RegisterRequest) PushToContext(ctx *edge.RequestCtx)
- func (x *RegisterRequest) Reset()
- func (x *RegisterRequest) String() string
- func (x *RegisterRequest) Unmarshal(b []byte) error
- func (x *RegisterRequest) UnmarshalJSON(b []byte) error
- type Session
- func (x *Session) Clone() *Session
- func (x *Session) DeepCopy(z *Session)
- func (*Session) Descriptor() ([]byte, []int)deprecated
- func (x *Session) GetID() string
- func (x *Session) GetUsername() string
- func (x *Session) Marshal() ([]byte, error)
- func (x *Session) MarshalJSON() ([]byte, error)
- func (*Session) ProtoMessage()
- func (x *Session) ProtoReflect() protoreflect.Message
- func (x *Session) PushToContext(ctx *edge.RequestCtx)
- func (x *Session) Reset()
- func (x *Session) String() string
- func (x *Session) Unmarshal(b []byte) error
- func (x *Session) UnmarshalJSON(b []byte) error
- type SessionLocalRepo
- func (r *SessionLocalRepo) Create(m *Session) error
- func (r *SessionLocalRepo) CreateWithTxn(txn *rony.StoreTxn, alloc *tools.Allocator, m *Session) (err error)
- func (r *SessionLocalRepo) Delete(id string) error
- func (r *SessionLocalRepo) DeleteWithTxn(txn *rony.StoreTxn, alloc *tools.Allocator, id string) error
- func (r *SessionLocalRepo) Iter(pk SessionPrimaryKey, ito *store.IterOption, cb func(m *Session) bool) error
- func (r *SessionLocalRepo) IterWithTxn(txn *rony.StoreTxn, alloc *tools.Allocator, offset SessionPrimaryKey, ...) error
- func (r *SessionLocalRepo) List(pk SessionPrimaryKey, lo *store.ListOption, cond func(m *Session) bool) ([]*Session, error)
- func (r *SessionLocalRepo) ListByUsername(username string, lo *store.ListOption, cond func(*Session) bool) ([]*Session, error)
- func (r *SessionLocalRepo) ListWithTxn(txn *rony.StoreTxn, alloc *tools.Allocator, offset SessionPrimaryKey, ...) ([]*Session, error)
- func (r *SessionLocalRepo) Read(id string, m *Session) (*Session, error)
- func (r *SessionLocalRepo) ReadWithTxn(txn *rony.StoreTxn, alloc *tools.Allocator, id string, m *Session) (*Session, error)
- func (r *SessionLocalRepo) Save(m *Session) error
- func (r *SessionLocalRepo) SaveWithTxn(txn *rony.StoreTxn, alloc *tools.Allocator, m *Session) (err error)
- func (r *SessionLocalRepo) Update(id string, m *Session) error
- func (r *SessionLocalRepo) UpdateWithTxn(txn *rony.StoreTxn, alloc *tools.Allocator, m *Session) error
- type SessionPK
- type SessionPrimaryKey
- type User
- func (x *User) Clone() *User
- func (x *User) DeepCopy(z *User)
- func (*User) Descriptor() ([]byte, []int)deprecated
- func (x *User) GetFirstName() string
- func (x *User) GetLastName() string
- func (x *User) GetPassword() string
- func (x *User) GetUsername() string
- func (x *User) Marshal() ([]byte, error)
- func (x *User) MarshalJSON() ([]byte, error)
- func (*User) ProtoMessage()
- func (x *User) ProtoReflect() protoreflect.Message
- func (x *User) PushToContext(ctx *edge.RequestCtx)
- func (x *User) Reset()
- func (x *User) String() string
- func (x *User) Unmarshal(b []byte) error
- func (x *User) UnmarshalJSON(b []byte) error
- type UserLocalRepo
- func (r *UserLocalRepo) Create(m *User) error
- func (r *UserLocalRepo) CreateWithTxn(txn *rony.StoreTxn, alloc *tools.Allocator, m *User) (err error)
- func (r *UserLocalRepo) Delete(username string) error
- func (r *UserLocalRepo) DeleteWithTxn(txn *rony.StoreTxn, alloc *tools.Allocator, username string) error
- func (r *UserLocalRepo) Iter(pk UserPrimaryKey, ito *store.IterOption, cb func(m *User) bool) error
- func (r *UserLocalRepo) IterWithTxn(txn *rony.StoreTxn, alloc *tools.Allocator, offset UserPrimaryKey, ...) error
- func (r *UserLocalRepo) List(pk UserPrimaryKey, lo *store.ListOption, cond func(m *User) bool) ([]*User, error)
- func (r *UserLocalRepo) ListWithTxn(txn *rony.StoreTxn, alloc *tools.Allocator, offset UserPrimaryKey, ...) ([]*User, error)
- func (r *UserLocalRepo) Read(username string, m *User) (*User, error)
- func (r *UserLocalRepo) ReadWithTxn(txn *rony.StoreTxn, alloc *tools.Allocator, username string, m *User) (*User, error)
- func (r *UserLocalRepo) Save(m *User) error
- func (r *UserLocalRepo) SaveWithTxn(txn *rony.StoreTxn, alloc *tools.Allocator, m *User) (err error)
- func (r *UserLocalRepo) Update(username string, m *User) error
- func (r *UserLocalRepo) UpdateWithTxn(txn *rony.StoreTxn, alloc *tools.Allocator, m *User) error
- type UserPK
- type UserPrimaryKey
Constants ¶
View Source
const C_AuthLogin uint64 = 13609756835726243961
View Source
const C_AuthRegister uint64 = 10692114844155491067
View Source
const C_Authorization uint64 = 9434083844645341581
View Source
const C_LoginRequest uint64 = 18198549685643443149
View Source
const C_RegisterRequest uint64 = 11503803976169819412
View Source
const C_Session uint64 = 4434983008330775104
View Source
const C_User uint64 = 3297422589340680192
Variables ¶
View Source
var File_model_proto protoreflect.FileDescriptor
View Source
var File_rpc_proto protoreflect.FileDescriptor
View Source
var PoolAuthorization = poolAuthorization{}
View Source
var PoolLoginRequest = poolLoginRequest{}
View Source
var PoolRegisterRequest = poolRegisterRequest{}
View Source
var PoolSession = poolSession{}
View Source
var PoolUser = poolUser{}
Functions ¶
func RegisterAuthWithFunc ¶
func TunnelRequestAuthLogin ¶ added in v0.12.32
func TunnelRequestAuthLogin( ctx *edge.RequestCtx, replicaSet uint64, req *LoginRequest, res *Authorization, kvs ...*rony.KeyValue, ) error
func TunnelRequestAuthRegister ¶ added in v0.12.32
func TunnelRequestAuthRegister( ctx *edge.RequestCtx, replicaSet uint64, req *RegisterRequest, res *Authorization, kvs ...*rony.KeyValue, ) error
Types ¶
type AuthClient ¶
type AuthClient struct {
// contains filtered or unexported fields
}
func NewAuthClient ¶
func NewAuthClient(ec edgec.Client) *AuthClient
func (*AuthClient) Login ¶
func (c *AuthClient) Login( req *LoginRequest, kvs ...*rony.KeyValue, ) (*Authorization, error)
func (*AuthClient) Register ¶
func (c *AuthClient) Register( req *RegisterRequest, kvs ...*rony.KeyValue, ) (*Authorization, error)
type Authorization ¶
type Authorization struct { SessionID string `protobuf:"bytes,1,opt,name=SessionID,proto3" json:"SessionID,omitempty"` // contains filtered or unexported fields }
Authorization
func (*Authorization) Clone ¶
func (x *Authorization) Clone() *Authorization
func (*Authorization) DeepCopy ¶
func (x *Authorization) DeepCopy(z *Authorization)
func (*Authorization) Descriptor
deprecated
func (*Authorization) Descriptor() ([]byte, []int)
Deprecated: Use Authorization.ProtoReflect.Descriptor instead.
func (*Authorization) GetSessionID ¶
func (x *Authorization) GetSessionID() string
func (*Authorization) Marshal ¶
func (x *Authorization) Marshal() ([]byte, error)
func (*Authorization) MarshalJSON ¶
func (x *Authorization) MarshalJSON() ([]byte, error)
func (*Authorization) ProtoMessage ¶
func (*Authorization) ProtoMessage()
func (*Authorization) ProtoReflect ¶
func (x *Authorization) ProtoReflect() protoreflect.Message
func (*Authorization) PushToContext ¶
func (x *Authorization) PushToContext(ctx *edge.RequestCtx)
func (*Authorization) Reset ¶
func (x *Authorization) Reset()
func (*Authorization) String ¶
func (x *Authorization) String() string
func (*Authorization) Unmarshal ¶
func (x *Authorization) Unmarshal(b []byte) error
func (*Authorization) UnmarshalJSON ¶
func (x *Authorization) UnmarshalJSON(b []byte) error
type IAuth ¶
type IAuth interface { Register(ctx *edge.RequestCtx, req *RegisterRequest, res *Authorization) *rony.Error Login(ctx *edge.RequestCtx, req *LoginRequest, res *Authorization) *rony.Error }
type IAuthCli ¶
type IAuthCli interface { Register(cli *AuthClient, cmd *cobra.Command, args []string) error Login(cli *AuthClient, cmd *cobra.Command, args []string) error }
type LocalRepos ¶
type LocalRepos struct { User *UserLocalRepo Session *SessionLocalRepo }
type LoginRequest ¶
type LoginRequest struct { Username string `protobuf:"bytes,1,opt,name=Username,proto3" json:"Username,omitempty"` Password string `protobuf:"bytes,4,opt,name=Password,proto3" json:"Password,omitempty"` // contains filtered or unexported fields }
LoginRequest
func (*LoginRequest) Clone ¶
func (x *LoginRequest) Clone() *LoginRequest
func (*LoginRequest) DeepCopy ¶
func (x *LoginRequest) DeepCopy(z *LoginRequest)
func (*LoginRequest) Descriptor
deprecated
func (*LoginRequest) Descriptor() ([]byte, []int)
Deprecated: Use LoginRequest.ProtoReflect.Descriptor instead.
func (*LoginRequest) GetPassword ¶
func (x *LoginRequest) GetPassword() string
func (*LoginRequest) GetUsername ¶
func (x *LoginRequest) GetUsername() string
func (*LoginRequest) Marshal ¶
func (x *LoginRequest) Marshal() ([]byte, error)
func (*LoginRequest) MarshalJSON ¶
func (x *LoginRequest) MarshalJSON() ([]byte, error)
func (*LoginRequest) ProtoMessage ¶
func (*LoginRequest) ProtoMessage()
func (*LoginRequest) ProtoReflect ¶
func (x *LoginRequest) ProtoReflect() protoreflect.Message
func (*LoginRequest) PushToContext ¶
func (x *LoginRequest) PushToContext(ctx *edge.RequestCtx)
func (*LoginRequest) Reset ¶
func (x *LoginRequest) Reset()
func (*LoginRequest) String ¶
func (x *LoginRequest) String() string
func (*LoginRequest) Unmarshal ¶
func (x *LoginRequest) Unmarshal(b []byte) error
func (*LoginRequest) UnmarshalJSON ¶
func (x *LoginRequest) UnmarshalJSON(b []byte) error
type ModuleBase ¶
type ModuleBase struct {
// contains filtered or unexported fields
}
func New ¶
func New(store *store.Store) ModuleBase
func (ModuleBase) L ¶
func (m ModuleBase) L() LocalRepos
func (ModuleBase) Local ¶
func (m ModuleBase) Local() LocalRepos
type RegisterRequest ¶
type RegisterRequest struct { Username string `protobuf:"bytes,1,opt,name=Username,proto3" json:"Username,omitempty"` FirstName string `protobuf:"bytes,2,opt,name=FirstName,proto3" json:"FirstName,omitempty"` LastName string `protobuf:"bytes,3,opt,name=LastName,proto3" json:"LastName,omitempty"` Password string `protobuf:"bytes,4,opt,name=Password,proto3" json:"Password,omitempty"` // contains filtered or unexported fields }
RegisterRequest
func (*RegisterRequest) Clone ¶
func (x *RegisterRequest) Clone() *RegisterRequest
func (*RegisterRequest) DeepCopy ¶
func (x *RegisterRequest) DeepCopy(z *RegisterRequest)
func (*RegisterRequest) Descriptor
deprecated
func (*RegisterRequest) Descriptor() ([]byte, []int)
Deprecated: Use RegisterRequest.ProtoReflect.Descriptor instead.
func (*RegisterRequest) GetFirstName ¶
func (x *RegisterRequest) GetFirstName() string
func (*RegisterRequest) GetLastName ¶
func (x *RegisterRequest) GetLastName() string
func (*RegisterRequest) GetPassword ¶
func (x *RegisterRequest) GetPassword() string
func (*RegisterRequest) GetUsername ¶
func (x *RegisterRequest) GetUsername() string
func (*RegisterRequest) Marshal ¶
func (x *RegisterRequest) Marshal() ([]byte, error)
func (*RegisterRequest) MarshalJSON ¶
func (x *RegisterRequest) MarshalJSON() ([]byte, error)
func (*RegisterRequest) ProtoMessage ¶
func (*RegisterRequest) ProtoMessage()
func (*RegisterRequest) ProtoReflect ¶
func (x *RegisterRequest) ProtoReflect() protoreflect.Message
func (*RegisterRequest) PushToContext ¶
func (x *RegisterRequest) PushToContext(ctx *edge.RequestCtx)
func (*RegisterRequest) Reset ¶
func (x *RegisterRequest) Reset()
func (*RegisterRequest) String ¶
func (x *RegisterRequest) String() string
func (*RegisterRequest) Unmarshal ¶
func (x *RegisterRequest) Unmarshal(b []byte) error
func (*RegisterRequest) UnmarshalJSON ¶
func (x *RegisterRequest) UnmarshalJSON(b []byte) error
type Session ¶
type Session struct { ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"` Username string `protobuf:"bytes,2,opt,name=Username,proto3" json:"Username,omitempty"` // contains filtered or unexported fields }
func (*Session) Descriptor
deprecated
func (*Session) GetUsername ¶
func (*Session) MarshalJSON ¶
func (*Session) ProtoMessage ¶
func (*Session) ProtoMessage()
func (*Session) ProtoReflect ¶
func (x *Session) ProtoReflect() protoreflect.Message
func (*Session) PushToContext ¶
func (x *Session) PushToContext(ctx *edge.RequestCtx)
func (*Session) UnmarshalJSON ¶
type SessionLocalRepo ¶
type SessionLocalRepo struct {
// contains filtered or unexported fields
}
func NewSessionLocalRepo ¶
func NewSessionLocalRepo(s *store.Store) *SessionLocalRepo
func (*SessionLocalRepo) Create ¶
func (r *SessionLocalRepo) Create(m *Session) error
func (*SessionLocalRepo) CreateWithTxn ¶
func (*SessionLocalRepo) Delete ¶
func (r *SessionLocalRepo) Delete(id string) error
func (*SessionLocalRepo) DeleteWithTxn ¶
func (*SessionLocalRepo) Iter ¶
func (r *SessionLocalRepo) Iter( pk SessionPrimaryKey, ito *store.IterOption, cb func(m *Session) bool, ) error
func (*SessionLocalRepo) IterWithTxn ¶
func (r *SessionLocalRepo) IterWithTxn( txn *rony.StoreTxn, alloc *tools.Allocator, offset SessionPrimaryKey, ito *store.IterOption, cb func(m *Session) bool, ) error
func (*SessionLocalRepo) List ¶
func (r *SessionLocalRepo) List( pk SessionPrimaryKey, lo *store.ListOption, cond func(m *Session) bool, ) ([]*Session, error)
func (*SessionLocalRepo) ListByUsername ¶
func (r *SessionLocalRepo) ListByUsername( username string, lo *store.ListOption, cond func(*Session) bool, ) ([]*Session, error)
func (*SessionLocalRepo) ListWithTxn ¶
func (r *SessionLocalRepo) ListWithTxn( txn *rony.StoreTxn, alloc *tools.Allocator, offset SessionPrimaryKey, lo *store.ListOption, cond func(m *Session) bool, ) ([]*Session, error)
func (*SessionLocalRepo) Read ¶
func (r *SessionLocalRepo) Read(id string, m *Session) (*Session, error)
func (*SessionLocalRepo) ReadWithTxn ¶
func (*SessionLocalRepo) Save ¶
func (r *SessionLocalRepo) Save(m *Session) error
func (*SessionLocalRepo) SaveWithTxn ¶
func (*SessionLocalRepo) UpdateWithTxn ¶
type SessionPrimaryKey ¶
type SessionPrimaryKey interface {
// contains filtered or unexported methods
}
type User ¶
type User 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"` FirstName string `protobuf:"bytes,3,opt,name=FirstName,proto3" json:"FirstName,omitempty"` LastName string `protobuf:"bytes,4,opt,name=LastName,proto3" json:"LastName,omitempty"` // contains filtered or unexported fields }
func (*User) Descriptor
deprecated
func (*User) GetFirstName ¶
func (*User) GetLastName ¶
func (*User) GetPassword ¶
func (*User) GetUsername ¶
func (*User) MarshalJSON ¶
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
func (*User) ProtoReflect ¶
func (x *User) ProtoReflect() protoreflect.Message
func (*User) PushToContext ¶
func (x *User) PushToContext(ctx *edge.RequestCtx)
func (*User) UnmarshalJSON ¶
type UserLocalRepo ¶
type UserLocalRepo struct {
// contains filtered or unexported fields
}
func NewUserLocalRepo ¶
func NewUserLocalRepo(s *store.Store) *UserLocalRepo
func (*UserLocalRepo) Create ¶
func (r *UserLocalRepo) Create(m *User) error
func (*UserLocalRepo) CreateWithTxn ¶
func (*UserLocalRepo) Delete ¶
func (r *UserLocalRepo) Delete(username string) error
func (*UserLocalRepo) DeleteWithTxn ¶
func (*UserLocalRepo) Iter ¶
func (r *UserLocalRepo) Iter( pk UserPrimaryKey, ito *store.IterOption, cb func(m *User) bool, ) error
func (*UserLocalRepo) IterWithTxn ¶
func (r *UserLocalRepo) IterWithTxn( txn *rony.StoreTxn, alloc *tools.Allocator, offset UserPrimaryKey, ito *store.IterOption, cb func(m *User) bool, ) error
func (*UserLocalRepo) List ¶
func (r *UserLocalRepo) List( pk UserPrimaryKey, lo *store.ListOption, cond func(m *User) bool, ) ([]*User, error)
func (*UserLocalRepo) ListWithTxn ¶
func (r *UserLocalRepo) ListWithTxn( txn *rony.StoreTxn, alloc *tools.Allocator, offset UserPrimaryKey, lo *store.ListOption, cond func(m *User) bool, ) ([]*User, error)
func (*UserLocalRepo) ReadWithTxn ¶
func (*UserLocalRepo) Save ¶
func (r *UserLocalRepo) Save(m *User) error
func (*UserLocalRepo) SaveWithTxn ¶
func (*UserLocalRepo) UpdateWithTxn ¶
type UserPrimaryKey ¶
type UserPrimaryKey interface {
// contains filtered or unexported methods
}
Click to show internal directories.
Click to hide internal directories.