datasource

package
v0.0.26 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2022 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package datasource provides data source from local file, bytes etc.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadAll

func ReadAll(ctx context.Context, src Source) ([]byte, error)

ReadAll reads all data from source.

func ReadProto

func ReadProto(ctx context.Context, src Source, m proto.Message) error

ReadProto reads data as proto message.

Types

type Source

type Source interface {
	Open(context.Context) (io.ReadCloser, error)
	String() string
}

Source accesses data source.

func Bytes

func Bytes(name string, b []byte) Source

Bytes create new source for bytes.

func LocalFile

func LocalFile(fullpath string) Source

LocalFile creates new source for the local file.

Jump to

Keyboard shortcuts

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