stream

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package stream provides support to convert a URL into an io.ReadSeeker.

Streamers should be registered via RegisterStreamer() in order to use them with URLToStream()

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterStreamer

func RegisterStreamer(s Streamer)

RegisterStreamer adds the Streamer to the list of Streamer handlers used by URLToStream method

func URLToStream

func URLToStream(url string) (io.ReadSeeker, int64, string, error)

URLToStream converts a URL into an io.ReadSeeker returns: the io.ReadSeeker the length of the stream in bytes checksum of the file pointed to by path error if any

Types

type Streamer

type Streamer interface {
	// Returns true if this streamer can create a stream from the url
	CanStream(url string) bool
	// Opens a stream to the contents of url
	// Returns:
	// io.ReadSeeker - data at url
	// Length of the stream in bytes
	// checksum of the file pointed to by path
	// error if any
	CreateStream(url string) (io.ReadSeeker, int64, string, error)
}

Streamer is the interface implemented by an object that can create an io.ReadSeeker from a remote or local URL

Directories

Path Synopsis
Package local contains an implementation of streamer for the local file system
Package local contains an implementation of streamer for the local file system
Package s3 provides a streamer implementation for AWS S3.
Package s3 provides a streamer implementation for AWS S3.

Jump to

Keyboard shortcuts

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