server: Index | Files

package datasource

import ""

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


Package Files


func ReadAll Uses

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

ReadAll reads all data from source.

func ReadProto Uses

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

ReadProto reads data as proto message.

type Source Uses

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

Source accesses data source.

func Bytes Uses

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

Bytes create new source for bytes.

func LocalFile Uses

func LocalFile(fullpath string) Source

LocalFile creates new source for the local file.

Package datasource imports 7 packages (graph) and is imported by 3 packages. Updated 2020-10-27. Refresh now. Tools for package owners.