Documentation ¶
Index ¶
- func AddedAndRemovedAddAll[T any](items []T, filters ...func(T) bool) (map[string]time.Time, []string, error)
- func AddedAndRemovedByAddtlData[T any](items []T, filters ...func(T) bool) (map[string]time.Time, []string, error)
- func AddedAndRemovedByDeletedDateTime[T any](items []T, filters ...func(T) bool) (map[string]time.Time, []string, error)
- func BatchEnumerateItems[T any](ctx context.Context, pager NonDeltaHandler[T]) ([]T, error)
- func DeltaEnumerateItems[T any](ctx context.Context, pager DeltaHandler[T], npr *nextPageResults[T], ...)
- func EnumerateItems[T any](ctx context.Context, pager NonDeltaHandler[T], npr *nextPageResults[T])
- func FilterIncludeAll[T any](_ T) bool
- func IsNextLinkValid(next string) bool
- func NewNextPageResults[T any]() *nextPageResults[T]
- func NextAndDeltaLink(pl DeltaLinker) (string, string)
- func NextLink(pl NextLinker) string
- type AddedAndRemoved
- type DeltaHandler
- type DeltaLinkValuer
- type DeltaLinker
- type DeltaUpdate
- type GetPager
- type NextLinkValuer
- type NextLinker
- type NextPageResulter
- type NextPager
- type NonDeltaHandler
- type Resetter
- type SetNextLinker
- type ValidModTimer
- type Valuer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddedAndRemovedAddAll ¶
func AddedAndRemovedAddAll[T any]( items []T, filters ...func(T) bool, ) (map[string]time.Time, []string, error)
AddedAndRemovedAddAll indiscriminately adds every item to the added list, deleting nothing.
func BatchEnumerateItems ¶
func BatchEnumerateItems[T any]( ctx context.Context, pager NonDeltaHandler[T], ) ([]T, error)
func DeltaEnumerateItems ¶
func DeltaEnumerateItems[T any]( ctx context.Context, pager DeltaHandler[T], npr *nextPageResults[T], prevDeltaLink string, )
enumerates pages of items, streaming each page to the provided channel. the DeltaUpdate, reset notifications, and any errors are also fed to the same channel.
func EnumerateItems ¶
func EnumerateItems[T any]( ctx context.Context, pager NonDeltaHandler[T], npr *nextPageResults[T], )
func FilterIncludeAll ¶
func IsNextLinkValid ¶
IsNextLinkValid separate check to investigate whether error is
func NewNextPageResults ¶
func NewNextPageResults[T any]() *nextPageResults[T]
func NextAndDeltaLink ¶
func NextAndDeltaLink(pl DeltaLinker) (string, string)
func NextLink ¶
func NextLink(pl NextLinker) string
Types ¶
type AddedAndRemoved ¶
type AddedAndRemoved struct { Added map[string]time.Time Removed []string DU DeltaUpdate ValidModTimes bool }
func GetAddedAndRemovedItemIDs ¶
func GetAddedAndRemovedItemIDs[T any]( ctx context.Context, pager NonDeltaHandler[T], deltaPager DeltaHandler[T], prevDeltaLink string, canMakeDeltaQueries bool, itemLimit int, aarh addedAndRemovedHandler[T], filters ...func(T) bool, ) (AddedAndRemoved, error)
GetAddedAndRemovedItemIDs returns the set of item IDs that were added or removed from this resource since the last delta query. If no delta query is passed in then returns all items found, not just changed/removed ones.
Use itemLimit to stop enumeration partway through and filters to pick which items should be returned.
type DeltaHandler ¶
type DeltaHandler[T any] interface { GetPager[DeltaLinkValuer[T]] Resetter SetNextLinker ValidModTimer }
type DeltaLinkValuer ¶
type DeltaLinkValuer[T any] interface { DeltaLinker Valuer[T] }
type DeltaLinker ¶
type DeltaLinker interface { NextLinker GetOdataDeltaLink() *string }
type DeltaUpdate ¶
type DeltaUpdate struct { // the deltaLink itself URL string // true if the old delta was marked as invalid Reset bool }
DeltaUpdate holds the results of a current delta token. It normally gets produced when aggregating the addition and removal of items in a delta-queryable folder.
type NextLinkValuer ¶
type NextLinkValuer[T any] interface { NextLinker Valuer[T] }
type NextLinker ¶
type NextLinker interface {
GetOdataNextLink() *string
}
type NextPageResulter ¶
type NextPageResulter[T any] interface { NextPager[T] Cancel() Results() (DeltaUpdate, error) }
type NextPager ¶
type NextPager[T any] interface { // reset should only true on the iteration where the delta pager's Reset() // is called. Callers can use it to reset any data aggregation they // currently use. After that loop it can be false again, though the // DeltaUpdate will eventually contain the expected reset value. // Items may or may not be >0 when reset == true. In that case, the // items should always represent the next page of data following a reset. // Callers should always handle the reset first, and follow-up with // item population. NextPage() (items []T, reset, done bool) }
type NonDeltaHandler ¶
type NonDeltaHandler[T any] interface { GetPager[NextLinkValuer[T]] SetNextLinker ValidModTimer }
type SetNextLinker ¶
type SetNextLinker interface {
SetNextLink(nextLink string)
}
type ValidModTimer ¶
type ValidModTimer interface {
ValidModTimes() bool
}