users

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2021 License: GPL-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package users provides access to users via the Lighthouse API. http://help.lighthouseapp.com/kb/api/users-and-membership.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActiveTicket

type ActiveTicket struct {
	Number    int
	Title     string
	URL       string
	UpdatedAt time.Time
}

func (*ActiveTicket) MarshalJSON

func (at *ActiveTicket) MarshalJSON() ([]byte, error)

func (*ActiveTicket) UnmarshalJSON

func (at *ActiveTicket) UnmarshalJSON(data []byte) error

type ActiveTickets

type ActiveTickets []*ActiveTicket

type Membership

type Membership struct {
	ID      int    `json:"id"`
	UserID  int    `json:"user_id"`
	User    *User  `json:"user"`
	Account string `json:"account"`
}

type Memberships

type Memberships []*Membership

type Service

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

func NewService

func NewService(s *lighthouse.Service) *Service

func (*Service) Get

func (s *Service) Get(idOrName string) (*User, error)

func (*Service) GetAvatar added in v0.4.1

func (s *Service) GetAvatar(u *User) (io.ReadCloser, string, error)

func (*Service) GetByID added in v0.4.1

func (s *Service) GetByID(id int) (*User, error)

func (*Service) GetByName added in v0.4.1

func (s *Service) GetByName(name string) (*User, error)

func (*Service) Memberships

func (s *Service) Memberships(idOrName string) (Memberships, error)

func (*Service) MembershipsByID added in v0.4.1

func (s *Service) MembershipsByID(id int) (Memberships, error)

func (*Service) MembershipsByName added in v0.4.1

func (s *Service) MembershipsByName(name string) (Memberships, error)

func (*Service) Update

func (s *Service) Update(u *User) error

Only the fields in UserUpdate can be set.

type User

type User struct {
	ID            int           `json:"id"`
	Job           string        `json:"job"`
	Name          string        `json:"name"`
	Website       string        `json:"website"`
	AvatarURL     string        `json:"avatar_url,omitempty"`
	ActiveTickets ActiveTickets `json:"active_tickets"`
}

type UserUpdate

type UserUpdate struct {
	ID      int    `json:"id"`
	Job     string `json:"job"`
	Name    string `json:"name"`
	Website string `json:"website"`
}

Jump to

Keyboard shortcuts

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