Documentation ¶
Index ¶
- type Client
- func (c *Client) CheckGroup(id string) bool
- func (c *Client) CheckPermission(id string) (level int, groups []string)
- func (c *Client) GetAdmin(id string) (admin *role.Admin)
- func (c *Client) GetAdminList() (list []*role.Admin)
- func (c *Client) GetAdminListbyGroupID(id string) (list []*role.Admin)
- func (c *Client) GetGroup(id string) (group *group.Group)
- func (c *Client) GetGroupList() []*group.Group
- func (c *Client) GetUpdateNotifyChan() <-chan struct{}
- func (c *Client) GetUser(id string) (user *role.User)
- func (c *Client) GetUserList() (list []*role.User)
- func (c *Client) GetUserListbyGroupID(id string) (list []*role.User)
- func (c *Client) PutAdmin(a ...*role.Admin) error
- func (c *Client) PutGroup(g ...*group.Group) error
- func (c *Client) PutUser(u ...*role.User) error
- func (c *Client) Reload() (err error)
- func (c *Client) UpdateAdmin(a ...*role.Admin) error
- func (c *Client) UpdateGroup(g ...*group.Group) error
- func (c *Client) UpdateUser(u ...*role.User) error
- type ErrMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client of json database.
func (*Client) CheckGroup ¶
CheckGroup tell if the given group is enabled.
func (*Client) CheckPermission ¶
CheckPermission return the permission level of given user.
func (*Client) GetAdminList ¶
GetAdminList return the list of admins.
func (*Client) GetAdminListbyGroupID ¶
GetAdminListbyGroupID return the list of admins of the given group.
func (*Client) GetGroupList ¶
GetGroupList return the list of groups registered in database.
func (*Client) GetUpdateNotifyChan ¶
func (c *Client) GetUpdateNotifyChan() <-chan struct{}
GetUpdateNotifyChan return a read-only channel that will signal when database is updated.
func (*Client) GetUserList ¶
GetUserList return the list of users.
func (*Client) GetUserListbyGroupID ¶
GetUserListbyGroupID return the list of users registered for the given group.
func (*Client) UpdateAdmin ¶
UpdateAdmin updates given admin.
func (*Client) UpdateGroup ¶
UpdateGroup updates given group.
Click to show internal directories.
Click to hide internal directories.