trello

package
v0.0.0-...-5b94c7c Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package trello is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var LabelFilterByColor = func(s string, l Label) bool {
	return s == l.Color
}
View Source
var LabelFilterByID = func(s string, l Label) bool {
	return s == l.ID
}
View Source
var LabelFilterByTCliColor = func(s string, l Label) bool {
	return s == l.ToTCliColor()
}
View Source
var LabelFilterOr = func(filters ...LabelFilter) LabelFilter {
	return func(s string, l Label) bool {
		for _, filter := range filters {
			if filter(s, l) {
				return true
			}
		}
		return false
	}
}

Functions

This section is empty.

Types

type Board

type Board struct {
	ID               string `json:"id"`
	Name             string `json:"name"`
	ShortLink        string `json:"shortLink"`
	ShortURL         string `json:"shortUrl"`
	DateLastActivity string `json:"dateLastActivity"`
}

func FindBoard

func FindBoard(boards Boards, query string) *Board

func (Board) SanitizedName

func (b Board) SanitizedName() string

func (Board) TCliID

func (b Board) TCliID() string

type Boards

type Boards []Board

type CacheInMemory

type CacheInMemory struct {
	*Boards
	// contains filtered or unexported fields
}

CacheInMemory is a decorator that caches the results of the proxified Repository in memory

func (*CacheInMemory) ArchiveAllCards

func (c *CacheInMemory) ArchiveAllCards(idList string) error

func (*CacheInMemory) CreateCard

func (c *CacheInMemory) CreateCard(createCard CreateCard) (*Card, error)

func (*CacheInMemory) CreateComment

func (c *CacheInMemory) CreateComment(createComment CreateComment) (*Comment, error)

func (*CacheInMemory) DeleteComment

func (c *CacheInMemory) DeleteComment(idCard, idComment string) error

func (*CacheInMemory) FindBoard

func (c *CacheInMemory) FindBoard(query string) (*Board, error)

func (*CacheInMemory) FindBoards

func (c *CacheInMemory) FindBoards() (Boards, error)

func (*CacheInMemory) FindCard

func (c *CacheInMemory) FindCard(idList string, query string) (*Card, error)

func (*CacheInMemory) FindCards

func (c *CacheInMemory) FindCards(idList string) (Cards, error)

func (*CacheInMemory) FindComment

func (c *CacheInMemory) FindComment(idCard string, idComment string) (*Comment, error)

func (*CacheInMemory) FindComments

func (c *CacheInMemory) FindComments(idCard string) (Comments, error)

func (*CacheInMemory) FindLabels

func (c *CacheInMemory) FindLabels(idBoard string) (Labels, error)

func (*CacheInMemory) FindList

func (c *CacheInMemory) FindList(idBoard string, query string) (*List, error)

func (*CacheInMemory) FindLists

func (c *CacheInMemory) FindLists(idBoard string) (Lists, error)

func (*CacheInMemory) Refresh

func (c *CacheInMemory) Refresh()

func (*CacheInMemory) UpdateCard

func (c *CacheInMemory) UpdateCard(updateCard UpdateCard) (*Card, error)

func (*CacheInMemory) UpdateComment

func (c *CacheInMemory) UpdateComment(updateComment UpdateComment) (*Comment, error)

type Card

type Card struct {
	ID        string  `json:"id"        toml:"id"`
	Name      string  `json:"name"      toml:"name"`
	Desc      string  `json:"desc"      toml:"desc"`
	IDBoard   string  `json:"idBoard"   toml:"idBoard"`
	IDList    string  `json:"idList"    toml:"idList"`
	Closed    bool    `json:"closed"    toml:"closed"`
	ShortLink string  `json:"shortLink" toml:"shortLink"`
	ShortURL  string  `json:"shortUrl"  toml:"shortUrl"`
	Pos       float64 `json:"pos"       toml:"pos"`
	Labels    `json:"labels" toml:"labels"`
}

func FindCard

func FindCard(cards Cards, query string) *Card

func (Card) SanitizedName

func (c Card) SanitizedName() string

func (Card) TCliID

func (c Card) TCliID() string

type CardToCreate

type CardToCreate struct {
	Name   string   `yaml:"name"          toml:"name"`
	Desc   string   `yaml:"desc"          toml:"desc"`
	IDList string   `yaml:"idList"        toml:"idList"`
	Pos    string   `yaml:"pos,omitempty" toml:"pos,omitempty"` // "top", "bottom" or a positive float
	Labels []string `yaml:"labels"        toml:"labels"`
}

CardToCreate is the representation used in the card creation it's different from the other card representation because we do not want to expose everything to the user like for instance, the card ID as the user

func NewCardToCreate

func NewCardToCreate(card Card, defaultLabels []string) CardToCreate

func (CardToCreate) GetPos

func (ctc CardToCreate) GetPos() interface{}

type CardToEdit

type CardToEdit struct {
	Name   string   `yaml:"name"          toml:"name"`
	Desc   string   `yaml:"desc"          toml:"desc"`
	Closed bool     `yaml:"closed"        toml:"closed"`
	IDList string   `yaml:"idList"        toml:"idList"`
	Labels []string `yaml:"labels"        toml:"labels"`
	Pos    string   `yaml:"pos,omitempty" toml:"pos,omitempty"` // "top", "bottom" or a positive float
}

CardToEdit is the representation used in the card edition it's different from the other card representation because we do not want to expose everything to the user like for instance, the card ID as the user

func NewCardToEdit

func NewCardToEdit(card Card) CardToEdit

func (CardToEdit) GetPos

func (cte CardToEdit) GetPos() interface{}

type Cards

type Cards []Card

func (Cards) SortedByPos

func (c Cards) SortedByPos() Cards

type Comment

type Comment struct {
	ID            string               `json:"id"`
	Date          string               `json:"date"`
	Data          CommentData          `json:"data"`
	MemberCreator CommentMemberCreator `json:"memberCreator"`
}

func FindComment

func FindComment(comments Comments, idComment string) *Comment

type CommentData

type CommentData struct {
	Card CommentDataCard `json:"card"`
	Text string          `json:"text"`
}

type CommentDataCard

type CommentDataCard struct {
	ID        string `json:"id"`
	Name      string `json:"name"`
	ShortLink string `json:"shortLink"`
}

type CommentMemberCreator

type CommentMemberCreator struct {
	ID       string `json:"id"`
	FullName string `json:"fullName"`
	Initials string `json:"initials"`
	Username string `json:"username"`
}

type Comments

type Comments []Comment

func (Comments) SortedByDateDesc

func (c Comments) SortedByDateDesc() Comments

type CreateCard

type CreateCard struct {
	Name     string      `json:"name"               toml:"name"`
	Desc     string      `json:"desc"               toml:"desc"`
	IDList   string      `json:"idList"             toml:"idList"`
	IDLabels string      `json:"idLabels,omitempty" toml:"idLabels,omitempty"`
	Closed   bool        `json:"closed,omitempty"   toml:"closed,omitempty"`
	Pos      interface{} `json:"pos,omitempty"      toml:"pos,omitempty"` // "top", "bottom" or a positive float
}

CreateCard represents the resources used to create a new card See https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-post for more info

func NewCreateCard

func NewCreateCard(card Card) CreateCard

type CreateComment

type CreateComment struct {
	IDCard string `json:"idCard"`
	Text   string `json:"text"`
}

type HttpRepository

type HttpRepository struct {
	conf.Conf
	// contains filtered or unexported fields
}

HttpRepository fetches the results from Trello APIs

func (HttpRepository) ArchiveAllCards

func (h HttpRepository) ArchiveAllCards(idList string) error

func (HttpRepository) CreateCard

func (h HttpRepository) CreateCard(createCard CreateCard) (*Card, error)

func (HttpRepository) CreateComment

func (h HttpRepository) CreateComment(createComment CreateComment) (*Comment, error)

func (HttpRepository) DeleteComment

func (h HttpRepository) DeleteComment(idCard, idComment string) error

func (HttpRepository) FindBoard

func (h HttpRepository) FindBoard(query string) (*Board, error)

func (HttpRepository) FindBoards

func (h HttpRepository) FindBoards() (Boards, error)

func (HttpRepository) FindCard

func (h HttpRepository) FindCard(idList string, query string) (*Card, error)

func (HttpRepository) FindCards

func (h HttpRepository) FindCards(idList string) (Cards, error)

func (HttpRepository) FindComment

func (h HttpRepository) FindComment(_, idComment string) (*Comment, error)

func (HttpRepository) FindComments

func (h HttpRepository) FindComments(idCard string) (Comments, error)

func (HttpRepository) FindLabels

func (h HttpRepository) FindLabels(idBoard string) (Labels, error)

func (HttpRepository) FindList

func (h HttpRepository) FindList(idBoard string, query string) (*List, error)

func (HttpRepository) FindLists

func (h HttpRepository) FindLists(idBoard string) (Lists, error)

func (HttpRepository) Refresh

func (h HttpRepository) Refresh()

func (HttpRepository) UpdateCard

func (h HttpRepository) UpdateCard(updateCard UpdateCard) (*Card, error)

func (HttpRepository) UpdateComment

func (h HttpRepository) UpdateComment(updateComment UpdateComment) (*Comment, error)

type Label

type Label struct {
	ID      string `json:"id"`
	IDBoard string `json:"idBoard"`
	Name    string `json:"name"`
	Color   string `json:"color"`
}

func (Label) ToTCliColor

func (l Label) ToTCliColor() string

type LabelFilter

type LabelFilter func(s string, l Label) bool

type Labels

type Labels []Label

func (Labels) FilterBy

func (l Labels) FilterBy(labels []string, filter LabelFilter) Labels

func (Labels) IDLabelsInString

func (l Labels) IDLabelsInString() string

func (Labels) String

func (l Labels) String() string

func (Labels) ToSliceTCliColors

func (l Labels) ToSliceTCliColors() []string

type List

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

func FindList

func FindList(lists Lists, query string) *List

func (List) SanitizedName

func (l List) SanitizedName() string

func (List) TCliID

func (l List) TCliID() string

type Lists

type Lists []List

type MockRepository

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

MockRepository is a mock of Repository interface.

func NewMockRepository

func NewMockRepository(ctrl *gomock.Controller) *MockRepository

NewMockRepository creates a new mock instance.

func (*MockRepository) ArchiveAllCards

func (m *MockRepository) ArchiveAllCards(idList string) error

ArchiveAllCards mocks base method.

func (*MockRepository) CreateCard

func (m *MockRepository) CreateCard(createCard CreateCard) (*Card, error)

CreateCard mocks base method.

func (*MockRepository) CreateComment

func (m *MockRepository) CreateComment(createComment CreateComment) (*Comment, error)

CreateComment mocks base method.

func (*MockRepository) DeleteComment

func (m *MockRepository) DeleteComment(idCard, idComment string) error

DeleteComment mocks base method.

func (*MockRepository) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockRepository) FindBoard

func (m *MockRepository) FindBoard(query string) (*Board, error)

FindBoard mocks base method.

func (*MockRepository) FindBoards

func (m *MockRepository) FindBoards() (Boards, error)

FindBoards mocks base method.

func (*MockRepository) FindCard

func (m *MockRepository) FindCard(idList, query string) (*Card, error)

FindCard mocks base method.

func (*MockRepository) FindCards

func (m *MockRepository) FindCards(idList string) (Cards, error)

FindCards mocks base method.

func (*MockRepository) FindComment

func (m *MockRepository) FindComment(idCard, idComment string) (*Comment, error)

FindComment mocks base method.

func (*MockRepository) FindComments

func (m *MockRepository) FindComments(idCard string) (Comments, error)

FindComments mocks base method.

func (*MockRepository) FindLabels

func (m *MockRepository) FindLabels(idBoard string) (Labels, error)

FindLabels mocks base method.

func (*MockRepository) FindList

func (m *MockRepository) FindList(idBoard, query string) (*List, error)

FindList mocks base method.

func (*MockRepository) FindLists

func (m *MockRepository) FindLists(idBoard string) (Lists, error)

FindLists mocks base method.

func (*MockRepository) Refresh

func (m *MockRepository) Refresh()

Refresh mocks base method.

func (*MockRepository) UpdateCard

func (m *MockRepository) UpdateCard(updateCard UpdateCard) (*Card, error)

UpdateCard mocks base method.

func (*MockRepository) UpdateComment

func (m *MockRepository) UpdateComment(updateComment UpdateComment) (*Comment, error)

UpdateComment mocks base method.

type MockRepositoryMockRecorder

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

MockRepositoryMockRecorder is the mock recorder for MockRepository.

func (*MockRepositoryMockRecorder) ArchiveAllCards

func (mr *MockRepositoryMockRecorder) ArchiveAllCards(idList interface{}) *gomock.Call

ArchiveAllCards indicates an expected call of ArchiveAllCards.

func (*MockRepositoryMockRecorder) CreateCard

func (mr *MockRepositoryMockRecorder) CreateCard(createCard interface{}) *gomock.Call

CreateCard indicates an expected call of CreateCard.

func (*MockRepositoryMockRecorder) CreateComment

func (mr *MockRepositoryMockRecorder) CreateComment(createComment interface{}) *gomock.Call

CreateComment indicates an expected call of CreateComment.

func (*MockRepositoryMockRecorder) DeleteComment

func (mr *MockRepositoryMockRecorder) DeleteComment(idCard, idComment interface{}) *gomock.Call

DeleteComment indicates an expected call of DeleteComment.

func (*MockRepositoryMockRecorder) FindBoard

func (mr *MockRepositoryMockRecorder) FindBoard(query interface{}) *gomock.Call

FindBoard indicates an expected call of FindBoard.

func (*MockRepositoryMockRecorder) FindBoards

func (mr *MockRepositoryMockRecorder) FindBoards() *gomock.Call

FindBoards indicates an expected call of FindBoards.

func (*MockRepositoryMockRecorder) FindCard

func (mr *MockRepositoryMockRecorder) FindCard(idList, query interface{}) *gomock.Call

FindCard indicates an expected call of FindCard.

func (*MockRepositoryMockRecorder) FindCards

func (mr *MockRepositoryMockRecorder) FindCards(idList interface{}) *gomock.Call

FindCards indicates an expected call of FindCards.

func (*MockRepositoryMockRecorder) FindComment

func (mr *MockRepositoryMockRecorder) FindComment(idCard, idComment interface{}) *gomock.Call

FindComment indicates an expected call of FindComment.

func (*MockRepositoryMockRecorder) FindComments

func (mr *MockRepositoryMockRecorder) FindComments(idCard interface{}) *gomock.Call

FindComments indicates an expected call of FindComments.

func (*MockRepositoryMockRecorder) FindLabels

func (mr *MockRepositoryMockRecorder) FindLabels(idBoard interface{}) *gomock.Call

FindLabels indicates an expected call of FindLabels.

func (*MockRepositoryMockRecorder) FindList

func (mr *MockRepositoryMockRecorder) FindList(idBoard, query interface{}) *gomock.Call

FindList indicates an expected call of FindList.

func (*MockRepositoryMockRecorder) FindLists

func (mr *MockRepositoryMockRecorder) FindLists(idBoard interface{}) *gomock.Call

FindLists indicates an expected call of FindLists.

func (*MockRepositoryMockRecorder) Refresh

func (mr *MockRepositoryMockRecorder) Refresh() *gomock.Call

Refresh indicates an expected call of Refresh.

func (*MockRepositoryMockRecorder) UpdateCard

func (mr *MockRepositoryMockRecorder) UpdateCard(updateCard interface{}) *gomock.Call

UpdateCard indicates an expected call of UpdateCard.

func (*MockRepositoryMockRecorder) UpdateComment

func (mr *MockRepositoryMockRecorder) UpdateComment(updateComment interface{}) *gomock.Call

UpdateComment indicates an expected call of UpdateComment.

type Path

type Path struct {
	BoardName string
	ListName  string
	CardName  string
	CommentID string
}

type PathResolver

type PathResolver struct {
	Path
}

func NewPathResolver

func NewPathResolver(session *Session) PathResolver

func (*PathResolver) Resolve

func (pr *PathResolver) Resolve(relativePath string) (p Path, err error)

type Repository

type Repository interface {
	Refresh()
	FindBoards() (Boards, error)
	FindBoard(query string) (*Board, error)
	FindLabels(idBoard string) (Labels, error)
	FindLists(idBoard string) (Lists, error)
	FindList(idBoard string, query string) (*List, error)
	FindCards(idList string) (Cards, error)
	FindCard(idList string, query string) (*Card, error)
	ArchiveAllCards(idList string) error
	CreateCard(createCard CreateCard) (*Card, error)
	UpdateCard(updateCard UpdateCard) (*Card, error)
	FindComments(idCard string) (Comments, error)
	FindComment(idCard string, idComment string) (*Comment, error)
	CreateComment(createComment CreateComment) (*Comment, error)
	UpdateComment(updateComment UpdateComment) (*Comment, error)
	DeleteComment(idCard, idComment string) error
}

Repository to call perform CRUD operation on Trello resources We may want to update this interface to accept channels to support async

func NewCacheInMemory

func NewCacheInMemory(r Repository) Repository

func NewHttpRepository

func NewHttpRepository(c conf.Conf, debug bool) Repository

type Session

type Session struct {
	Board *Board
	List  *List
	Card  *Card
}

type UpdateCard

type UpdateCard struct {
	ID       string      `json:"id"                 toml:"id"`
	Name     string      `json:"name"               toml:"name"`
	Desc     string      `json:"desc"               toml:"desc"`
	IDBoard  string      `json:"idBoard"            toml:"idBoard"`
	IDList   string      `json:"idList"             toml:"idList"`
	IDLabels string      `json:"idLabels,omitempty" toml:"idLabels,omitempty"`
	Closed   bool        `json:"closed,omitempty"   toml:"closed,omitempty"`
	Pos      interface{} `json:"pos,omitempty"      toml:"pos,omitempty"` // "top", "bottom" or a positive float
}

UpdateCard represents the resources used to update a card See https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-put for more info

func NewUpdateCard

func NewUpdateCard(card Card) UpdateCard

type UpdateComment

type UpdateComment struct {
	ID     string `json:"id"`
	IDCard string `json:"idCard"`
	Text   string `json:"text"`
}

Jump to

Keyboard shortcuts

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