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