datasource

package
Version: v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2021 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.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL