Documentation ¶
Index ¶
- Variables
- type Group
- type GroupServer
- type MemoryGroup
- func (group *MemoryGroup) AddUser(ctx context.Context, uid string) error
- func (group *MemoryGroup) ContainsUser(ctx context.Context, uid string) bool
- func (group *MemoryGroup) GetGroupID(ctx context.Context) int64
- func (group *MemoryGroup) GetGroupName(ctx context.Context) string
- func (group *MemoryGroup) GetLastRefresh(ctx context.Context) int64
- func (group *MemoryGroup) GetUserCount(ctx context.Context) int
- func (group *MemoryGroup) GetUsers(ctx context.Context) []string
- func (group *MemoryGroup) RemoveAllUsers(ctx context.Context)
- func (group *MemoryGroup) RemoveUser(ctx context.Context, uid string) error
- func (group *MemoryGroup) RemoveUsers(ctx context.Context, uids []string)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUserNotIntGroup = errors.New("user not in group") ErrUserExistInGroup = errors.New("user exist in group") )
Functions ¶
This section is empty.
Types ¶
type Group ¶
type Group interface { AddUser(ctx context.Context, uid string) error // add user to group RemoveUser(ctx context.Context, uid string) error // remove user from group RemoveUsers(ctx context.Context, uids []string) // remove users from group RemoveAllUsers(ctx context.Context) // remove all users from group GetUsers(ctx context.Context) []string // get all users in group GetUserCount(ctx context.Context) int // get user count in group GetLastRefresh(ctx context.Context) int64 // get last refresh time ContainsUser(ctx context.Context, uid string) bool // check if user is in group GetGroupName(ctx context.Context) string // get group name GetGroupID(ctx context.Context) int64 // get group id }
type GroupServer ¶
type GroupServer struct {
// contains filtered or unexported fields
}
func NewGroupServer ¶
func NewGroupServer() *GroupServer
func (*GroupServer) CreateMemoryGroup ¶
func (gs *GroupServer) CreateMemoryGroup(name string) Group
func (*GroupServer) DeleteGroup ¶ added in v0.2.2
func (gs *GroupServer) DeleteGroup(name string)
func (*GroupServer) DeleteUserByName ¶
func (gs *GroupServer) DeleteUserByName(uid string)
func (*GroupServer) ListGroup ¶ added in v0.1.3
func (gs *GroupServer) ListGroup() []Group
type MemoryGroup ¶
type MemoryGroup struct {
// contains filtered or unexported fields
}
func NewMemoryGroup ¶
func NewMemoryGroup(name string, groupID int64) *MemoryGroup
func (*MemoryGroup) AddUser ¶
func (group *MemoryGroup) AddUser(ctx context.Context, uid string) error
func (*MemoryGroup) ContainsUser ¶
func (group *MemoryGroup) ContainsUser(ctx context.Context, uid string) bool
func (*MemoryGroup) GetGroupID ¶
func (group *MemoryGroup) GetGroupID(ctx context.Context) int64
func (*MemoryGroup) GetGroupName ¶
func (group *MemoryGroup) GetGroupName(ctx context.Context) string
func (*MemoryGroup) GetLastRefresh ¶
func (group *MemoryGroup) GetLastRefresh(ctx context.Context) int64
func (*MemoryGroup) GetUserCount ¶
func (group *MemoryGroup) GetUserCount(ctx context.Context) int
func (*MemoryGroup) RemoveAllUsers ¶
func (group *MemoryGroup) RemoveAllUsers(ctx context.Context)
func (*MemoryGroup) RemoveUser ¶
func (group *MemoryGroup) RemoveUser(ctx context.Context, uid string) error
func (*MemoryGroup) RemoveUsers ¶
func (group *MemoryGroup) RemoveUsers(ctx context.Context, uids []string)
Click to show internal directories.
Click to hide internal directories.