Back to godoc.org

Package datasource

v0.0.15
Latest Go to latest

The latest major version is .

Published: Jul 31, 2020 | License: BSD-3-Clause | Module: go.chromium.org/goma/server

Overview

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

Index

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.

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.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier