trello

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API interface {
	GetBoard(name string) (*Board, error)
	GetBoards() ([]Board, error)
	GetCards(board Board) ([]Card, error)
	GetLists(board Board) ([]List, error)
	GetMember(ID string) (*Member, error)
}

API defines the interface for the client

type Board

type Board struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Desc        string `json:"desc"`
	Closed      bool   `json:"closed"`
	Memberships []struct {
		MemberID string `json:"idMember"`
	} `json:"memberships"`
}

Board defines what a single board looks like

type Card

type Card struct {
	Name          string   `json:"name"`
	ListID        string   `json:"idList"`
	MembershipIDs []string `json:"idMembers"`
}

Card defines what a single card looks like

type Client

type Client struct {
	Client  *http.Client
	BaseURL string
	Key     string
	Token   string
	// contains filtered or unexported fields
}

Client is the Trello concrete implementation

func New

func New() Client

New will return you a Trello client

func (*Client) Get

func (c *Client) Get(url string, response interface{}) (*http.Response, error)

Get is responsible for performing a GET request

func (*Client) GetBoard

func (c *Client) GetBoard(name string) (*Board, error)

GetBoard will return a single board

func (*Client) GetBoards

func (c *Client) GetBoards() ([]Board, error)

GetBoards will return a list boards the user can access

func (*Client) GetCards

func (c *Client) GetCards(board Board) ([]Card, error)

GetCards will return a set of cards for a given board name

func (*Client) GetLists

func (c *Client) GetLists(board Board) ([]List, error)

GetLists will return all the columns for a given board

func (*Client) GetMember

func (c *Client) GetMember(ID string) (*Member, error)

GetMember will return users for a given ID

type List

type List struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

List defines a column on the board

type Member

type Member struct {
	FullName string `json:"fullName"`
}

Member represents a user

Jump to

Keyboard shortcuts

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