stream

package
v1.16.2 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUnknownScheme is returned when an unknown scheme is encountered in a URL.
	ErrUnknownScheme = errors.New("unknown scheme")
)

Functions

func Open

func Open(url string) (io.ReadCloser, error)

Open opens a resource identified by the given URL. It supports different schemes by utilizing registered open functions. If the URL has no scheme, it is treated as a file path.

func Register

func Register(scheme string, open OpenFunc)

Register registers a scheme with an open function.

Types

type OpenFunc

type OpenFunc = func(url string) (io.ReadCloser, error)

OpenFunc defines the function type for opening a resource by URL.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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