blob

package module
v0.0.0-...-6deb74b Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2024 License: Apache-2.0 Imports: 8 Imported by: 25

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bytes

func Bytes(b Blob) ([]byte, error)

func Error

func Error(b Blob) error

func LineIter

func LineIter(b Blob) rx.Iter[string]

func Peek

func Peek(b Blob, n int) ([]byte, error)

func ReadAt

func ReadAt(p []byte, b Blob, n int64) (int, error)

func ReadLines

func ReadLines(b Blob, fn func(string) error) error

func String

func String(b Blob) (string, error)

func Unmarshal

func Unmarshal(fn UnmarshalFunc, b Blob, v any) error

func Use

func Use(b Blob, fn func(io.Reader) error) error

func WriteTo

func WriteTo(w io.Writer, b Blob) error

Types

type Blob

type Blob interface{ Open() (io.ReadCloser, error) }

func Empty

func Empty() Blob

func FromBytes

func FromBytes(buf []byte) Blob

func FromFS

func FromFS(fsys fs.FS, name string) Blob

func FromReader

func FromReader(r io.Reader) Blob

func FromString

func FromString(s string) Blob

func Marshal

func Marshal(fn MarshalFunc, v any) Blob

type ByteFunc

type ByteFunc func() ([]byte, error)

func (ByteFunc) Bytes

func (fn ByteFunc) Bytes() ([]byte, error)

func (ByteFunc) Open

func (fn ByteFunc) Open() (io.ReadCloser, error)

type BytesReader

type BytesReader interface {
	io.ReadCloser
	Bytes() []byte
}

type Deleter

type Deleter interface {
	Delete(ctx context.Context, refs ...string) error
}

type Func

type Func func() (io.ReadCloser, error)

func (Func) Open

func (fn Func) Open() (io.ReadCloser, error)

type Getter

type Getter interface {
	Get(ctx context.Context, ref string) Blob
}

type Iterator

type Iterator interface {
	Iter(ctx context.Context, state rx.Lens[string]) rx.Iter[RefBlob]
}

type MarshalFunc

type MarshalFunc func(v any) ([]byte, error)

type RefBlob

type RefBlob struct {
	Ref string
	Blob
}

type Setter

type Setter interface {
	Set(ctx context.Context, ref string, r io.Reader) error
}

type SortedStorage

type SortedStorage interface {
	Storage
	Iterator
}

type Storage

type Storage interface {
	Getter
	Setter
	Deleter
}

type UnmarshalFunc

type UnmarshalFunc func(data []byte, v any) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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