entities

package
v0.0.0-...-2c7e429 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnauthorized       = jsonrpc2.NewError(1, "INVALID_TOKEN")
	ErrMaintenance        = jsonrpc2.NewError(4, "MAINTENANCE")
	ErrServerUnavailable  = jsonrpc2.NewError(5, "REMOTE_SERVER_UNAVAILABLE")
	ErrNotFound           = jsonrpc2.NewError(404, "NOT_FOUND")
	ErrInvalidRequest     = jsonrpc2.NewError(101, "TRACKER_VALIDATION_ERROR")
	ErrInvalidCredentials = jsonrpc2.NewError(102, "INVALID_CREDENTIALS")
	ErrInvalidTrackerURL  = jsonrpc2.NewError(104, "INVALID_TRACKER_URL")
	ErrProjectNotFound    = jsonrpc2.NewError(106, "PROJECT_NOT_FOUND")
	ErrIssueNotFound      = jsonrpc2.NewError(107, "ISSUE_NOT_FOUND")
)

Service specific API errors

Functions

func NewErrorLogger

func NewErrorLogger(l *narada.Log, ctx context.Context, msg string) func(error) error

NewErrorLogger creates a curries version of NewLoggedError with context and message set

func NewLoggedError

func NewLoggedError(l *narada.Log, ctx context.Context, err error, msg interface{}) error

NewLoggedError logs the error and replaces it with an API error

func NewServerError

func NewServerError(msg string) error

NewServerError creates new JSON RPC error with given message

Types

type Duration

type Duration uint64

Duration - time duration in seconds

type EntityID

type EntityID uint64

EntityID - generic entity ID type

type Issue

type Issue struct {
	ID       IssueID
	Type     NamedID
	URL      string
	Title    string
	Estimate Duration
	DueDate  Timestamp
	Spent    Duration
	Done     uint8
}

Issue - TG issue

type IssueID

type IssueID uint64

IssueID - issue ID

type NamedID

type NamedID struct {
	ID   uint64
	Name string
}

NamedID - id + name entity structure

type NewIssue

type NewIssue struct {
	ProjectID ProjectID
	Assignee  UserID
	Type      EntityID
	Title     string
	Estimate  uint64
}

NewIssue - set of parameters for new issue

type Project

type Project struct {
	ID            ProjectID
	Title         string
	Description   string
	IssueTypes    []NamedID
	ActivityTypes []NamedID
}

Project - TG project entity

type ProjectID

type ProjectID uint64

ProjectID - project ID

type Report

type Report struct {
	IssueID  IssueID
	Started  Timestamp
	Duration Duration
	Comments string
}

Report - set of parameters for new work time report

type ReportsTotal

type ReportsTotal uint64

ReportsTotal - total amount of reported time in seconds

type Timestamp

type Timestamp uint64

Timestamp - unix timestamp

type TrackerConfig

type TrackerConfig struct {
	ID          TrackerID
	URL         string
	Credentials TrackerCredentials
}

TrackerConfig - TG tracker configuration

type TrackerCredentials

type TrackerCredentials struct {
	Login    string
	Password string
}

TrackerCredentials - TG tracker credentials

type TrackerID

type TrackerID uint64

TrackerID - tracker id

type User

type User struct {
	ID   UserID
	Name string
	Mail string
}

User - TG user

type UserID

type UserID uint64

UserID - user ID

type UserKey

type UserKey string

UserKey - JIRA user indetifier string

Jump to

Keyboard shortcuts

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