Documentation
¶
Index ¶
- Constants
- func EarliestCardID(cards []*Card) string
- func IDToTime(id string) (t time.Time, err error)
- func IsNotFound(err error) bool
- func IsPermissionDenied(err error) bool
- func IsRateLimit(err error) bool
- type Action
- type ActionCollection
- func (actions ActionCollection) ContainsCardCreation() bool
- func (c ActionCollection) FilterToCardCreationActions() ActionCollection
- func (c ActionCollection) FilterToCardMembershipChangeActions() ActionCollection
- func (c ActionCollection) FilterToListChangeActions() ActionCollection
- func (actions ActionCollection) FirstCardCreateAction() *Action
- func (actions ActionCollection) GetListDurations() (durations []*ListDuration, err error)
- func (actions ActionCollection) GetMemberDurations() (durations []*MemberDuration, err error)
- func (c ActionCollection) Len() int
- func (c ActionCollection) Less(i, j int) bool
- func (c ActionCollection) Swap(i, j int)
- type ActionData
- type Arguments
- type Attachment
- type AttachmentPreview
- type BackgroundImage
- type Board
- func (b *Board) ContainsCopyOfCard(cardID string, args Arguments) (bool, error)
- func (b *Board) CreateList(name string, args Arguments) (list *List, err error)
- func (b *Board) CreatedAt() time.Time
- func (b *Board) GetActions(args Arguments) (actions ActionCollection, err error)
- func (b *Board) GetCards(args Arguments) (cards []*Card, err error)
- func (b *Board) GetLists(args Arguments) (lists []*List, err error)
- func (b *Board) GetMembers(args Arguments) (members []*Member, err error)
- type BoardWebhookRequest
- type ByFirstEntered
- type ByLongestDuration
- type Card
- func (c *Card) AddChecklist(name string) error
- func (c *Card) AddComment(comment string, args Arguments) (*Action, error)
- func (c *Card) AddLabel(labelID string) error
- func (c *Card) CopyToList(listID string, args Arguments) (*Card, error)
- func (c *Card) CreatedAt() time.Time
- func (c *Card) CreatorMember() (*Member, error)
- func (c *Card) CreatorMemberID() (string, error)
- func (c *Card) GetActions(args Arguments) (actions ActionCollection, err error)
- func (c *Card) GetAncestorCards(args Arguments) (ancestors []*Card, err error)
- func (c *Card) GetListChangeActions() (actions ActionCollection, err error)
- func (c *Card) GetListDurations() (durations []*ListDuration, err error)
- func (c *Card) GetMemberDurations() (durations []*MemberDuration, err error)
- func (c *Card) GetMembers(args Arguments) (members []*Member, err error)
- func (c *Card) GetMembershipChangeActions() (actions ActionCollection, err error)
- func (c *Card) GetOriginatingCard(args Arguments) (*Card, error)
- func (c *Card) GetParentCard(args Arguments) (*Card, error)
- func (c *Card) MoveToBottomOfList() error
- func (c *Card) MoveToList(listID string, args Arguments) error
- func (c *Card) MoveToListOnBoard(listID string, boardID string, args Arguments) error
- func (c *Card) MoveToTopOfList() error
- func (c *Card) RemoveLabel(labelID string) error
- func (c *Card) RemoveMember(memberID string) error
- func (c *Card) SetPos(newPos float64) error
- func (c *Card) Update(args Arguments) error
- type CardWebhookRequest
- type CheckItem
- type CheckItemState
- type Checklist
- type Client
- func (c *Client) CreateCard(card *Card, extraArgs Arguments) error
- func (c *Client) CreateWebhook(webhook *Webhook) error
- func (c *Client) Delete(path string, args Arguments, target interface{}) error
- func (c *Client) Get(path string, args Arguments, target interface{}) error
- func (c *Client) GetBoard(boardID string, args Arguments) (board *Board, err error)
- func (c *Client) GetCard(cardID string, args Arguments) (card *Card, err error)
- func (c *Client) GetList(listID string, args Arguments) (list *List, err error)
- func (c *Client) GetMember(memberID string, args Arguments) (member *Member, err error)
- func (c *Client) GetOrganization(orgID string, args Arguments) (organization *Organization, err error)
- func (c *Client) GetToken(tokenID string, args Arguments) (token *Token, err error)
- func (c *Client) GetWebhook(webhookID string, args Arguments) (webhook *Webhook, err error)
- func (c *Client) Post(path string, args Arguments, target interface{}) error
- func (c *Client) Put(path string, args Arguments, target interface{}) error
- func (c *Client) SearchBoards(query string, args Arguments) (boards []*Board, err error)
- func (c *Client) SearchCards(query string, args Arguments) (cards []*Card, err error)
- func (c *Client) SearchMembers(query string, args Arguments) (members []*Member, err error)
- func (c *Client) Throttle()
- type Label
- type List
- type ListDuration
- type ListWebhookRequest
- type Member
- type MemberDuration
- type Organization
- type Permission
- type SearchOptions
- type SearchResult
- type SearchTerm
- type Token
- type Webhook
Constants ¶
const DEFAULT_BASEURL = "https://api.trello.com/1"
Variables ¶
This section is empty.
Functions ¶
func EarliestCardID ¶
func IsNotFound ¶
func IsPermissionDenied ¶
func IsRateLimit ¶
Types ¶
type Action ¶
type Action struct { ID string `json:"id"` IDMemberCreator string `json:"idMemberCreator"` Type string `json:"type"` Date time.Time `json:"date"` Data *ActionData `json:"data,omitempty"` MemberCreator *Member `json:"memberCreator,omitempty"` Member *Member `json:"member,omitempty"` }
func (*Action) DidArchiveCard ¶
func (*Action) DidChangeCardMembership ¶
func (*Action) DidChangeListForCard ¶
Returns true if this action created the card (in which case it caused it to enter its first list), archived the card (in which case it caused it to leave its last List), or was an updateCard action involving a change to the list. This is supporting functionality for ListDuration.
func (*Action) DidCreateCard ¶
DidCreateCard() returns true if this action created a card, false otherwise.
func (*Action) DidUnarchiveCard ¶
type ActionCollection ¶
type ActionCollection []*Action
ActionCollection is an alias of []*Action, which sorts by the Action's ID. Which is the same as sorting by the Action's time of occurrence
func (ActionCollection) ContainsCardCreation ¶
func (actions ActionCollection) ContainsCardCreation() bool
func (ActionCollection) FilterToCardCreationActions ¶
func (c ActionCollection) FilterToCardCreationActions() ActionCollection
func (ActionCollection) FilterToCardMembershipChangeActions ¶
func (c ActionCollection) FilterToCardMembershipChangeActions() ActionCollection
func (ActionCollection) FilterToListChangeActions ¶
func (c ActionCollection) FilterToListChangeActions() ActionCollection
func (ActionCollection) FirstCardCreateAction ¶
func (actions ActionCollection) FirstCardCreateAction() *Action
func (ActionCollection) GetListDurations ¶
func (actions ActionCollection) GetListDurations() (durations []*ListDuration, err error)
func (ActionCollection) GetMemberDurations ¶
func (actions ActionCollection) GetMemberDurations() (durations []*MemberDuration, err error)
Similar to GetListDurations(), this function returns a slice of MemberDuration objects, which describes the length of time each member was attached to this card. Durations are calculated such that being added to a card starts a timer for that member, and being removed starts it again (so that if a person is added and removed multiple times, the duration captures only the times which they were attached). Archiving the card also stops the timer.
func (ActionCollection) Len ¶
func (c ActionCollection) Len() int
func (ActionCollection) Less ¶
func (c ActionCollection) Less(i, j int) bool
func (ActionCollection) Swap ¶
func (c ActionCollection) Swap(i, j int)
type ActionData ¶
type ActionData struct { Text string `json:"text,omitempty"` List *List `json:"list,omitempty"` Card *Card `json:"card,omitempty"` CardSource *Card `json:"cardSource,omitempty"` Board *Board `json:"board,omitempty"` Old *Card `json:"old,omitempty"` ListBefore *List `json:"listBefore,omitempty"` ListAfter *List `json:"listAfter,omitempty"` DateLastEdited time.Time `json:"dateLastEdited"` CheckItem *CheckItem `json:"checkItem"` Checklist *Checklist `json:"checklist"` }
type Arguments ¶
func (Arguments) ToURLValues ¶
type Attachment ¶
type Attachment struct { ID string `json:"id"` Name string `json:"name"` Pos float32 `json:"pos"` Bytes int `json:"int"` Date string `json:"date"` EdgeColor string `json:"edgeColor"` IDMember string `json:"idMember"` IsUpload bool `json:"isUpload"` MimeType string `json:"mimeType"` Previews []AttachmentPreview `json:"previews"` URL string `json:"url"` }
type AttachmentPreview ¶
type BackgroundImage ¶
type Board ¶
type Board struct { ID string `json:"id"` Name string `json:"name"` Desc string `json:"desc"` 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 []BackgroundImage `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 { Black string `json:"black,omitempty"` Blue string `json:"blue,omitempty"` Green string `json:"green,omitempty"` Lime string `json:"lime,omitempty"` Orange string `json:"orange,omitempty"` Pink string `json:"pink,omitempty"` Purple string `json:"purple,omitempty"` Red string `json:"red,omitempty"` Sky string `json:"sky,omitempty"` Yellow string `json:"yellow,omitempty"` } `json:"labelNames"` // contains filtered or unexported fields }
func (*Board) ContainsCopyOfCard ¶
func (*Board) CreateList ¶
func (*Board) GetActions ¶
func (b *Board) GetActions(args Arguments) (actions ActionCollection, err error)
type BoardWebhookRequest ¶
BoardWebhookRequest is the object sent by Trello to a Webhook for Board-triggered webhooks.
func GetBoardWebhookRequest ¶
func GetBoardWebhookRequest(r *http.Request) (whr *BoardWebhookRequest, err error)
type ByFirstEntered ¶
type ByFirstEntered []*ListDuration
func (ByFirstEntered) Len ¶
func (durs ByFirstEntered) Len() int
func (ByFirstEntered) Less ¶
func (durs ByFirstEntered) Less(i, j int) bool
func (ByFirstEntered) Swap ¶
func (durs ByFirstEntered) Swap(i, j int)
type ByLongestDuration ¶
type ByLongestDuration []*MemberDuration
func (ByLongestDuration) Len ¶
func (d ByLongestDuration) Len() int
func (ByLongestDuration) Less ¶
func (d ByLongestDuration) Less(i, j int) bool
func (ByLongestDuration) Swap ¶
func (d ByLongestDuration) Swap(i, j int)
type Card ¶
type Card struct { // Key metadata ID string `json:"id"` IDShort int `json:"idShort"` Name string `json:"name"` Pos float64 `json:"pos"` Email string `json:"email"` ShortLink string `json:"shortLink"` ShortUrl string `json:"shortUrl"` Url string `json:"url"` Desc string `json:"desc"` Due *time.Time `json:"due"` DueComplete bool `json:"dueComplete"` Closed bool `json:"closed"` Subscribed bool `json:"subscribed"` DateLastActivity *time.Time `json:"dateLastActivity"` // Board Board *Board IDBoard string `json:"idBoard"` // List List *List IDList string `json:"idList"` // Badges Badges struct { Votes int `json:"votes"` ViewingMemberVoted bool `json:"viewingMemberVoted"` Subscribed bool `json:"subscribed"` Fogbugz string `json:"fogbugz,omitempty"` CheckItems int `json:"checkItems"` CheckItemsChecked int `json:"checkItemsChecked"` Comments int `json:"comments"` Attachments int `json:"attachments"` Description bool `json:"description"` Due *time.Time `json:"due,omitempty"` } `json:"badges"` // Actions Actions ActionCollection `json:"actions,omitempty"` // Checklists IDCheckLists []string `json:"idCheckLists"` Checklists []*Checklist `json:"checklists,omitempty"` CheckItemStates []*CheckItemState `json:"checkItemStates,omitempty"` // Members IDMembers []string `json:"idMembers,omitempty"` IDMembersVoted []string `json:"idMembersVoted,omitempty"` Members []*Member `json:"members,omitempty"` // Attachments IDAttachmentCover string `json:"idAttachmentCover"` ManualCoverAttachment bool `json:"manualCoverAttachment"` Attachments []*Attachment `json:"attachments,omitempty"` // Labels Labels []*Label `json:"labels,omitempty"` // contains filtered or unexported fields }
func (*Card) AddChecklist ¶
func (*Card) AddComment ¶
func (*Card) CopyToList ¶
Try these Arguments
Arguments["keepFromSource"] = "all" Arguments["keepFromSource"] = "none" Arguments["keepFromSource"] = "attachments,checklists,comments"
func (*Card) CreatorMember ¶
func (*Card) CreatorMemberID ¶
func (*Card) GetActions ¶
func (c *Card) GetActions(args Arguments) (actions ActionCollection, err error)
func (*Card) GetAncestorCards ¶
func (*Card) GetListChangeActions ¶
func (c *Card) GetListChangeActions() (actions ActionCollection, err error)
GetListChangeActions retrieves a slice of Actions which resulted in changes to the card's active List. This includes the createCard and copyCard action (which place the card in its first list, and the updateCard:closed action, which remove it from its last list.
This function is just an alias for:
card.GetActions(Arguments{"filter": "createCard,copyCard,updateCard:idList,updateCard:closed", "limit": "1000"})
func (*Card) GetListDurations ¶
func (c *Card) GetListDurations() (durations []*ListDuration, err error)
Analytzes a Cards actions to figure out how long it was in each List
func (*Card) GetMemberDurations ¶
func (c *Card) GetMemberDurations() (durations []*MemberDuration, err error)
func (*Card) GetMembershipChangeActions ¶
func (c *Card) GetMembershipChangeActions() (actions ActionCollection, err error)
func (*Card) GetParentCard ¶
If this Card was created from a copy of another Card, this func retrieves the originating Card. Returns an error only when a low-level failure occurred. If this Card has no parent, a nil card and nil error are returned. In other words, the non-existence of a parent is not treated as an error.
func (*Card) MoveToBottomOfList ¶
func (*Card) MoveToListOnBoard ¶
func (*Card) MoveToTopOfList ¶
func (*Card) RemoveLabel ¶
func (*Card) RemoveMember ¶
type CardWebhookRequest ¶
CardWebhookRequest is the object sent by Trello to a Webhook for Card-triggered webhooks.
func GetCardWebhookRequest ¶
func GetCardWebhookRequest(r *http.Request) (whr *CardWebhookRequest, err error)
type CheckItem ¶
type CheckItem struct { IDCard string ID string `json:"id"` Name string `json:"name"` State string `json:"state"` IDChecklist string `json:"idChecklist,omitempty"` Pos float64 `json:"pos,omitempty"` // contains filtered or unexported fields }
func (*CheckItem) SetNameAndState ¶
type CheckItemState ¶
Manifestation of CheckItem when it appears in CheckItemStates on a Card.
type Checklist ¶
type Checklist struct { ID string `json:"id"` Name string `json:"name"` IDBoard string `json:"idBoard,omitempty"` IDCard string `json:"idCard,omitempty"` Pos float64 `json:"pos,omitempty"` CheckItems []CheckItem `json:"checkItems,omitempty"` // contains filtered or unexported fields }
func (*Checklist) AddCheckItem ¶
type Client ¶
type Client struct { Logger logger BaseURL string Key string Token string // contains filtered or unexported fields }
func (*Client) CreateWebhook ¶
func (*Client) GetOrganization ¶
func (c *Client) GetOrganization(orgID string, args Arguments) (organization *Organization, err error)
func (*Client) GetWebhook ¶
func (*Client) SearchBoards ¶
func (*Client) SearchCards ¶
func (*Client) SearchMembers ¶
type List ¶
type List struct { ID string `json:"id"` Name string `json:"name"` IDBoard string `json:"idBoard,omitempty"` Closed bool `json:"closed"` Pos float32 `json:"pos,omitempty"` Board *Board `json:"board,omitempty"` Cards []*Card `json:"cards,omitempty"` // contains filtered or unexported fields }
func ListAfterAction ¶
ListAfterAction calculates which List the card ended up in after this action completed. Returns nil when the action resulted in the card being archived (in which case we consider it to not be in a list anymore), or when the action isn't related to a list at all (in which case this is a nonsensical question to ask).
func (*List) GetActions ¶
func (l *List) GetActions(args Arguments) (actions ActionCollection, err error)
type ListDuration ¶
type ListDuration struct { ListID string ListName string Duration time.Duration FirstEntered time.Time TimesInList int }
func (*ListDuration) AddDuration ¶
func (l *ListDuration) AddDuration(d time.Duration)
type ListWebhookRequest ¶
ListWebhookRequest is the object sent by Trello to a Webhook for List-triggered webhooks.
func GetListWebhookRequest ¶
func GetListWebhookRequest(r *http.Request) (whr *ListWebhookRequest, err error)
type Member ¶
type MemberDuration ¶
type MemberDuration struct { MemberID string MemberName string FirstAdded time.Time Duration time.Duration // contains filtered or unexported fields }
Used to track the periods of time which a user (member) is attached to a card.
type Organization ¶
type Organization struct { ID string `json:"id"` Name string `json:"name"` DisplayName string `json:"displayName"` Desc string `json:"desc"` URL string `json:"url"` Website string `json:"website"` Products []string `json:"products"` PowerUps []string `json:"powerUps"` // contains filtered or unexported fields }
func (*Organization) GetMembers ¶
func (o *Organization) GetMembers(args Arguments) (members []*Member, err error)
type Permission ¶
type SearchOptions ¶
type SearchOptions struct { Terms []SearchTerm `json:"terms"` Modifiers []string `json:"modifiers,omitempty"` ModelTypes []string `json:"modelTypes,omitempty"` Partial bool `json:"partial"` }
type SearchResult ¶
type SearchResult struct { Options SearchOptions `json:"options"` Actions []*Action `json:"actions,omitempty"` Cards []*Card `json:"cards,omitempty"` Boards []*Board `json:"boards,omitempty"` Members []*Member `json:"members,omitempty"` }
type SearchTerm ¶
type Token ¶
type Webhook ¶
type Webhook struct { ID string `json:"id,omitempty"` IDModel string `json:"idModel"` Description string `json:"description"` CallbackURL string `json:"callbackURL"` Active bool `json:"active"` // contains filtered or unexported fields }
Webhook is the Go representation of a webhook registered in Trello's systems. Used when creating, modifying or deleting webhooks.