types

package
v0.11.7 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Copyright © 2020-2022 Morten Hersson

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Color

type Color struct {
	Red     string
	Green   string
	Yellow  string
	Blue    string
	Magenta string
	Cyan    string
	Bold    string
	Ul      string
	Nocolor string
}

Color type.

type Comment

type Comment struct {
	ID     string `json:"id"`
	Author struct {
		Name        string `json:"name"`
		DisplayName string `json:"displayName"`
	} `json:"author"`
	Body       string `json:"body"`
	Created    string `json:"created"`
	Visibility struct {
		Value string `json:"value"`
	} `json:"visibility"`
}

type Config

type Config struct {
	JiraURL             string            `yaml:"JiraURL"` //nolint:tagliatelle
	Username            string            `yaml:"username"`
	Password            string            `yaml:"password"`
	PasswordType        string            `yaml:"passwordtype"`
	UseTimesheetPlugin  bool              `yaml:"useTimesheetPlugin"`
	CheckForUpdates     bool              `yaml:"checkForUpdates"`
	NumWorkingDays      int               `yaml:"numberOfWorkingDays"`
	WorkingHoursPerDay  float64           `yaml:"numberOfWorkingHoursPerDay"`
	WorkingHoursPerWeek float64           `yaml:"numberOfWorkingHoursPerWeek"`
	CountryCode         string            `yaml:"countryCode"`
	Aliases             map[string]string `yaml:"aliases,omitempty"`
	SprintFilter        string            `yaml:"sprintFilter"`
}

var cfgFile string.

type Error

type Error struct {
	Message string
}

func (*Error) Error

func (e *Error) Error() string

type Issue

type Issue struct {
	ID     string `json:"id"`
	Key    string `json:"key"`
	Fields struct {
		Summary   string `json:"summary"`
		IssueType struct {
			ID   string `json:"id"`
			Name string `json:"name"`
		} `json:"issuetype"`
		Assignee struct {
			DisplayName string `json:"displayName"`
		} `json:"assignee"`
		Priority struct {
			Name string `json:"name"`
		} `json:"priority"`
		Updated string `json:"updated"`
		Status  struct {
			Name string `json:"name"`
		} `json:"status"`
	} `json:"fields"`
}

type IssueCreateMeta

type IssueCreateMeta struct {
	Projects []Project `json:"projects"`
}

type IssueDescription

type IssueDescription struct {
	ID     string `json:"id"`
	Key    string `json:"key"`
	Fields struct {
		FixVersions []struct {
			Name string `json:"name"`
		} `json:"fixVersions"`
		Summary    string `json:"summary"`
		Epic       string `json:"customfield_10500"` //nolint:tagliatelle
		Resolution struct {
			Name string `json:"name"`
		} `json:"resolution"`
		Priority struct {
			Name string `json:"name"`
		} `json:"priority"`
		Labels     []string `json:"labels"`
		IssueLinks []struct {
			Type struct {
				Name    string `json:"name"`
				Inward  string `json:"inward"`
				Outward string `json:"outward"`
			}
			OutwardIssue struct {
				Key    string `json:"key"`
				Fields struct {
					Summary string `json:"summary"`
					Status  struct {
						Name string `json:"name"`
					} `json:"status"`
					Priority struct {
						Name string `json:"name"`
					} `json:"priority"`
					IssueType struct {
						Name string `json:"name"`
					} `json:"issueType"`
				} `json:"fields"`
			} `json:"outwardIssue"`
			InwardIssue struct {
				Key    string `json:"key"`
				Fields struct {
					Summary string `json:"summary"`
					Status  struct {
						Name string `json:"name"`
					} `json:"status"`
					Priority struct {
						Name string `json:"name"`
					} `json:"priority"`
					IssueType struct {
						Name string `json:"name"`
					} `json:"issueType"`
				} `json:"fields"`
			} `json:"inwardIssue"`
		} `json:"issuelinks"`
		Assignee struct {
			Name        string `json:"name"`
			DisplayName string `json:"displayName"`
		} `json:"assignee"`
		Status struct {
			Name string `json:"name"`
		} `json:"status"`
		Reporter struct {
			Name        string `json:"name"`
			DisplayName string `json:"displayName"`
		} `json:"reporter"`
		Worklog struct {
			Worklogs []Worklog `json:"worklogs"`
		} `json:"worklog"`
		IssueType struct {
			Name string `json:"name"`
		} `json:"issueType"`
		Project struct {
			Name string `json:"name"`
		} `json:"project"`
		ChangeVisibility struct {
			Value string `json:"value"`
		} `json:"customfield_10707"` //nolint:tagliatelle
		Created      string `json:"created"`
		Updated      string `json:"updated"`
		Description  string `json:"description"`
		TimeTracking struct {
			Estimate  string `json:"originalEstimate"`
			Remaining string `json:"remainingEstimate"`
			TimeSpent string `json:"timeSpent"`
		} `json:"timetracking"`
		Comment struct {
			Comments []Comment `json:"comments"`
		} `json:"comment"`
	} `json:"fields"`
}

type IssueType

type IssueType struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

type JiraConfig

type JiraConfig struct {
	Server       string
	Username     string
	Password     string
	PasswordType string
	Decrypted    bool
}

func (*JiraConfig) DecryptPassword

func (c *JiraConfig) DecryptPassword()

type Priority

type Priority struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

type Project

type Project struct {
	ID         string      `json:"id"`
	Key        string      `json:"key"`
	Name       string      `json:"name"`
	IssueTypes []IssueType `json:"issuetypes"`
}

type PublicHoliday

type PublicHoliday struct {
	Date        string `json:"date"`
	Name        string `json:"name"`
	CountryCode string `json:"countryCode"`
}

type RapidView

type RapidView struct {
	ID                   int    `json:"id"`
	Name                 string `json:"name"`
	SprintSupportEnabled bool   `json:"sprintSupportEnabled"`
}

type SimplifiedTimesheet

type SimplifiedTimesheet struct {
	ID        int
	Date      string
	StartDate string
	Key       string
	Summary   string
	Comment   string
	TimeSpent int
}

Used by worklog command to be able to sort and edit worklogs.

type Sprint

type Sprint struct {
	ID        int    `json:"id"`
	Name      string `json:"name"`
	State     string `json:"state"`
	IssuesIDs []int  `json:"issuesIds"`
}

func (*Sprint) MatchesFilter

func (s *Sprint) MatchesFilter(filter string) bool

type SprintContent

type SprintContent struct {
	CompletedIssues                   []SprintIssue `json:"completedIssues"`
	IssuesNotCompletedInCurrentSprint []SprintIssue `json:"issuesNotCompletedInCurrentSprint"`
	IssuesCompletedInAnotherSprint    []SprintIssue `json:"issuesCompletedInAnotherSprint"`
}

type SprintIssue

type SprintIssue struct {
	ID                int      `json:"id"`
	Key               string   `json:"key"`
	TypeID            string   `json:"typeId"`
	Summary           string   `json:"summary"`
	PriorityID        string   `json:"priorityId"`
	Assignee          string   `json:"assignee"`
	AssigneeName      string   `json:"assigneeName"`
	Epic              string   `json:"epic"`
	EstimateStatistic TimeStat `json:"estimateStatistic"`
	TrackingStatistic TimeStat `json:"trackingStatistic"`
	Hidden            bool     `json:"hidden"`
	Done              bool     `json:"done"`
}

type TimeSpentUserIssue

type TimeSpentUserIssue struct {
	ID               string
	Key              string
	Date             string
	User             string
	Summary          string
	TimeSpent        string
	TimeSpentSeconds int
}

Struct for representing the time a user has spent on an issue on a given date.

type TimeStat

type TimeStat struct {
	StatFieldID    string `json:"statFieldId"`
	StatFieldValue struct {
		Value float64 `json:"value"`
		Text  string  `json:"text"`
	} `json:"statFieldValue"`
}

type Timesheet

type Timesheet struct {
	Key     string `json:"key"`
	Summary string `json:"summary"`
	Entries []struct {
		ID             int    `json:"id"`
		Author         string `json:"author"`
		AuthorFullName string `json:"authorFullName"`
		StartDate      int    `json:"startDate"`
		TimeSpent      int    `json:"timeSpent"`
		Comment        string `json:"comment"`
	}
}

Used by getmyworklog command when timesheet plugin is enabled.

type Transition

type Transition struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	To   struct {
		Description    string `json:"description"`
		Name           string `json:"name"`
		ID             string `json:"id"`
		StatusCategory struct {
			ID   int    `json:"id"`
			Name string `json:"name"`
		} `json:"statusCategory"`
	} `json:"to"`
}

type Week

type Week struct {
	StartDate      time.Time
	EndDate        time.Time
	PublicHolidays int
	Worklogs       []SimplifiedTimesheet
}

func (*Week) Average

func (w *Week) Average() float64

func (*Week) Number

func (w *Week) Number() int

func (*Week) TotalTime

func (w *Week) TotalTime() float64

func (*Week) WorkDays

func (w *Week) WorkDays() int

type Worklog

type Worklog struct {
	Author struct {
		DisplayName string `json:"displayName"`
		Name        string `json:"name"`
	} `json:"author"`
	Comment          string `json:"comment"`
	Created          string `json:"created"`
	Started          string `json:"started"`
	TimeSpent        string `json:"timeSpent"`
	TimeSpentSeconds int    `json:"timeSpentSeconds"`
}

Jump to

Keyboard shortcuts

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