loader

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package loader has a data loading interface and various implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFileLoader

func NewFileLoader(fSys fs.FileSystem) *fileLoader

NewFileLoader returns a new fileLoader.

Types

type Loader

type Loader interface {
	// Root returns the root location for this Loader.
	Root() string
	// New returns Loader located at newRoot.
	New(newRoot string) (Loader, error)
	// Load returns the bytes read from the location or an error.
	Load(location string) ([]byte, error)
	// Cleanup cleans the loader
	Cleanup() error
}

Loader interface exposes methods to read bytes.

func NewLoader added in v1.0.5

func NewLoader(target, r string, fSys fs.FileSystem) (Loader, error)

NewLoader returns a Loader given a target The target can be a local disk directory or a github Url

Jump to

Keyboard shortcuts

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