Back to godoc.org

Package storagemem

v0.20.5
Latest Go to latest
Published: Jul 24, 2020 | License: Apache-2.0 | Module: github.com/bufbuild/buf

Overview

Package storagemem implements an in-memory storage Bucket.

Index

Package Files

func NewReadBucket

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

NewReadBucket returns a new ReadBucket.

type ReadBucketBuilder

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

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.

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

Jump to identifier

Keyboard shortcuts

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