Back to

Package storagemem

Latest Go to latest

The latest major version is .

Published: Jul 24, 2020 | License: Apache-2.0 | Module:


Package storagemem implements an in-memory storage Bucket.


func NewReadBucket

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

NewReadBucket returns a new ReadBucket.

type ReadBucketBuilder

type ReadBucketBuilder interface {
	// ToReadBucket returns a ReadBucket for the current data in the WriteBucket.
	// No further calls can be made to the ReadBucketBuilder after this call.
	// This is functionally equivalent to a Close in other contexts.
	ToReadBucket(options ...ReadBucketOption) (storage.ReadBucket, error)

ReadBucketBuilder builds ReadBuckets.

func NewReadBucketBuilder

func NewReadBucketBuilder() ReadBucketBuilder

NewReadBucketBuilder returns a new in-memory ReadBucketBuilder.

type ReadBucketOption

type ReadBucketOption func(*readBucketOptions)

ReadBucketOption is an option for a new ReadBucket.

func WithExternalPathResolver

func WithExternalPathResolver(externalPathResolver func(string) (string, error)) ReadBucketOption

WithExternalPathResolver uses the given resolver to resolve paths to external paths.

The default is to use the path as the external path. This ExternalPathResolver takes precedence over any explicitly set external paths.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier