pace

package module
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

README

Welcome to Pace for Developers.

If you're new here, we recommend you take a few minutes to understand how Pace for Developers works:

On this page

Pace CLI

The Pace command line interface provides programatic access to Pace.

pace help
pace list
pace templates
pace <service>.<method> -Flags=value

See the help:

$ pace help

Check the version:

$ pace version

Go client library

To use the Go client:

go get github.com/pacedotdev/pace

Then import it into your code:

  • Use pace.New(apikey) to create a pace.Client with your API key (Read more about API keys in Pace)
  • Call the function to create the service you need (e.g. pace.NewCardsService) passing in the pace.Client
  • Call the methods on that service to access the Pace API

Here is a complete example:

package main

import (
	"context"
	
	"github.com/pacedotdev/pace"
)

func run(ctx context.Context) error {
	apikey := os.Getenv("PACE_API_KEY")
	secret := os.Getenv("PACE_API_SECRET")
	client := pace.New(apikey, secret)
	cardsService := pace.NewCardsService(client)
	
	resp, err := cardsService.GetCard(ctx, pace.CreateCardRequest{
		OrgID:  "your-org-id",
		CardID: "12",
	})
	if err != nil {
		return err
	}

	fmt.Println("Card 12:", resp.Card.Title)
}

func main() {
	ctx := context.Background()
	if err := run(ctx); err != nil {
		fmt.Fprintf(os.Stderr, "err: %s\n", err)
	}
}

Pace JSON/HTTP API

You can make plain old HTTP calls with JSON payloads to interact with Pace.

  • Make calls directly to https://pace.dev/api
  • Set the Content-Type header to application/json
  • Use POST method
  • Set X-API-KEY and X-API-SIGNATURE headers (Read more about API keys in Pace)
POST https://pace.dev/api/CardsService.GetCard
Content-Type: application/json
X-API-KEY: your-api-key

{
	"OrgID": "your-org-id",
	"CardID": "12",
}

The response varies depending on which method you're calling, but there is always an Error string field which is empty (along with a 200 status code) if the operation was successful.

Documentation

Overview

Package pace is a Go client for the pace.dev API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddCommentRequest

type AddCommentRequest struct {

	// OrgID is the ID of the org.
	OrgID string `json:"orgID"`

	// TargetKind is the kind of item this comment is for. Can be "card", "message", or
	// "showcase".
	TargetKind string `json:"targetKind"`

	// TargetID is the ID of the target.
	TargetID string `json:"targetID"`

	// Body is the markdown body of the comment.
	Body string `json:"body"`
}

AddCommentRequest is the input object for AddComment.

type AddCommentResponse

type AddCommentResponse struct {

	// Comment is the comment that was created.
	Comment Comment `json:"comment"`
}

AddCommentResponse is the output object for AddComment.

type Card

type Card struct {

	// ID is the unique ID of the card within the org.
	ID string `json:"id"`

	// CTime is the time this was created.
	CTime string `json:"cTime"`

	// MTime is the time this comment was last modified.
	MTime string `json:"mTime"`

	// TeamID is the ID of the team that this card belongs to.
	TeamID string `json:"teamID"`

	// Slug is the URL slug for this card.
	Slug string `json:"slug"`

	// Title is the title of the card.
	Title string `json:"title"`

	// Status is the current status of the card.
	Status string `json:"status"`

	// Author is the Person who created this card.
	Author Person `json:"author"`

	// Body is the markdown body of this card.
	Body string `json:"body"`

	// BodyHTML is the HTML rendering of the body of this card.
	BodyHTML string `json:"bodyHTML"`

	// Tags is a list of tags associated with this card.
	Tags []string `json:"tags"`

	// TakenByCurrentUser indicates whether the current user has taken this card or
	// not.
	TakenByCurrentUser bool `json:"takenByCurrentUser"`

	// TakenByPeople is a list of people who have taken responsibility for this Card.
	TakenByPeople []Person `json:"takenByPeople"`

	// Files are the list of files that are attached to this Card.
	Files []File `json:"files"`
}

Card is a card in Pace.

type CardsService

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

CardsService allows you to programmatically manage cards in Pace.

func NewCardsService

func NewCardsService(client *Client) *CardsService

NewCardsService makes a new client for accessing CardsService services.

func (*CardsService) CreateCard

CreateCard creates a new Card.

func (*CardsService) DeleteCard

DeleteCard deletes a card.

func (*CardsService) GetCard

GetCard gets a card.

func (*CardsService) PutBackCard

PutBackCard removes a user from the list of responsbile users. Undoes TakeCard.

func (*CardsService) TakeCard

TakeCard takes responsibility for a card. Can be undone with PutBackCard.

func (*CardsService) UpdateCard

UpdateCard updates the title and body of the card.

func (*CardsService) UpdateCardStatus

UpdateCardStatus updates a card's status.

type Client

type Client struct {
	// RemoteHost is the URL of the remote server that this Client should
	// access. Default: https://pace.dev
	RemoteHost string
	// HTTPClient is the http.Client to use when making HTTP requests.
	HTTPClient *http.Client
	// Debug writes a line of debug log output.
	Debug func(s string)
	// contains filtered or unexported fields
}

Client is used to access Pace services.

func New

func New(apiKey, secret string) *Client

New makes a new Client.

type Comment

type Comment struct {

	// ID is the ID of the comment.
	ID string `json:"id"`

	// CTime is the time this was created.
	CTime string `json:"cTime"`

	// MTime is the time this comment was last modified.
	MTime string `json:"mTime"`

	// Body is the markdown body of the comment.
	Body string `json:"body"`

	// BodyHTML is the HTML formatted body of the comment.
	BodyHTML string `json:"bodyHTML"`

	// Author is the person who posted this comment.
	Author Person `json:"author"`
}

Comment is a single comment in Pace.

type CommentsService

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

CommentsService allows you to programmatically manage comments in Pace.

func NewCommentsService

func NewCommentsService(client *Client) *CommentsService

NewCommentsService makes a new client for accessing CommentsService services.

func (*CommentsService) AddComment

AddComment adds a comment.

func (*CommentsService) DeleteComment

DeleteComment deletes a Comment.

type CreateCardRequest

type CreateCardRequest struct {

	// OrgID is the org ID in which to create the card.
	OrgID string `json:"orgID"`

	// TeamID is the team ID in which to create the card.
	TeamID string `json:"teamID"`

	// Title is the title of the card.
	Title string `json:"title"`

	// ParentTargetKind is the kind of target to relate this card to (e.g. "card",
	// "message", or "showcase")
	ParentTargetKind string `json:"parentTargetKind"`

	// ParentTargetID is the ID of the item to relate this new card to.
	ParentTargetID string `json:"parentTargetID"`
}

CreateCardRequest is the input object for CreateCard.

type CreateCardResponse

type CreateCardResponse struct {

	// Card is the card that was just created.
	Card Card `json:"card"`
}

CreateCardResponse is the output object for CreateCard.

type DeleteCardRequest

type DeleteCardRequest struct {

	// OrgID is the ID of your org.
	OrgID string `json:"orgID"`

	// CardID is the ID of the card to delete.
	CardID string `json:"cardID"`
}

DeleteCardRequest is the input object for DeleteCard.

type DeleteCardResponse

type DeleteCardResponse struct {
}

DeleteCardResponse is the output object for DeleteCard.

type DeleteCommentRequest

type DeleteCommentRequest struct {

	// ID is the ID of the comment to delete.
	ID string `json:"id"`

	// OrgID is the ID of your org.
	OrgID string `json:"orgID"`

	// TargetKind is the kind of target this Comment was made on. Can be "card",
	// "message", or "showcase". Used to help identify the Comment.
	TargetKind string `json:"targetKind"`

	// TargetID is the ID of the target. Used to help identify the Comment.
	TargetID string `json:"targetID"`
}

DeleteCommentRequest is the input object for DeleteComment.

type DeleteCommentResponse

type DeleteCommentResponse struct {
}

DeleteCommentResponse is the output object for DeleteComment.

type File

type File struct {

	// ID is the identifier for this file.
	ID string `json:"id"`

	// CTime is the time the file was uploaded.
	CTime string `json:"cTime"`

	// Name is the name of the file.
	Name string `json:"name"`

	// Path is the path of the file.
	Path string `json:"path"`

	// ContentType is the type of the file.
	ContentType string `json:"contentType"`

	// FileType is the type of file. Can be "file", "video", "image", "audio" or
	// "screenshare".
	FileType string `json:"fileType"`

	// Size is the size of the file in bytes.
	Size int `json:"size"`

	// DownloadURL URL which can be used to get the file.
	DownloadURL string `json:"downloadURL"`

	// ThumbnailURL is an optional thumbnail URL for this file.
	ThumbnailURL string `json:"thumbnailURL"`

	// Author is the person who uploaded the file.
	Author Person `json:"author"`
}

File represents an attached file.

type GetCardRequest

type GetCardRequest struct {

	// OrgID is the ID of the org.
	OrgID string `json:"orgID"`

	// CardID is the ID of the card to get.
	CardID string `json:"cardID"`
}

GetCardRequest is the input object for GetCard.

type GetCardResponse

type GetCardResponse struct {

	// Card is the card.
	Card Card `json:"card"`
}

GetCardResponse is the output object for GetCard.

type Person

type Person struct {

	// ID is the ID of the Person.
	ID string `json:"id"`

	// Username is the Person's username within the org.
	Username string `json:"username"`

	// Name is the name of the Person.
	Name string `json:"name"`

	// PhotoURL is the URL of a picture of this Person.
	PhotoURL string `json:"photoURL"`
}

Person is a human who uses Pace.

type PutBackCardRequest

type PutBackCardRequest struct {

	// OrgID is the ID of your org.
	OrgID string `json:"orgID"`

	// CardID is the ID of the card to unassign yourself from.
	CardID string `json:"cardID"`
}

PutBackCardRequest is the input object for PutBackCard.

type PutBackCardResponse

type PutBackCardResponse struct {

	// Card is the newly updated Card.
	Card Card `json:"card"`
}

PutBackCardResponse is the output object for PutBackCard.

type TakeCardRequest

type TakeCardRequest struct {

	// OrgID is the ID of your org.
	OrgID string `json:"orgID"`

	// CardID is the ID of the card to assign yourself to.
	CardID string `json:"cardID"`
}

TakeCardRequest is the input object for TakeCard.

type TakeCardResponse

type TakeCardResponse struct {

	// Card is the newly updated Card.
	Card Card `json:"card"`
}

TakeCardResponse is the output object for TakeCard.

type UpdateCardRequest

type UpdateCardRequest struct {

	// OrgID is the ID of the org.
	OrgID string `json:"orgID"`

	// CardID is the ID of the card to update.
	CardID string `json:"cardID"`

	// Title is the new title for the card.
	Title string `json:"title"`

	// Body is the new markdown body for the card.
	Body string `json:"body"`
}

UpdateCardRequest is the input object for UpdateCard.

type UpdateCardResponse

type UpdateCardResponse struct {

	// Card is the recently updated Card.
	Card Card `json:"card"`
}

UpdateCardResponse is the output object for UpdateCard.

type UpdateCardStatusRequest

type UpdateCardStatusRequest struct {

	// OrgID is the ID of the org.
	OrgID string `json:"orgID"`

	// CardID is the ID number of the card.
	CardID string `json:"cardID"`

	// Status is the new status of the card. Valid strings are "future", "next",
	// "progress", "done".
	Status string `json:"status"`
}

UpdateCardStatusRequest is the input object UpdateCardStatus.

type UpdateCardStatusResponse

type UpdateCardStatusResponse struct {

	// Card is the card that was updated.
	Card Card `json:"card"`
}

UpdateCardStatusResponse is the output object for UpdateCardService.

Directories

Path Synopsis
cmd
pace command

Jump to

Keyboard shortcuts

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