go-trello: github.com/VojtechVitek/go-trello Index | Files

package trello

import "github.com/VojtechVitek/go-trello"

Index

Package Files

action.go arg.go attachment.go board.go card.go checklist.go client.go list.go member.go notification.go organization.go version.go

func EncodeArgs Uses

func EncodeArgs(args []*Argument) string

func NewBearerTokenTransport Uses

func NewBearerTokenTransport(applicationKey string, token *string) *bearerRoundTripper

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

type Action Uses

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 Uses

type Argument struct {
    Name  string
    Value string
}

func NewArgument Uses

func NewArgument(name, value string) *Argument

type Attachment Uses

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 Uses

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) Actions Uses

func (b *Board) Actions(arg ...*Argument) (actions []Action, err error)

func (*Board) Card Uses

func (b *Board) Card(IdCard string) (card *Card, err error)

func (*Board) Cards Uses

func (b *Board) Cards() (cards []Card, err error)

func (*Board) Checklists Uses

func (b *Board) Checklists() (checklists []Checklist, err error)

func (*Board) Lists Uses

func (b *Board) Lists() (lists []List, err error)

func (*Board) MemberCards Uses

func (b *Board) MemberCards(IdMember string) (cards []Card, err error)

func (*Board) Members Uses

func (b *Board) Members() (members []Member, err error)

type BoardBackground Uses

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

type Card Uses

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) Actions Uses

func (c *Card) Actions() (actions []Action, err error)

func (*Card) AddChecklist Uses

func (c *Card) AddChecklist(name string) (*Checklist, error)

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 Uses

func (c *Card) AddComment(text string) (*Action, error)

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 Uses

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 Uses

func (c *Card) Attachments() (attachments []Attachment, err error)

func (*Card) Checklists Uses

func (c *Card) Checklists() (checklists []Checklist, err error)

func (*Card) Members Uses

func (c *Card) Members() (members []Member, err error)

type Checklist Uses

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 Uses

func (c *Checklist) AddItem(name string, pos *string, checked *bool) (*ChecklistItem, error)

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 Uses

func (c *Checklist) Delete() error

Delete will delete the checklist https://developers.trello.com/advanced-reference/checklist#delete-1-checklists-idchecklist

type ChecklistItem Uses

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 Uses

func (i *ChecklistItem) Delete() error

type Client Uses

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

func NewAuthClient Uses

func NewAuthClient(applicationKey string, token *string) (*Client, error)

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 Uses

func NewClient() (*Client, error)

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 Uses

func NewCustomClient(client *http.Client) (*Client, error)

NewCustomClient can be used to implement your own client

func (*Client) Board Uses

func (c *Client) Board(boardId string) (board *Board, err error)

func (*Client) Boards Uses

func (c *Client) Boards() (boards []Board, err error)

func (*Client) Card Uses

func (c *Client) Card(CardId string) (card *Card, err error)

func (*Client) Delete Uses

func (c *Client) Delete(resource string) ([]byte, error)

func (*Client) Get Uses

func (c *Client) Get(resource string) ([]byte, error)

func (*Client) List Uses

func (c *Client) List(listId string) (list *List, err error)

func (*Client) Member Uses

func (c *Client) Member(nick string) (member *Member, err error)

func (*Client) Notification Uses

func (c *Client) Notification(notificationId string) (notification *Notification, err error)

func (*Client) Organization Uses

func (c *Client) Organization(orgId string) (organization *Organization, err error)

func (*Client) Post Uses

func (c *Client) Post(resource string, data url.Values) ([]byte, error)

func (*Client) Put Uses

func (c *Client) Put(resource string, data url.Values) ([]byte, error)

func (*Client) Version Uses

func (c *Client) Version() string

type List Uses

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) Actions Uses

func (l *List) Actions() (actions []Action, err error)

func (*List) AddCard Uses

func (l *List) AddCard(opts Card) (*Card, error)

AddCard creates with the attributes of the supplied Card struct https://developers.trello.com/advanced-reference/card#post-1-cards

func (*List) Cards Uses

func (l *List) Cards() (cards []Card, err error)

type Member Uses

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) AvatarUrl Uses

func (m *Member) AvatarUrl() string

TODO: Avatar sizes [170, 30]

func (*Member) Boards Uses

func (m *Member) Boards(field ...string) (boards []Board, err error)

func (*Member) Notifications Uses

func (m *Member) Notifications() (notifications []Notification, err error)

type Notification Uses

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 Uses

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 Uses

func (o *Organization) Boards() (boards []Board, err error)

func (*Organization) Members Uses

func (o *Organization) Members() (members []Member, err error)

Package trello imports 7 packages (graph) and is imported by 5 packages. Updated 2016-10-24. Refresh now. Tools for package owners.