api

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseLinkMaxID

func ParseLinkMaxID(linkHeader string) (*string, error)

ParseLinkMaxID extracts the `max_id` from the `next` link for paging to older items.

func ReadAllPaged

func ReadAllPaged[Requester PagedRequester[Response, Element], Response PagedResponse[Element], Element any](authClient *auth.Client, pagedRequester Requester) ([]Element, error)

Types

type PagedRequester

type PagedRequester[Response PagedResponse[Element], Element any] interface {
	Request(authClient *auth.Client, maxID *string) (Response, error)
}

type PagedResponse

type PagedResponse[Element any] interface {
	Link() string
	Elements() []Element
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳