filereader

package
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileReader

type FileReader interface {
	ReadFile(ctx context.Context) (data []byte, err error)
	Filename() string
}

type HTTPFileReader

type HTTPFileReader struct {
	// URL is the URL of the file to read
	URL string
	// contains filtered or unexported fields
}

func NewHTTPFileReader

func NewHTTPFileReader(url string, client *http.Client) *HTTPFileReader

func (*HTTPFileReader) Filename

func (r *HTTPFileReader) Filename() string

func (*HTTPFileReader) ReadFile

func (r *HTTPFileReader) ReadFile(ctx context.Context) (data []byte, err error)

type LocalFileReader

type LocalFileReader struct {
	// contains filtered or unexported fields
}

func NewLocalFileReader

func NewLocalFileReader(path string) *LocalFileReader

func (*LocalFileReader) Filename

func (l *LocalFileReader) Filename() string

func (*LocalFileReader) ReadFile

func (l *LocalFileReader) ReadFile(_ context.Context) ([]byte, error)

Jump to

Keyboard shortcuts

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