Documentation
¶
Index ¶
- func WithGroupId(groupID int) queryFunction
- func WithLimit(limit int) queryFunction
- func WithOffset(offset int) queryFunction
- type Client
- func (c *Client) AddUserToGroup(ctx context.Context, groupId int, userId int) error
- func (c *Client) GetAllGroups(ctx context.Context) (*GroupsResponse, *v2.RateLimitDescription, error)
- func (c *Client) GetUser(ctx context.Context, id int) (*User, error)
- func (c *Client) GetUsers(ctx context.Context, offset, limit int, query ...queryFunction) (*UsersResponse, *v2.RateLimitDescription, error)
- func (c *Client) RemoveUserFromGroup(ctx context.Context, groupId int, userId int) error
- func (c *Client) Validate(ctx context.Context) error
- type Group
- type GroupsResponse
- type PatchUserBody
- type Permission
- type Permissions
- type User
- type UsersResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithGroupId ¶
func WithGroupId(groupID int) queryFunction
func WithOffset ¶
func WithOffset(offset int) queryFunction
Types ¶
type Client ¶
type Client struct { uhttp.BaseHttpClient // contains filtered or unexported fields }
func (*Client) AddUserToGroup ¶
func (*Client) GetAllGroups ¶
func (c *Client) GetAllGroups(ctx context.Context) (*GroupsResponse, *v2.RateLimitDescription, error)
func (*Client) GetUsers ¶
func (c *Client) GetUsers(ctx context.Context, offset, limit int, query ...queryFunction) (*UsersResponse, *v2.RateLimitDescription, error)
func (*Client) RemoveUserFromGroup ¶
type Group ¶
type Group struct { ID int `json:"id"` Name string `json:"name"` Permissions Permissions `json:"permissions"` }
type GroupsResponse ¶
func (GroupsResponse) ContainsGroup ¶
func (x GroupsResponse) ContainsGroup(id int) bool
type PatchUserBody ¶
type PatchUserBody struct {
Groups []int `json:"groups,omitempty" structs:"groups,omitempty"`
}
type Permission ¶
type Permission string
var ( Granted Permission = "1" Denied Permission = "-1" Inherited Permission = "0" )
func (*Permission) UnmarshalJSON ¶ added in v0.0.2
func (p *Permission) UnmarshalJSON(b []byte) error
type Permissions ¶
type Permissions map[string]Permission
type User ¶
type User struct { ID int `json:"id"` Username string `json:"username"` FirstName string `json:"first_name"` LastName string `json:"last_name"` Email string `json:"email"` VIP bool `json:"vip"` EmployeeNumber string `json:"employee_num"` Activated bool `json:"activated"` Groups GroupsResponse `json:"groups"` Permissions Permissions `json:"permissions"` }
type UsersResponse ¶
Click to show internal directories.
Click to hide internal directories.