Latest Threat ResearchGlassWorm Loader Hits Open VSX via Developer Account Compromise.Details
Socket
Book a DemoInstallSign in
Socket

vimagination.zapto.org/httpreaderat

Package Overview
Dependencies
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vimagination.zapto.org/httpreaderat

Go Modules
Version
v1.0.2
Version published
Created
Source

httpreaderat

CI Go Reference Go Report Card

-- import "vimagination.zapto.org/httpreaderat"

Package httpreaderat allows opening a URL as a io.ReaderAt.

Highlights

  • Simple library to allow random-reading from Range capable HTTP servers.
  • Customisable block-based caching for better performance.

Usage

package main

import (
	"embed"
	"fmt"
	"net/http"
	"net/http/httptest"

	"vimagination.zapto.org/httpreaderat"
)

//go:embed example_test.go
var f embed.FS

func main() {
	srv := httptest.NewServer(http.FileServerFS(f))

	r, err := httpreaderat.NewRequest(srv.URL + "/example_test.go")
	if err != nil {
		fmt.Println(err)

		return
	}

	buf := make([]byte, 17)

	n, err := r.ReadAt(buf, 8)
	fmt.Printf("Bytes: %d\nErr: %v\nRead: %s", n, err, buf)

	// Output:
	// Bytes: 17
	// Err: <nil>
	// Read: httpreaderat_test
}

Documentation

Full API docs can be found at:

https://pkg.go.dev/vimagination.zapto.org/httpreaderat

FAQs

Package last updated on 24 Jan 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts