storagemem

package
v0.0.0-...-26f4575 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package storagemem implements an in-memory storage Bucket.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewReadBucket

func NewReadBucket(pathToData map[string][]byte) (storage.ReadBucket, error)

NewReadBucket returns a new ReadBucket.

func NewReadWriteBucket

func NewReadWriteBucket() storage.ReadWriteBucket

NewReadWriteBucket returns a new in-memory ReadWriteBucket. Deprecated: Use NewReadWriteBucketWithOptions without any options.

func NewReadWriteBucketWithOptions

func NewReadWriteBucketWithOptions(opts ...Option) (storage.ReadWriteBucket, error)

NewReadWriteBucketWithOptions returns a new in-memory ReadWriteBucket. Errors are returned with invalid options.

Types

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option is provided by NewReadWriteBucketWithOptions options.

func WithFiles

func WithFiles(pathToData map[string][]byte) Option

WithFiles adds files by path to their content into the bucket.

Directories

Path Synopsis
Package internal splits out ImmutableObject into a separate package from storagemem to make it impossible to modify ImmutableObject via direct field access.
Package internal splits out ImmutableObject into a separate package from storagemem to make it impossible to modify ImmutableObject via direct field access.

Jump to

Keyboard shortcuts

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