shared

package
v0.0.0-...-297c556 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MaxChunkBytes contains the maximum number of bytes in a chunk (for Read/Write streaming operations)
	MaxChunkBytes = 1024 * 1024
)

Variables

This section is empty.

Functions

func NewBuffer

func NewBuffer(size int) []byte

Types

type File

type File struct {
	Key  string
	Info Info
}

type IO

type IO interface {
	Init(ctx context.Context, opts *InitOptions) error
	Write(ctx context.Context, key string) (Writer, error)
	Read(ctx context.Context, key string) (Reader, error)
	Head(ctx context.Context, key string) (*Info, error)
	Delete(ctx context.Context, key string) (bool, error)
	List(ctx context.Context, key string) (util.NextIterator[[]File], error)
}

type Info

type Info struct {
	Size          uint64
	LastUpdatedAt time.Time
}

type InitOptions

type InitOptions struct {
	Create *bool
}

func (*InitOptions) GetCreate

func (i *InitOptions) GetCreate() bool

type Reader

type Reader interface {
	io.Reader

	Close(ctx context.Context) (string, int64, error)

	Closed() bool
}

type Writer

type Writer interface {
	io.Writer

	Close(ctx context.Context) (string, int64, error)

	Closed() bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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