blob

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package blob stores raw messages as immutable files named by their SHA-256, so a message delivered to several mailboxes is kept once and a crash never leaves a half-written file behind.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store is a directory of content-addressed files.

func Open

func Open(dir string) (*Store, error)

Open uses dir, creating it when missing.

func (*Store) Get

func (s *Store) Get(hash string) ([]byte, error)

Get reads a whole blob.

func (*Store) Open

func (s *Store) Open(hash string) (io.ReadCloser, error)

Open streams a blob.

func (*Store) Put

func (s *Store) Put(data []byte) (string, error)

Put writes data and returns its hash. Writing the same content twice is a no-op.

func (*Store) Remove

func (s *Store) Remove(hash string) error

Remove deletes a blob; removing a missing blob is not an error.

func (*Store) Walk

func (s *Store) Walk(fn func(hash string) error) error

Walk calls fn for every stored hash.

Jump to

Keyboard shortcuts

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