tracker

package
v0.0.0-...-1638020 Latest Latest
Warning

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

Go to latest
Published: May 28, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const TRACKER_URL = "https://www.pivotaltracker.com/services/v5"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client can be used to communicate with the Tracker API.

func NewClient

func NewClient(config Config) *Client

NewClient returns a new Client.

func TestClient

func TestClient(rootURL string, clock internal.Clock, config Config) *Client

TestClient returns a new client explicitly meant for internal testing. This should not be used for production code.

func (*Client) MakeRequest

func (client *Client) MakeRequest(options requestOptions, returnResponse interface{}) error

func (*Client) Me

func (client *Client) Me() (Me, error)

Me returns information from the user's profile plus the list of projects to which the user has access.

func (*Client) Projects

func (client *Client) Projects() ([]Project, error)

func (*Client) WrapConnection

func (client *Client) WrapConnection(wrapper internal.ConnectionWrapper)

WrapConnection wraps the current Client connection in the wrapper.

type Config

type Config struct {
	// AppName is the name of the application/process using the client.
	AppName string

	// AppVersion is the version of the application/process using the client.
	AppVersion string

	// APIToken is the tracker API token to make requests with.
	APIToken string

	// Wrappers that apply to the client connection.
	Wrappers []internal.ConnectionWrapper

	// SkipSSLValidation will skip hostname validation when set to true.
	SkipSSLValidation bool
}

Config allows the Client to be configured

type EmbeddedProject

type EmbeddedProject struct {
	Color        string    `json:"color"`
	Favorite     bool      `json:"favorite"`
	ID           uint64    `json:"id"`
	Kind         string    `json:"kind"`
	LastViewedAt time.Time `json:"last_viewed_at"`
	Name         string    `json:"project_name"`
	ProjectID    uint64    `json:"project_id"`
	Role         string    `json:"role"`
}

type Me

type Me struct {
	// APIToken is a string that can be used as the API authentication token
	// (X-TrackerToken) to authenticate future API requests as being on behalf of
	// the current user. This field is read only.
	APIToken string `json:"api_token"`
	// Email is the authenticated user's email. This field is read only.
	Email string `json:"email"`
	// ID is the database id of the authenticated user. This field is read only.
	// This field is always returned.
	ID uint64 `json:"id"`
	// Name is the name of the authenticated user. This field is read only.
	Name string `json:"name"`
	// Projects is a list of the project(s) that the authenticated user is a
	// member of. This field is read only.
	Projects []EmbeddedProject `json:"projects"`
	// Username is the authenticated user's optional 'username' for login
	// purposes. This field is read only.
	Username string `json:"username"`
}

type Params

type Params map[string]string

Params map path keys to values. For example, if your route has the path pattern:

/person/:person_id/pets/:pet_type

Then a correct Params map would lool like:

router.Params{
  "person_id": "123",
  "pet_type": "cats",
}

type Project

type Project struct {
	Description string `json:"description"`
	ID          uint64 `json:"id"`
	Name        string `json:"name"`
	Public      bool   `json:"public"`
}

Directories

Path Synopsis
internalfakes
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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