user

package
v0.0.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 3, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GetConfig = &request.Config{
	Action:   "GET",
	Resource: "users/:id",
	Headers: map[string]string{
		"Content-Type": "application/json",
	},
}
View Source
var ListALLConfig = &request.Config{
	Action:   "GET",
	Resource: "users",
	Headers: map[string]string{
		"Content-Type": "application/json",
	},
}
View Source
var ListConfig = &request.Config{
	Action:   "GET",
	Resource: "users",
	Headers: map[string]string{
		"Content-Type": "application/json",
	},
}

Functions

This section is empty.

Types

type GetRequest

type GetRequest struct {
	ID uint `json:"id"`
}

type GetResponse

type GetResponse = User

func Get

func Get(client client.Client, opts ...func(opt *GetRequest)) (*GetResponse, error)

type ListALLRequest added in v0.0.6

type ListALLRequest struct {
	Active    bool   `json:"active"`
	Blocked   bool   `json:"blocked"`
	OrderBy   string `json:"order_by"`
	Sort      string `json:"sort"`
	TwoFactor bool   `json:"two_factor"`
}

type ListALLResponse added in v0.0.6

type ListALLResponse struct {
	Data  []User `json:"data"`
	Total int    `json:"total"`
}

func ListALL added in v0.0.6

func ListALL(client client.Client, opts ...func(opt *ListALLRequest)) (*ListALLResponse, error)

type ListRequest

type ListRequest struct {
	Page      int    `json:"page"`
	PerPage   int    `json:"per_page"`
	Username  string `json:"username"`
	Active    bool   `json:"active"`
	Blocked   bool   `json:"blocked"`
	OrderBy   string `json:"order_by"`
	Sort      string `json:"sort"`
	TwoFactor bool   `json:"two_factor"`
}

type ListResponse

type ListResponse struct {
	Data       []User `json:"data"`
	IsLastPage bool   `json:"is_last_page"`
}

func List

func List(client client.Client, opts ...func(opt *ListRequest)) (*ListResponse, error)

type User

type User struct {
	ID              uint   `json:"id"`
	Username        string `json:"username"`
	Name            string `json:"name"`
	State           string `json:"state"`
	AvatarURL       string `json:"avatar_url"`
	WebURL          string `json:"web_url"`
	CreatedAt       string `json:"created_at"`
	IsAdmin         bool   `json:"is_admin"`
	Bio             string `json:"bio"`
	Location        string `json:"location"`
	Skype           string `json:"skype"`
	Linkedin        string `json:"linkedin"`
	Twitter         string `json:"twitter"`
	WebsiteURL      string `json:"website_url"`
	Organization    string `json:"organization"`
	LastSignInAt    string `json:"last_sign_in_at"`
	ConfirmedAt     string `json:"confirmed_at"`
	ThemeID         int64  `json:"theme_id"`
	LastActivityOn  string `json:"last_activity_on"`
	ColorSchemeID   int64  `json:"color_scheme_id"`
	ProjectsLimit   int64  `json:"projects_limit"`
	CurrentSignInAt string `json:"current_sign_in_at"`
	Identities      []struct {
		Provider  string `json:"provider"`
		ExternUID string `json:"extern_uid"`
	} `json:"identities"`
	CanCreateGroup   bool `json:"can_create_group"`
	CanCreateProject bool `json:"can_create_project"`
	TwoFactorEnabled bool `json:"two_factor_enabled"`
	External         bool `json:"external"`
	PrivateProfile   bool `json:"private_profile"`
}

type UserImpl

type UserImpl interface {
	List(opts ...func(opt *ListRequest)) (*ListResponse, error)
	Get(opts ...func(opt *GetRequest)) (*GetResponse, error)
	//
	ListALL(opts ...func(opt *ListALLRequest)) (*ListALLResponse, error)
}

func New

func New(client client.Client) UserImpl

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL