api

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvUsername    = "TP_USERNAME"
	EnvPassword    = "TP_PASSWORD"
	EnvToken       = "TP_TOKEN"
	EnvAccessToken = "TP_ACCESS_TOKEN"
	EnvAddress     = "TP_API_URL"
)

Variables

This section is empty.

Functions

func AddComment

func AddComment(comment *Comment) error

func AddTask

func AddTask(task *Task) error

func FindId

func FindId(text string) (int, error)

Types

type Client

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

func NewClient

func NewClient(c *Config) (*Client, error)

func (*Client) NewRequest

func (c *Client) NewRequest(method, requestPath, payload string) (string, error)

type Comment

type Comment struct {
	Description string   `json:"description"`
	General     *General `json:"general"`
}

type Config

type Config struct {
	Address    string
	HttpClient *http.Client
	MaxRetries int
	Timeout    time.Duration
	Error      error
	Creds      *Credentials
	// contains filtered or unexported fields
}

func DefaultConfig

func DefaultConfig() *Config

func (*Config) ReadEnvironment

func (c *Config) ReadEnvironment() error

type Credentials

type Credentials struct {
	Username    string
	Password    string
	Token       string
	AccessToken string
}

type General

type General struct {
	Id int `json:"id"`
}

type Project

type Project struct {
	Id int `json:"id"`
}

type Projects

type Projects struct {
	ProjectId int `json:"projectId"`
}

type Response

type Response struct {
	Items []Projects `json:"items"`
}

type TPoptions

type TPoptions struct {
	Id      int    `json:"id"`
	Comment string `json:"comment,omitempty"`
	State   string `json:"state,omitempty"`
}

func ParseOptions

func ParseOptions(text string) (error, TPoptions)

type Task

type Task struct {
	Name        string    `json:"name"`
	Description string    `json:"description"`
	Tags        string    `json:"tags"`
	Project     Project   `json:"project"`
	Userstory   Userstory `json:"userstory"`
}

type Userstory

type Userstory struct {
	Id int `json:"id"`
}

Jump to

Keyboard shortcuts

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