storagemem

package
v0.20.5 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2020 License: Apache-2.0 Imports: 9 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 added in v0.19.0

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

NewReadBucket returns a new ReadBucket.

Types

type ReadBucketBuilder added in v0.19.0

type ReadBucketBuilder interface {
	storage.WriteBucket
	// 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 added in v0.19.0

func NewReadBucketBuilder() ReadBucketBuilder

NewReadBucketBuilder returns a new in-memory ReadBucketBuilder.

type ReadBucketOption added in v0.19.0

type ReadBucketOption func(*readBucketOptions)

ReadBucketOption is an option for a new ReadBucket.

func WithExternalPathResolver added in v0.19.0

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.

Jump to

Keyboard shortcuts

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