fetch

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFetcher

func NewFetcher(funcs Funcs) *fetcher

Types

type Cache

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

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      interface{}
}

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, interface{}, 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