api

package
v1.129.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: MIT Imports: 6 Imported by: 0

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 PageInfo

type PageInfo struct {
	EndCursor   string `json:"endCursor"`
	HasNextPage bool   `json:"hasNextPage"`
}

type Project

type Project struct {
	FullPath string `json:"fullPath"`
}

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 TimelogConnection struct {
	Nodes    []Timelog `json:"nodes"`
	PageInfo PageInfo  `json:"pageInfo"`
}

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.

type User

type User struct {
	Username string `json:"username"`
}

Jump to

Keyboard shortcuts

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