store

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package store provides an interface to open blob.Store instances named by string addresses or URLs.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidAddress is reported by Open when given an address that is
	// syntactically invalid or has no corresponding Opener.
	ErrInvalidAddress = errors.New("invalid address")
)

Functions

This section is empty.

Types

type Opener

type Opener func(ctx context.Context, addr string) (blob.Store, error)

An Opener opens a blob.Store instance associated with the given address. The address passed to the Opener has its dispatch tag removed. The format of the address is opaque to the registry, and the opener is responsible for checking its validity.

type Registry

type Registry map[string]Opener

A Registry maintains a mapping from dispatch tags to Opener values.

func (Registry) Names

func (r Registry) Names() []string

Names returns a slice of the names of the storage implementations in r. The slice is sorted.

func (Registry) Open

func (r Registry) Open(ctx context.Context, addr string) (blob.Store, error)

Open opens a blob.Store for the specified address of the form "tag" or "tag:value". If the address does not have this form, or if the tag does not correspond to any known implementation, Open reports ErrInvalidAddress.

Jump to

Keyboard shortcuts

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