gliter

package
v1.24.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package gliter implements iterators for GitLab objects.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func All

func All[T any, O any](ctx context.Context, getter func(opts *O, options ...gitlab.RequestOptionFunc) ([]T, *gitlab.Response, error), opts O, nextPage func(*O, int)) iter.Seq2[T, error]

All func iterates over all items fetched by the getter function, handling pagination automatically. It yields each item and stops when either an error occurs or the yield function returns false. The nextPage function is called with the current options and the next page number to continue pagination.

func AllWithID

func AllWithID[T any, O any](ctx context.Context, id any, getter func(id any, opts *O, options ...gitlab.RequestOptionFunc) ([]T, *gitlab.Response, error), opts O, nextPage func(*O, int)) iter.Seq2[T, error]

AllWithID is a wrapper for All that includes an ID in the getter function. It is useful for fetching items that are related to a specific ID, such as merge requests within a project or group.

func Limited

func Limited[T any](seq iter.Seq2[T, error], n int) iter.Seq2[T, error]

Limited is a utility function that limits the number of items yielded by a sequence. It stops yielding items after the specified number of items has been reached.

Types

This section is empty.

Jump to

Keyboard shortcuts

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