fetch

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsFetchingByType

func IsFetchingByType(c context.Context) (string, bool)

func NewFetcher

func NewFetcher(funcs Funcs) *fetcher

Types

type Cache

type Cache interface {
	Store(key string, val any)
	Get(key string, funcs ...func() (any, error)) (any, error)
	Reset()
}

type ContextKey

type ContextKey string

ContextKey is a typed key for context values to avoid SA1029.

const FetchModeKey ContextKey = "fetchmode"

FetchModeKey is the context key used to indicate fetch-by-type mode.

type Error

type Error []error

Not goroutine safe as for now

func WrapError

func WrapError(errs ...error) *Error

func (*Error) Add

func (fe *Error) Add(err error)

func (*Error) Any

func (fe *Error) Any() bool

func (*Error) Error

func (fe *Error) Error() string

type FetchResult

type FetchResult struct {
	ResourceType string
	Err          error
	Resources    []*graph.Resource
	Objects      any
}

type Fetcher

type Fetcher interface {
	Cache
	Fetch(context.Context) (*graph.Graph, error)
	FetchByType(context.Context, string) (*graph.Graph, error)
}

type Func

type Func func(context.Context, Cache) ([]*graph.Resource, any, error)

type Funcs

type Funcs map[string]Func

Jump to

Keyboard shortcuts

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