Documentation
¶
Overview ¶
Package shared holds what the work-item commands have in common: the --json field contract, work item type resolution and work dates.
Index ¶
- Constants
- Variables
- func IssueProject(ctx context.Context, c *transport.Client, host hosts.Host, issueID string) (adapter.IssueProject, error)
- func ItemOnIssue(ctx context.Context, c *transport.Client, host hosts.Host, ...) (adapter.WorkItem, error)
- func NotFound(err error, issueID, itemID string, host hosts.Host) error
- func ParseItemID(arg string) (string, error)
- func ResolveType(ctx context.Context, c *transport.Client, p adapter.IssueProject, name string) (string, error)
- func WorkDate(f *cmdutil.Factory, raw string) (time.Time, error)
- type WorkItem
Constants ¶
const DateHelp = `` /* 205-byte string literal not displayed */
DateHelp explains --date for command help.
const FieldsHelp = `` /* 318-byte string literal not displayed */
FieldsHelp documents Fields for command help.
Variables ¶
var Fields = []string{"id", "date", "duration", "author", "type", "text", "issue", "url"}
Fields are the --json fields of a work item.
Functions ¶
func IssueProject ¶
func IssueProject(ctx context.Context, c *transport.Client, host hosts.Host, issueID string) (adapter.IssueProject, error)
IssueProject reads the named issue's readable ID and project.
func ItemOnIssue ¶
func ItemOnIssue(ctx context.Context, c *transport.Client, host hosts.Host, issue adapter.IssueProject, named, itemID string) (adapter.WorkItem, error)
ItemOnIssue reads a work item and checks that it belongs to issue, the issue named on the command line as YouTrack resolved it (so a database ID or an old project alias still matches). Work item IDs are global, so edit and delete must not trust the issue in the URL to scope them.
func ParseItemID ¶
ParseItemID checks a work item ID argument.
Types ¶
type WorkItem ¶
WorkItem exports an adapter.WorkItem under the --json field names.
func New ¶
New wraps item, falling back to issueID when YouTrack did not say which issue it belongs to.
func (WorkItem) Presentation ¶
Presentation is YouTrack's rendering of the duration, or ytrack's own when YouTrack sent none.