httpreader

package
v0.0.30 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package provides a io.Reader implementation on top of http

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheBlock

type CacheBlock struct {
	// contains filtered or unexported fields
}

CacheBlock is used to keep track of cached data

type Conf added in v0.0.3

type Conf struct {
	// Token is the token we present for authentication
	Token string
	// Client is used to pass in the http.Client to use
	Client *http.Client
	// Headers is used to pass in
	Headers *http.Header
	// MaxRetries is the number to retries a transfer that doesn't work
	MaxRetries int

	// ChunkSize decides how much data (in bytes) sdafs will ask to have read
	// in a single operation
	ChunkSize uint64

	// CacheSize decides how much memory (in bytes) may be used for caching
	CacheSize uint64

	// CacheMaxTTL decides the maximum lifetime of entries in cache
	CacheMaxTTL time.Duration
}

Conf is the struct passed in to configure the httpreader as such

type HTTPReader

type HTTPReader struct {
	// contains filtered or unexported fields
}

HTTPReader is the vehicle to keep track of needed state for the reader

func NewHTTPReader

func NewHTTPReader(conf *Conf, request *Request,
) (*HTTPReader, error)

NewHTTPReader allocates a unique id and returns a HTTPReader from the configuration struct (expected to be common) and the request

func (*HTTPReader) Close

func (r *HTTPReader) Close() (err error)

Close is a no-op

func (*HTTPReader) Read

func (r *HTTPReader) Read(dst []byte) (n int, err error)

func (*HTTPReader) Seek

func (r *HTTPReader) Seek(offset int64, whence int) (int64, error)

type Request added in v0.0.3

type Request struct {
	FileURL    string
	ObjectSize uint64
}

Request carries information about a data request

Jump to

Keyboard shortcuts

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