v0.0.0-...-d1ec73e Latest Latest

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

Go to latest
Published: Sep 8, 2022 License: MIT Imports: 13 Imported by: 0




This section is empty.


This section is empty.


func NewRedmineProvider

func NewRedmineProvider() *redmineImportProvider


type AccountResponse

type AccountResponse struct {
	User RedmineUser `json:"user"`

type CustomField

type CustomField struct {
	Id    int    `json:"id"`
	Name  string `json:"name"`
	Value string `json:"value"`

type Issue

type Issue struct {
	Id             int       `json:"id"`
	Project        NamedItem `json:"project"`
	Tracker        NamedItem `json:"tracker"`
	Status         NamedItem `json:"status"`
	Priority       NamedItem `json:"priority"`
	Author         NamedItem `json:"author"`
	AssignedTo     NamedItem `json:"assigned_to"`
	Category       NamedItem `json:"category"`
	Subject        string    `json:"subject"`
	Description    string    `json:"description"`
	StartDate      string    `json:"start_date"`
	DueDate        string    `json:"due_date"`
	DoneRatio      int       `json:"done_ratio"`
	IsPrivate      bool      `json:"is_private"`
	EstimatedHours float64   `json:"estimated_hours"`
	CreatedOn      time.Time `json:"created_on"`
	UpdatedOn      time.Time `json:"updated_on"`
	ClosedOn       string    `json:"closed_on"`

type IssueReference

type IssueReference struct {
	Id int `json:"id"`

type IssueResponse

type IssueResponse struct {
	Issues     []Issue `json:"issues"`
	TotalCount int     `json:"total_count"`
	Offset     int     `json:"offset"`
	Limit      int     `json:"limit"`

type NamedItem

type NamedItem struct {
	Id   int    `json:"id"`
	Name string `json:"name"`

type Redmine

type Redmine struct {
	Url           string
	Client        http.Client
	Authorization RedmineAuthorization
	RedmineUser   RedmineUser

func NewRedmineAPI

func NewRedmineAPI(baseURL string, authorization *RedmineAuthorization) (*Redmine, error)

func (*Redmine) CreateHTTPRequest

func (r *Redmine) CreateHTTPRequest(endpoint string, params url.Values, result any) error

func (*Redmine) GetAccountInformation

func (r *Redmine) GetAccountInformation() (*AccountResponse, error)

func (*Redmine) GetIssueDetails

func (r *Redmine) GetIssueDetails(limit int, page int, issueIds (*IssueResponse, error)

func (*Redmine) GetIssues

func (r *Redmine) GetIssues(limit int, page int) (*IssueResponse, error)

func (*Redmine) GetTimeEntries

func (r *Redmine) GetTimeEntries(limit int, page int, from time.Time, to time.Time) (*TimeEntriesResponse, error)

type RedmineAuthType

type RedmineAuthType int

type RedmineAuthorization

type RedmineAuthorization struct {
	RedmineUser     string
	RedminePassword string

func AuthorizeHTTP

func AuthorizeHTTP(username string, password string) *RedmineAuthorization

func (*RedmineAuthorization) BuildAuthorizationHeader

func (r *RedmineAuthorization) BuildAuthorizationHeader() string

type RedmineUser

type RedmineUser struct {
	Id        int       `json:"id"`
	UserName  string    `json:"login"`
	IsAdmin   bool      `json:"admin"`
	FirstName string    `json:"firstname"`
	LastName  string    `json:"lastname"`
	Mail      string    `json:"mail"`
	CreatedOn time.Time `json:"created_on"`
	LastLogin time.Time `json:"last_login_on"`
	ApiKey    string    `json:"api_key"`

type TimeEntriesResponse

type TimeEntriesResponse struct {
	TimeEntries []TimeEntry `json:"time_entries"`
	TotalCount  int         `json:"total_count"`
	Offset      int         `json:"offset"`
	Limit       int         `json:"limit"`

type TimeEntry

type TimeEntry struct {
	Id           int            `json:"id"`
	Project      NamedItem      `json:"project"`
	Issue        IssueReference `json:"issue"`
	User         NamedItem      `json:"user"`
	Activity     NamedItem      `json:"activity"`
	Hours        float64        `json:"hours"`
	Comments     string         `json:"comments"`
	SpentOn      string         `json:"spent_on"`
	CreatedOn    time.Time      `json:"created_on"`
	UpdatedOn    time.Time      `json:"updated_on"`
	CustomFields []CustomField  `json:"custom_fields"`

Jump to

Keyboard shortcuts

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