writer

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2021 License: BSD-3-Clause Imports: 11 Imported by: 2

Documentation

Overview

package writer defines a common interface for recording geotag.GeotagFeature instances.

Index

Constants

View Source
const IOWRITER_TARGET_KEY string = "github.com/sfomuseum/go-geojson-geotag#io_writer"

Variables

This section is empty.

Functions

func GetIOWriterFromContext added in v0.0.12

func GetIOWriterFromContext(ctx context.Context) (io.Writer, error)

func RegisterWriter

func RegisterWriter(ctx context.Context, scheme string, f WriterInitializeFunc) error

func SetIOWriterWithContext added in v0.0.12

func SetIOWriterWithContext(ctx context.Context, wr io.Writer) (context.Context, error)

Types

type IOWriter added in v0.0.12

type IOWriter struct {
	Writer
}

func (*IOWriter) Close added in v0.0.16

func (wr *IOWriter) Close(ctx context.Context) error

func (*IOWriter) WriteFeature added in v0.0.12

func (wr *IOWriter) WriteFeature(ctx context.Context, uri string, f *geotag.GeotagFeature) error

type MultiWriter added in v0.0.21

type MultiWriter struct {
	Writer
	// contains filtered or unexported fields
}

Type MultiWriter holds mutltiple Writer instances.

func (*MultiWriter) Close added in v0.0.21

func (mw *MultiWriter) Close(ctx context.Context) error

func (*MultiWriter) WriteFeature added in v0.0.21

func (mw *MultiWriter) WriteFeature(ctx context.Context, key string, f *geotag.GeotagFeature) error

type StdoutWriter

type StdoutWriter struct {
	Writer
}

func (*StdoutWriter) Close added in v0.0.16

func (wr *StdoutWriter) Close(ctx context.Context) error

func (*StdoutWriter) WriteFeature

func (wr *StdoutWriter) WriteFeature(ctx context.Context, uri string, f *geotag.GeotagFeature) error

type Writer

type Writer interface {
	WriteFeature(context.Context, string, *geotag.GeotagFeature) error
	Close(context.Context) error
}

func NewIOWriter added in v0.0.12

func NewIOWriter(ctx context.Context, uri string) (Writer, error)

func NewMultiWriter added in v0.0.21

func NewMultiWriter(writers ...Writer) Writer

NewMultiWriter returns a Writer instance that will send all writes to each instance in 'writers'. Writes happen synchronolously in the order in which the underlying Writer instances are specified.

func NewStdoutWriter

func NewStdoutWriter(ctx context.Context, uri string) (Writer, error)

func NewWriter

func NewWriter(ctx context.Context, uri string) (Writer, error)

type WriterInitializeFunc

type WriterInitializeFunc func(ctx context.Context, uri string) (Writer, error)

Jump to

Keyboard shortcuts

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