Documentation ¶
Overview ¶
Package resolver centralizes logic for resolving dataset names. It provides a low-dependency interface that can be used throughout the stack, and also an implementation that ties together multiple subsystems to be used as a high-level mechanism for name resolution.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrCannotResolveName = fmt.Errorf("cannot resolve name")
ErrCannotResolveName is an error representing common name resolution problems
Functions ¶
This section is empty.
Types ¶
type MemResolver ¶
type MemResolver struct { RefMap map[string]string IDMap map[string]dsref.VersionInfo }
MemResolver holds maps that can do a cheap version of dataset resolution, for tests
func (*MemResolver) GetInfo ¶
func (m *MemResolver) GetInfo(initID string) *dsref.VersionInfo
GetInfo returns a VersionInfo by initID, or nil if not found
func (*MemResolver) GetInfoByDsref ¶
func (m *MemResolver) GetInfoByDsref(dr dsref.Ref) *dsref.VersionInfo
GetInfoByDsref returns a VersionInfo by dsref, or nil if not found
func (*MemResolver) Put ¶
func (m *MemResolver) Put(info dsref.VersionInfo)
Put adds a VersionInfo to the resolver
type Resolver ¶
type Resolver interface { // GetInfo takes an initID for a dataset and returns the most recent VersionInfo GetInfo(initID string) *dsref.VersionInfo // GetInfoByDsref takes a dsref and returns the most recent VersionInfo. GetInfo should be // used instead when possible. GetInfoByDsref(dr dsref.Ref) *dsref.VersionInfo }
Resolver resolves identifiers into info about datasets