Documentation ¶
Index ¶
- Constants
- func CardUrl(account *models.Account, project *models.Project, card *models.Card) string
- func Check(err error, msg string)
- func Contains[T comparable](coll []T, e T) bool
- func EpicTitles(epics *[]models.Epic) []string
- func GenerateRefreshJWT(clientId string, key *rsa.PrivateKey) (string, error)
- func GetEpicByTitle(title string, epics *[]models.Epic) models.Epic
- func GetLabelsByIndexes(indexes []int, labels []models.Label) []models.Label
- func GetMembersByNames(names []string, members []models.Member) []models.Member
- func GetPrivateKey() (*rsa.PrivateKey, error)
- func GetPrivateKeyWithPath(privateKeyPath string) (*rsa.PrivateKey, error)
- func GetProjectByName(name string, projects *[]models.Project) (models.Project, error)
- func GetSourceByName(name string, sources *[]models.Source) models.Source
- func GetWorkspaceByName(name string, workspaces *[]models.Workspace) models.Workspace
- func IsTokenValid(token models.ZubeAccessToken) bool
- func LabelIds(labels *[]models.Label) []int
- func LabelNames(labels *[]models.Label) []string
- func MemberIds(members *[]models.Member) []int
- func MemberNames(members *[]models.Member) []string
- func ParsePriority(priority string) optional.Int
- func PrivateKeyFilePath() string
- func ProjectNames(projects *[]models.Project) []string
- func SourceNames(sources *[]models.Source) []string
- func WorkspaceNames(workspaces *[]models.Workspace) []string
- type Client
- func (client *Client) CreateCard(card *models.Card) models.Card
- func (client *Client) DoApiRequestUrl(method string, url *url.URL, body io.Reader) ([]byte, error)
- func (client *Client) FetchAccounts(query *Query) []models.Account
- func (client *Client) FetchCardComments(cardId int) []models.Comment
- func (client *Client) FetchCards(query *Query) []models.Card
- func (client *Client) FetchCurrentPerson() models.CurrentPerson
- func (client *Client) FetchEpics(projectId int) []models.Epic
- func (client *Client) FetchLabels(projectId int) []models.Label
- func (client *Client) FetchProjectCards(projectId int, query *Query) []models.Card
- func (client *Client) FetchProjectMembers(projectId int) []models.Member
- func (client *Client) FetchProjects(query *Query) []models.Project
- func (client *Client) FetchSources() []models.Source
- func (client *Client) FetchSprints(workspaceId int) []models.Sprint
- func (client *Client) FetchWorkspaces(query *Query) []models.Workspace
- func (client *Client) MoveCard(cardId int, destination *models.Destination)
- func (client *Client) RefreshAccessToken(key *rsa.PrivateKey) (*Client, error)
- func (client *Client) SearchCards(query *Query) []models.Card
- type Filter
- type Order
- type Pagination
- type Query
Constants ¶
const ( ZubeHost string = "zube.io" ApiUrl string = "https://zube.io/api/" UserAgent string = "Zube-Go" )
const PrivateKeyFileName = "zube_api_key.pem"
Variables ¶
This section is empty.
Functions ¶
func Contains ¶
func Contains[T comparable](coll []T, e T) bool
Check if `coll` contains an element `e` of type `T`
func EpicTitles ¶
func GenerateRefreshJWT ¶
func GenerateRefreshJWT(clientId string, key *rsa.PrivateKey) (string, error)
Create a refresh JWT valid for one minute, used to fetch an access token JWT
func GetLabelsByIndexes ¶
func GetMembersByNames ¶
func GetPrivateKey ¶
func GetPrivateKey() (*rsa.PrivateKey, error)
func GetPrivateKeyWithPath ¶
func GetPrivateKeyWithPath(privateKeyPath string) (*rsa.PrivateKey, error)
Returns the parsed RSA private key from the given path to a .pem file
func GetProjectByName ¶
func GetWorkspaceByName ¶
func IsTokenValid ¶
func IsTokenValid(token models.ZubeAccessToken) bool
Returns true if the token is present and not expired
func LabelNames ¶
Convert labels to a slice of label names
func MemberNames ¶
func ParsePriority ¶
func PrivateKeyFilePath ¶
func PrivateKeyFilePath() string
Returns the correct path to the user's private key file
func ProjectNames ¶
Convert projects to a slice of project names
func SourceNames ¶
func WorkspaceNames ¶
Convert workspaces to a slice of workspace names
Types ¶
type Client ¶
type Client struct { models.ZubeAccessToken // An encoded access JWT valid for 24h to the Zube API Host string ClientId string // Your unique client ID HTTPc http.Client }
func NewClient ¶
Creates and returns a Zube Client with an access token If the current access token is invalid, it is refreshes and saved to config
func NewClientWithId ¶
Constructs a new client with only host and Client ID configured, enough to make an access token request.
func (*Client) DoApiRequestUrl ¶ added in v2.0.2
Performs a generic request with URL and body
func (*Client) FetchAccounts ¶
Fetch and return an array of `Account`s
func (*Client) FetchCardComments ¶
func (*Client) FetchCards ¶
Fetch and return an array of `Card`s
func (*Client) FetchCurrentPerson ¶
func (client *Client) FetchCurrentPerson() models.CurrentPerson
func (*Client) FetchEpics ¶
Fetch all epics for a given project
func (*Client) FetchLabels ¶
Fetch all labels for a given project
func (*Client) FetchProjectCards ¶
Fetch cards for a specific project. The `project_id` key in the `Where` part of the `Query`'s `Filter` will have no effect.
func (*Client) FetchProjectMembers ¶
func (*Client) FetchSources ¶
Fetch and return an array of Github `Source`s
func (*Client) FetchSprints ¶
Fetch all sprints for a given workspace
func (*Client) FetchWorkspaces ¶
func (*Client) MoveCard ¶ added in v2.0.2
func (client *Client) MoveCard(cardId int, destination *models.Destination)
Move a card to a new destination
func (*Client) RefreshAccessToken ¶
func (client *Client) RefreshAccessToken(key *rsa.PrivateKey) (*Client, error)
Fetch the access token JWT from Zube API and set it for the client. If it already exists, refresh it.