redmine

package
v0.0.0-...-1dd25dd Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2021 License: MIT Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAndExtractIssueID

func CheckAndExtractIssueID(source string) (trimmed string, success bool)

CheckAndExtractIssueID check input source string and return check result and id string with trimmed # left symbol.

func WrongStatusCodeError

func WrongStatusCodeError(statusCode int, statusText string) error

Types

type Activities

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

type ActivitiesRoot

type ActivitiesRoot struct {
	TimeEntryActivities []*Activities `json:"time_entry_activities"`
}

type Client

type Client interface {
	FillHoursRequest(issueID string, hours string, comment string, activityID string) (*TimeEntryBodyResponse, error)
	Issue(issueID string) (*IssueContainer, error)
	AssignedIssues() ([]*Issue, error)
	Activities() ([]*Activities, error)
	TodayTimeEntries() ([]*TimeEntryResponse, error)
	AddComment(issueID string, comment string, assignedTo int) error
}

type ClientManager

type ClientManager struct {
	// contains filtered or unexported fields
}

func NewClientManager

func NewClientManager(networkClient HTTPClient, storage storage.Manager, chatID int64) *ClientManager

func (*ClientManager) Activities

func (r *ClientManager) Activities() ([]*Activities, error)

func (*ClientManager) AddComment

func (r *ClientManager) AddComment(issueID string, comment string, assignedTo int) error

func (*ClientManager) AssignedIssues

func (r *ClientManager) AssignedIssues() ([]*Issue, error)

func (*ClientManager) FillHoursRequest

func (r *ClientManager) FillHoursRequest(issueID string, hours string, comment string, activityID string) (*TimeEntryBodyResponse, error)

func (*ClientManager) Issue

func (r *ClientManager) Issue(issueID string) (*IssueContainer, error)

func (*ClientManager) TodayTimeEntries

func (r *ClientManager) TodayTimeEntries() ([]*TimeEntryResponse, error)

type ClientRequestMock

type ClientRequestMock struct {
	// contains filtered or unexported fields
}

func NewClientRequestMock

func NewClientRequestMock(statusCode int, mockError error, response string) *ClientRequestMock

func (*ClientRequestMock) Do

func (c *ClientRequestMock) Do(req *http.Request) (*http.Response, error)

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

type Issue

type Issue struct {
	AssignedTo struct {
		ID   int    `json:"id"`
		Name string `json:"name"`
	} `json:"assigned_to"`
	Author struct {
		ID   int    `json:"id"`
		Name string `json:"name"`
	} `json:"author"`
	CreatedOn   string `json:"created_on"`
	Description string `json:"description"`
	DoneRatio   int    `json:"done_ratio"`
	DueDate     string `json:"due_date"`
	ID          int    `json:"id"`
	Priority    struct {
		ID   int    `json:"id"`
		Name string `json:"name"`
	} `json:"priority"`
	Project struct {
		ID   int    `json:"id"`
		Name string `json:"name"`
	} `json:"project"`
	SpentHours float32 `json:"spent_hours"`
	Status     struct {
		ID   int    `json:"id"`
		Name string `json:"name"`
	} `json:"status"`
	Subject string `json:"subject"`
	Tracker struct {
		ID   int    `json:"id"`
		Name string `json:"name"`
	} `json:"tracker"`
	UpdatedOn string `json:"updated_on"`
}

type IssueContainer

type IssueContainer struct {
	Issue *Issue `json:"issue"`
}

type IssuesList

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

type TablePrinter

type TablePrinter struct {
}

func (TablePrinter) Print

func (t TablePrinter) Print(issue Issue, printDescription bool) []string

type TimeEntriesBodyResponse

type TimeEntriesBodyResponse struct {
	TimeEntries []*TimeEntryResponse `json:"time_entries"`
}

type TimeEntry

type TimeEntry struct {
	IssueID    string `json:"issue_id"`
	Hours      string `json:"hours"`
	Comments   string `json:"comments"`
	ActivityID string `json:"activity_id,omitempty"`
}

type TimeEntryBody

type TimeEntryBody struct {
	TimeEntry *TimeEntry `json:"time_entry"`
}

type TimeEntryBodyResponse

type TimeEntryBodyResponse struct {
	TimeEntry TimeEntryResponse `json:"time_entry"`
}

type TimeEntryResponse

type TimeEntryResponse struct {
	Activity  TimeEntryResponseActivity `json:"activity"`
	Comments  string                    `json:"comments"`
	CreatedOn string                    `json:"created_on"`
	Hours     float32                   `json:"hours"`
	ID        int                       `json:"id"`
	Issue     TimeEntryResponseIssue    `json:"issue"`
	Project   struct {
		ID   int    `json:"id"`
		Name string `json:"name"`
	} `json:"project"`
	SpentOn   string `json:"spent_on"`
	UpdatedOn string `json:"updated_on"`
	User      struct {
		ID   int    `json:"id"`
		Name string `json:"name"`
	} `json:"user"`
}

type TimeEntryResponseActivity

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

type TimeEntryResponseIssue

type TimeEntryResponseIssue struct {
	ID int `json:"id"`
}

Jump to

Keyboard shortcuts

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