buf: github.com/bufbuild/buf/internal/pkg/storage/storagemem Index | Files

package storagemem

import "github.com/bufbuild/buf/internal/pkg/storage/storagemem"

Package storagemem implements an in-memory storage Bucket.

Index

Package Files

read_bucket.go read_bucket_builder.go storagemem.go

func NewReadBucket Uses

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

NewReadBucket returns a new ReadBucket.

type ReadBucketBuilder Uses

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 Uses

func NewReadBucketBuilder() ReadBucketBuilder

NewReadBucketBuilder returns a new in-memory ReadBucketBuilder.

type ReadBucketOption Uses

type ReadBucketOption func(*readBucketOptions)

ReadBucketOption is an option for a new ReadBucket.

func WithExternalPathResolver Uses

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 storagemem imports 9 packages (graph) and is imported by 6 packages. Updated 2020-10-24. Refresh now. Tools for package owners.