rogo

package module
v0.0.0-...-bb76f62 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: MIT Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseGroup

type BaseGroup struct {
	Id          int       `json:"id"`
	Name        string    `json:"name"`
	Description string    `json:"description"`
	Owner       GroupUser `json:"owner"`
	Shout       struct {
		Body    string    `json:"body"`
		Poster  GroupUser `json:"poster"`
		Created time.Time `json:"created"`
		Updated time.Time `json:"updated"`
	}
	Count    int  `json:"memberCount"`
	Locked   bool `json:"isLocked"`
	Verified bool `json:"hasVerifiedBadge"`
}

type BaseMember

type BaseMember struct {
	User GroupUser `json:"user"`
	Role BaseRole  `json:"role"`
}

func (*BaseMember) GetUser

func (m *BaseMember) GetUser(c *Client) (*User, error)

type BaseRole

type BaseRole struct {
	Id          int    `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Rank        int    `json:"rank"`
	Count       int    `json:"memberCount"`
}

type BaseUser

type BaseUser struct {
	MinimalUser
	Verified       bool `json:"hasVerifiedBadge"`
	MembershipType int  `json:"buildersClubMembershipType"`
}

func (*BaseUser) GetUser

func (u *BaseUser) GetUser(c *Client) (*User, error)

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(token string) *Client

func (*Client) GetGroup

func (c *Client) GetGroup(groupId int) (*Group, error)

func (*Client) GetUser

func (c *Client) GetUser(userId int) (*User, error)

type Data

type Data[T any] struct {
	Data []T `json:"data"`
}

type Error

type Error struct {
	Errors []struct {
		Code    int    `json:"code"`
		Message string `json:"message"`
	}
}

type Group

type Group struct {
	BaseGroup
	// contains filtered or unexported fields
}

func (*Group) Exile

func (g *Group) Exile(userId int) error

func (*Group) GetMembers

func (g *Group) GetMembers() (*Pagination[BaseMember], error)

func (*Group) GetRole

func (g *Group) GetRole(roleNumber int) (*BaseRole, error)

func (*Group) GetRoles

func (g *Group) GetRoles() ([]BaseRole, error)

func (*Group) Join

func (g *Group) Join() error

func (*Group) SetRank

func (g *Group) SetRank(userId int, roleId int) error

type GroupUser

type GroupUser struct {
	BaseUser
	Id   int    `json:"userId"`
	Name string `json:"username"`
}

type HasClient

type HasClient interface {
	// contains filtered or unexported methods
}

type MinimalUser

type MinimalUser struct {
	Id          int    `json:"id"`
	Name        string `json:"name"`
	DisplayName string `json:"displayName"`
}

MinimalUser represents a minimal user object. This is used for authentication purposes.

type Pagination

type Pagination[T any] struct {
	Data []T `json:"data"`

	NextCursor     string `json:"nextPageCursor"`
	PreviousCursor string `json:"previousPageCursor"`
	URL            string
	// contains filtered or unexported fields
}

func (*Pagination[T]) Next

func (p *Pagination[T]) Next() (*Pagination[T], error)

func (*Pagination[T]) Previous

func (p *Pagination[T]) Previous() (*Pagination[T], error)

type Roles

type Roles struct {
	GroupId int        `json:"groupId"`
	Roles   []BaseRole `json:"roles"`
}

type User

type User struct {
	BaseUser

	Description string    `json:"description"`
	Created     time.Time `json:"created"`
	Banned      bool      `json:"isBanned"`
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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