source

package
v0.0.0-...-34222d6 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Source

type Source interface {
	// CanonicalURI converts a source URI to its canonical form.  The result
	// should be byte-wise identical to all other canonicalized URIs which
	// refer to the same location.
	//
	// CanonicalURI is called with an absolute URI which doesn't contain
	// successive slashes.  It starts with the source name (e.g. "/foo/...").
	//
	// If the URI is know to be invalid, an error should be returned.
	CanonicalURI(uri string) (string, error)

	// OpenURI for reading an object.  The argument is a URI returned by
	// CanonicalizeURI.
	//
	// If the object's size exceeds maxSize, the object is not to be opened.
	// The reader is not necessarily drained, but it will be closed.  The
	// reader must produce exactly contentLength's worth of bytes when read in
	// full.
	//
	// Not-found condition can be signaled by returning nil content with zero
	// length.  Content-too-long condition can be signaled by returning nil
	// content with nonzero length (doesn't have to be actual content length).
	OpenURI(
		ctx Context,
		uri string,
		maxSize int,
	) (
		content io.ReadCloser,
		contentLength int64,
		err error,
	)
}

Source of immutable data.

Directories

Path Synopsis
Package http can download objects from HTTP server.
Package http can download objects from HTTP server.
Package ipfs can download objects via IPFS API server.
Package ipfs can download objects via IPFS API server.

Jump to

Keyboard shortcuts

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