reader

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2019 License: BSD-3-Clause Imports: 11 Imported by: 81

README

go-reader

Work in progress. This will replace go-whosonfirst-readwrite.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Readers

func Readers() []string

func Register

func Register(name string, reader Reader)

Types

type Driver

type Driver interface {
	Open(string) error
}

type FileReader

type FileReader struct {
	Reader
	// contains filtered or unexported fields
}

func (*FileReader) Open

func (r *FileReader) Open(ctx context.Context, uri string) error

func (*FileReader) Read

func (r *FileReader) Read(ctx context.Context, path string) (io.ReadCloser, error)

func (*FileReader) URI

func (r *FileReader) URI(path string) string

type NullReader

type NullReader struct {
	Reader
}

func (*NullReader) Open

func (r *NullReader) Open(ctx context.Context, uri string) error

func (*NullReader) Read

func (r *NullReader) Read(ctx context.Context, uri string) (io.ReadCloser, error)

func (*NullReader) URI

func (r *NullReader) URI(uri string) string

type Reader

type Reader interface {
	Open(context.Context, string) error
	Read(context.Context, string) (io.ReadCloser, error)
	URI(string) string
}

func NewFileReader

func NewFileReader() Reader

func NewNullReader

func NewNullReader() Reader

func NewReader

func NewReader(ctx context.Context, uri string) (Reader, error)

Directories

Path Synopsis
cmd
wof-reader command

Jump to

Keyboard shortcuts

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