Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListTimelogs ¶
func ListTimelogs(ctx context.Context, client *gitlab.Client, opts ListOptions) iter.Seq2[Timelog, error]
ListTimelogs yields every timelog matching opts, newest first, fetching further pages as the caller ranges over it.
GitLab drops timelogs the user cannot see from a page, but not from the page count, so a page can be empty and still have a next page.
Types ¶
type Issuable ¶
type Issuable struct {
IID string `json:"iid"`
Title string `json:"title"`
WebURL string `json:"webUrl"`
}
Issuable is the issue or merge request a timelog was logged on.
type ListOptions ¶
type ListOptions struct {
Group string
Project string
StartDate time.Time
EndDate time.Time
Username string
}
ListOptions selects the timelogs to list. Set exactly one of Group and Project. Zero dates and an empty Username leave that filter off.
type Namespace ¶
type Namespace struct {
Timelogs *TimelogConnection `json:"timelogs"`
}
type Timelog ¶
type Timelog struct {
SpentAt time.Time `json:"spentAt"`
TimeSpent int64 `json:"timeSpent"`
Summary string `json:"summary"`
User User `json:"user"`
Project Project `json:"project"`
Issue *Issuable `json:"issue"`
MergeRequest *Issuable `json:"mergeRequest"`
}
Timelog is one entry of time logged on an issue or a merge request. TimeSpent is in seconds, and is negative for time that was subtracted.
type TimelogConnection ¶
type TimelogsResponse ¶
type TimelogsResponse struct {
Data struct {
Group *Namespace `json:"group"`
Project *Namespace `json:"project"`
} `json:"data"`
Errors []struct {
Message string `json:"message"`
} `json:"errors"`
}
TimelogsResponse is the GraphQL response for one page of timelogs. Argument errors arrive in Errors with an HTTP 200, so GraphQL.Do does not report them.