Documentation
¶
Index ¶
- func EncodeArgs(args []*Argument) string
- func NewBearerTokenTransport(applicationKey string, token *string) *bearerRoundTripper
- type Action
- type Argument
- type Attachment
- type Board
- func (b *Board) Actions(arg ...*Argument) (actions []Action, err error)
- func (b *Board) Card(IdCard string) (card *Card, err error)
- func (b *Board) Cards() (cards []Card, err error)
- func (b *Board) Checklists() (checklists []Checklist, err error)
- func (b *Board) Lists() (lists []List, err error)
- func (b *Board) MemberCards(IdMember string) (cards []Card, err error)
- func (b *Board) Members() (members []Member, err error)
- type BoardBackground
- type Card
- func (c *Card) Actions() (actions []Action, err error)
- func (c *Card) AddChecklist(name string) (*Checklist, error)
- func (c *Card) AddComment(text string) (*Action, error)
- func (c *Card) Attachment(attachmentId string) (*Attachment, error)
- func (c *Card) Attachments() (attachments []Attachment, err error)
- func (c *Card) Checklists() (checklists []Checklist, err error)
- func (c *Card) Members() (members []Member, err error)
- type Checklist
- type ChecklistItem
- type Client
- func (c *Client) Board(boardId string) (board *Board, err error)
- func (c *Client) Boards() (boards []Board, err error)
- func (c *Client) Card(CardId string) (card *Card, err error)
- func (c *Client) Delete(resource string) ([]byte, error)
- func (c *Client) Get(resource string) ([]byte, error)
- func (c *Client) List(listId string) (list *List, err error)
- func (c *Client) Member(nick string) (member *Member, err error)
- func (c *Client) Notification(notificationId string) (notification *Notification, err error)
- func (c *Client) Organization(orgId string) (organization *Organization, err error)
- func (c *Client) Post(resource string, data url.Values) ([]byte, error)
- func (c *Client) Put(resource string, data url.Values) ([]byte, error)
- func (c *Client) Version() string
- type List
- type Member
- type Notification
- type Organization
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodeArgs ¶
func NewBearerTokenTransport ¶
NewBearerTokenTransport will return an http.RoundTripper which will add the provided application id and token to API calls.
If Delegate is left unset the http.DefaultTransport will be used.
See https://trello.com/app-key to get your applicationKey See https://trello.com/1/connect?key=MYKEYFROMABOVE&name=MYAPPNAME&response_type=token&scope=read,write&expiration=1d to get a read/write token good for 1 day
Types ¶
type Action ¶
type Action struct {
Id string `json:"id"`
IdMemberCreator string `json:"idMemberCreator"`
Data struct {
DateLastEdited string `json:"dateLastEdited"`
ListBefore struct {
Id string `json:"id"`
Name string `json:"name"`
} `json:"listBefore"`
ListAfter struct {
Id string `json:"id"`
Name string `json:"name"`
} `json:"listAfter"`
CheckItem struct {
Id string `json:"id"`
State string `json:"state"`
Name string `json:"name"`
} `json:"checkItem"`
CheckList struct {
Id string `json:"id"`
Name string `json:"name"`
} `json:"checklist"`
List struct {
Id string `json:"id"`
Name string `json:"name"`
} `json:"list"`
TextData struct {
Emoji struct{} `json:"emoji"`
} `json:"textData"`
Board struct {
Id string `json:"id"`
Name string `json:"name"`
ShortLink string `json:"shortLink"`
} `json:"board"`
Card struct {
Id string `json:"id"`
Name string `json:"name"`
ShortLink string `json:"shortLink"`
IdShort int `json:"idShort"`
} `json:"card"`
Text string `json:"text"`
} `json:"data"`
Type string `json:"type"`
Date string `json:"date"`
MemberCreator struct {
Id string `json:"id"`
AvatarHash string `json:"avatarHash"`
FullName string `json:"fullName"`
Initials string `json:"initials"`
Username string `json:"username"`
} `json:"memberCreator"`
// contains filtered or unexported fields
}
type Argument ¶
func NewArgument ¶
type Attachment ¶
type Attachment struct {
Id string `json:"id"`
Bytes int `json:"bytes"`
Date string `json:"date"`
EdgeColor string `json:"edgeColor"`
IdMember string `json:"idMember"`
IsUpload bool `json:"isUpload"`
MimeType string `json:"mimeType"`
Name string `json:"name"`
Previews []struct {
Width int `json:"width"`
Height int `json:"height"`
Url string `json:"url"`
Bytes int `json:"bytes"`
Id string `json:"_id"`
Scaled bool `json:"scaled"`
} `json:"previews"`
Url string `json:"url"`
// contains filtered or unexported fields
}
type Board ¶
type Board struct {
Id string `json:"id"`
Name string `json:"name"`
Desc string `json:"desc"`
DescData struct {
Emoji struct{} `json:"emoji"`
} `json:"descData"`
Closed bool `json:"closed"`
IdOrganization string `json:"idOrganization"`
Pinned bool `json:"pinned"`
Url string `json:"url"`
ShortUrl string `json:"shortUrl"`
Prefs struct {
PermissionLevel string `json:"permissionLevel"`
Voting string `json:"voting"`
Comments string `json:"comments"`
Invitations string `json:"invitations"`
SelfJoin bool `json:"selfjoin"`
CardCovers bool `json:"cardCovers"`
CardAging string `json:"cardAging"`
CalendarFeedEnabled bool `json:"calendarFeedEnabled"`
Background string `json:"background"`
BackgroundColor string `json:"backgroundColor"`
BackgroundImage string `json:"backgroundImage"`
BackgroundImageScaled []BoardBackground `json:"backgroundImageScaled"`
BackgroundTile bool `json:"backgroundTile"`
BackgroundBrightness string `json:"backgroundBrightness"`
CanBePublic bool `json:"canBePublic"`
CanBeOrg bool `json:"canBeOrg"`
CanBePrivate bool `json:"canBePrivate"`
CanInvite bool `json:"canInvite"`
} `json:"prefs"`
LabelNames struct {
Red string `json:"red"`
Orange string `json:"orange"`
Yellow string `json:"yellow"`
Green string `json:"green"`
Blue string `json:"blue"`
Purple string `json:"purple"`
} `json:"labelNames"`
// contains filtered or unexported fields
}
func (*Board) Checklists ¶
type BoardBackground ¶
type BoardBackground struct {
// contains filtered or unexported fields
}
type Card ¶
type Card struct {
Id string `json:"id"`
Name string `json:"name"`
Email string `json:"email"`
IdShort int `json:"idShort"`
IdAttachmentCover string `json:"idAttachmentCover"`
IdCheckLists []string `json:"idCheckLists"`
IdBoard string `json:"idBoard"`
IdList string `json:"idList"`
IdMembers []string `json:"idMembers"`
IdMembersVoted []string `json:"idMembersVoted"`
ManualCoverAttachment bool `json:"manualCoverAttachment"`
Closed bool `json:"closed"`
Pos float64 `json:"pos"`
ShortLink string `json:"shortLink"`
DateLastActivity string `json:"dateLastActivity"`
ShortUrl string `json:"shortUrl"`
Subscribed bool `json:"subscribed"`
Url string `json:"url"`
Due string `json:"due"`
Desc string `json:"desc"`
DescData struct {
Emoji struct{} `json:"emoji"`
} `json:"descData"`
CheckItemStates []struct {
IdCheckItem string `json:"idCheckItem"`
State string `json:"state"`
} `json:"checkItemStates"`
Badges struct {
Votes int `json:"votes"`
ViewingMemberVoted bool `json:"viewingMemberVoted"`
Subscribed bool `json:"subscribed"`
Fogbugz string `json:"fogbugz"`
CheckItems int `json:"checkItems"`
CheckItemsChecked int `json:"checkItemsChecked"`
Comments int `json:"comments"`
Attachments int `json:"attachments"`
Description bool `json:"description"`
Due string `json:"due"`
} `json:"badges"`
Labels []struct {
Color string `json:"color"`
Name string `json:"name"`
} `json:"labels"`
// contains filtered or unexported fields
}
func (*Card) AddChecklist ¶
AddChecklist will add a checklist to the card. https://developers.trello.com/advanced-reference/card#post-1-cards-card-id-or-shortlink-checklists
func (*Card) AddComment ¶
AddComment will add a new comment to the card https://developers.trello.com/advanced-reference/card#post-1-cards-card-id-or-shortlink-actions-comments
func (*Card) Attachment ¶
func (c *Card) Attachment(attachmentId string) (*Attachment, error)
Attachment will return the specified attachment on the card https://developers.trello.com/advanced-reference/card#get-1-cards-card-id-or-shortlink-attachments-idattachment
func (*Card) Attachments ¶
func (c *Card) Attachments() (attachments []Attachment, err error)
func (*Card) Checklists ¶
type Checklist ¶
type Checklist struct {
Id string `json:"id"`
Name string `json:"name"`
IdBoard string `json:"idBoard"`
IdCard string `json:"idCard"`
Pos float32 `json:"pos"`
CheckItems []ChecklistItem `json:"checkItems"`
// contains filtered or unexported fields
}
Checklist is a representation of a checklist on a trello card https://developers.trello.com/advanced-reference/checklist
func (*Checklist) AddItem ¶
AddItem will add a new item to the given checklist. The position will default to 'bottom' if nil and the item will default to 'unchecked'.
name must have a length 1 <= length <= 16384 pos can take the values 'top', 'bottom', or a positive integer
https://developers.trello.com/advanced-reference/checklist#post-1-checklists-idchecklist-checkitems
func (*Checklist) Delete ¶
Delete will delete the checklist https://developers.trello.com/advanced-reference/checklist#delete-1-checklists-idchecklist
type ChecklistItem ¶
type ChecklistItem struct {
State string `json:"state"`
Id string `json:"id"`
Name string `json:"name"`
NameData struct {
Emoji struct{} `json:"emoji"`
} `json:"nameData"`
Pos int `json:"pos"`
// contains filtered or unexported fields
}
func (*ChecklistItem) Delete ¶
func (i *ChecklistItem) Delete() error
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewAuthClient ¶
NewAuthClient will create a trello client which allows authentication. It uses NewBearerTokenTransport to create an http.Client which can be used as a trello client.
func NewClient ¶
NewClient returns a client needed to make trello API calls. If transport is nil all API calls will be unauthenticated. If you have a bearer token, NewBearerTokenTransport() may be helpful in making calls authenticated.
func NewCustomClient ¶
NewCustomClient can be used to implement your own client
func (*Client) Notification ¶
func (c *Client) Notification(notificationId string) (notification *Notification, err error)
func (*Client) Organization ¶
func (c *Client) Organization(orgId string) (organization *Organization, err error)
type List ¶
type List struct {
Id string `json:"id"`
Name string `json:"name"`
Closed bool `json:"closed"`
IdBoard string `json:"idBoard"`
Pos float32 `json:"pos"`
// contains filtered or unexported fields
}
func (*List) AddCard ¶
AddCard creates with the attributes of the supplied Card struct https://developers.trello.com/advanced-reference/card#post-1-cards
type Member ¶
type Member struct {
Id string `json:"id"`
AvatarHash string `json:"avatarHash"`
Bio string `json:"bio"`
BioData struct {
Emoji interface{} `json:"emoji,omitempty"`
} `json:"bioData"`
Confirmed bool `json:"confirmed"`
FullName string `json:"fullName"`
IdPremOrgsAdmin []string `json:"idPremOrgsAdmin"`
Initials string `json:"initials"`
MemberType string `json:"memberType"`
Products []int `json:"products"`
Status string `json:"status"`
Url string `json:"url"`
Username string `json:"username"`
AvatarSource string `json:"avatarSource"`
Email string `json:"email"`
GravatarHash string `json:"gravatarHash"`
IdBoards []string `json:"idBoards"`
IdBoardsPinned []string `json:"idBoardsPinned"`
IdOrganizations []string `json:"idOrganizations"`
LoginTypes []string `json:"loginTypes"`
NewEmail string `json:"newEmail"`
OneTimeMessagesDismissed []string `json:"oneTimeMessagesDismissed"`
Prefs struct {
SendSummaries bool `json:"sendSummaries"`
MinutesBetweenSummaries int `json:"minutesBetweenSummaries"`
MinutesBeforeDeadlineToNotify int `json:"minutesBeforeDeadlineToNotify"`
ColorBlind bool `json:"colorBlind"`
Locale string `json:"locale"`
} `json:"prefs"`
Trophies []string `json:"trophies"`
UploadedAvatarHash string `json:"uploadedAvatarHash"`
PremiumFeatures []string `json:"premiumFeatures"`
// contains filtered or unexported fields
}
func (*Member) Notifications ¶
func (m *Member) Notifications() (notifications []Notification, err error)
type Notification ¶
type Notification struct {
Id string `json:"id"`
Unread bool `json:"unread"`
Type string `json:"type"`
Date string `json:"date"`
Data struct {
ListBefore struct {
Id string `json:"id"`
Name string `json:"name"`
} `json:"listBefore"`
ListAfter struct {
Id string `json:"id"`
Name string `json:"name"`
} `json:"listAfter"`
Board struct {
Id string `json:"id"`
Name string `json:"name"`
ShortLink string `json:"shortLink"`
} `json:"board"`
Card struct {
Id string `json:"id"`
Name string `json:"name"`
ShortLink string `json:"shortLink"`
IdShort int `json:"idShort"`
} `json:"card"`
Old struct {
IdList string `json:"idList"`
} `json:"old"`
} `json:"data"`
IdMemberCreator string `json:"idMemberCreator"`
MemberCreator struct {
Id string `json:"id"`
AvatarHash string `json:"avatarHash"`
FullName string `json:"fullName"`
Initials string `json:"initials"`
Username string `json:"username"`
} `json:"memberCreator"`
// contains filtered or unexported fields
}
type Organization ¶
type Organization struct {
Id string `json:"id"`
Name string `json:"name"`
DisplayName string `json:"displayName"`
Desc string `json:"desc"`
DescData string `json:"descData"`
Url string `json:"url"`
Website string `json:"website"`
LogoHash string `json:"logoHash"`
Products []string `json:"products"`
PowerUps []string `json:"powerUps"`
// contains filtered or unexported fields
}
func (*Organization) Boards ¶
func (o *Organization) Boards() (boards []Board, err error)
func (*Organization) Members ¶
func (o *Organization) Members() (members []Member, err error)

