package httpio
import "go-hep.org/x/hep/groot/internal/httpio"
Package httpio provides types for basic I/O interfaces over HTTP.
Index ¶
- type Option
- func WithBasicAuth(usr, pwd string) Option
- func WithClient(cli *http.Client) Option
- func WithContext(ctx context.Context) Option
- type Reader
- func Open(uri string, opts ...Option) (r *Reader, err error)
- func (r *Reader) Close() error
- func (r *Reader) Name() string
- func (r *Reader) Read(p []byte) (int, error)
- func (r *Reader) ReadAt(p []byte, off int64) (int, error)
- func (r *Reader) Seek(offset int64, whence int) (int64, error)
- func (r *Reader) Size() int64
Types ¶
type Option ¶
type Option func(*config) error
func WithBasicAuth ¶
WithBasicAuth sets up a basic authentification scheme.
func WithClient ¶
WithClient sets up Reader to use a user-provided HTTP client.
By default, Reader uses an httpio-local default client.
func WithContext ¶
WithContext configures Reader to use a user-provided context.
By default, Reader uses context.Background.
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader presents an HTTP resource as an io.Reader and io.ReaderAt.
func Open ¶
Open returns a Reader from the provided URL.
func (*Reader) Close ¶
Close implements the io.Closer interface.
func (*Reader) Name ¶
Name returns the name of the file as presented to Open.
func (*Reader) Read ¶
Read implements the io.Reader interface.
func (*Reader) ReadAt ¶
ReadAt implements the io.ReaderAt interface.
func (*Reader) Seek ¶
Seek implements the io.Seeker interface.
func (*Reader) Size ¶
Size returns the number of bytes available for reading via ReadAt.
Source Files ¶
httpio.go reader.go
- Version
- v0.36.0 (latest)
- Published
- Nov 15, 2024
- Platform
- linux/amd64
- Imports
- 8 packages
- Last checked
- 2 days ago –
Tools for package owners.