resolver

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AmbiguousResolutionError

type AmbiguousResolutionError string

AmbiguousResolutionError is a resolver error when multiple matching entries have been found

func (AmbiguousResolutionError) Error

func (s AmbiguousResolutionError) Error() string

type CachingDatabase added in v1.4.0

type CachingDatabase struct{}

CachingDatabase implements resolver for servers, caching the results

func (CachingDatabase) Get added in v1.4.0

Get implements ResolutionProvider.Get

func (CachingDatabase) PositionalArgumentHelp added in v1.4.0

func (s CachingDatabase) PositionalArgumentHelp() string

PositionalArgumentHelp implements resolver.ResolutionProvider

type CachingIPAddress

type CachingIPAddress struct{}

CachingIPAddress implements resolver for ip addresses that resolve with ptr records, caching the results

func (CachingIPAddress) Get

Get implements ResolutionProvider.Get

func (CachingIPAddress) PositionalArgumentHelp

func (s CachingIPAddress) PositionalArgumentHelp() string

PositionalArgumentHelp implements resolver.ResolutionProvider

type CachingLoadBalancer added in v1.4.0

type CachingLoadBalancer struct{}

CachingLoadBalancer implements resolver for servers, caching the results

func (CachingLoadBalancer) Get added in v1.4.0

Get implements ResolutionProvider.Get

func (CachingLoadBalancer) PositionalArgumentHelp added in v1.4.0

func (s CachingLoadBalancer) PositionalArgumentHelp() string

PositionalArgumentHelp implements resolver.ResolutionProvider

type CachingNetwork

type CachingNetwork struct {
	// contains filtered or unexported fields
}

CachingNetwork implements resolver for networks, caching the results

func (*CachingNetwork) Get

Get implements ResolutionProvider.Get

func (*CachingNetwork) GetCached

func (s *CachingNetwork) GetCached(uuid string) (upcloud.Network, error)

GetCached is a helper method for commands to use when they need to get an item from the cached results

func (*CachingNetwork) PositionalArgumentHelp

func (s *CachingNetwork) PositionalArgumentHelp() string

PositionalArgumentHelp implements resolver.ResolutionProvider

func (*CachingNetwork) Resolve

func (s *CachingNetwork) Resolve(arg string) (resolved string, err error)

Resolve is a helper method for commands to resolve networks inside Execute(), outside arguments

type CachingRouter

type CachingRouter struct {
	// contains filtered or unexported fields
}

CachingRouter implements resolver for routers by uuid or name, caching the results

func (*CachingRouter) Get

Get implements ResolutionProvider.Get

func (*CachingRouter) GetCached

func (s *CachingRouter) GetCached(uuid string) (upcloud.Router, error)

GetCached is a helper method for commands to use when they need to get an item from the cached results

func (*CachingRouter) PositionalArgumentHelp

func (s *CachingRouter) PositionalArgumentHelp() string

PositionalArgumentHelp implements resolver.ResolutionProvider

type CachingServer

type CachingServer struct{}

CachingServer implements resolver for servers, caching the results

func (CachingServer) Get

Get implements ResolutionProvider.Get

func (CachingServer) PositionalArgumentHelp

func (s CachingServer) PositionalArgumentHelp() string

PositionalArgumentHelp implements resolver.ResolutionProvider

type CachingStorage

type CachingStorage struct {
	// contains filtered or unexported fields
}

CachingStorage implements resolver for storages, caching the results

func (*CachingStorage) Get

Get implements ResolutionProvider.Get

func (*CachingStorage) GetCached

func (s *CachingStorage) GetCached(uuid string) (upcloud.Storage, error)

GetCached is a helper method for commands to use when they need to get an item from the cached results

func (*CachingStorage) PositionalArgumentHelp

func (s *CachingStorage) PositionalArgumentHelp() string

PositionalArgumentHelp implements resolver.ResolutionProvider

func (*CachingStorage) Resolve

func (s *CachingStorage) Resolve(arg string) (resolved string, err error)

Resolve is a helper method for commands to resolve networks inside Execute(), outside arguments

type CompletionResolver

type CompletionResolver struct{}

CompletionResolver implements resolver for servers, caching the results

func (CompletionResolver) Get

Get is just a passthrough to respect the lib

func (CompletionResolver) PositionalArgumentHelp

func (s CompletionResolver) PositionalArgumentHelp() string

PositionalArgumentHelp implements resolver.ResolutionProvider

type NotFoundError

type NotFoundError string

NotFoundError is a resolver error when no matching entries have been found

func (NotFoundError) Error

func (s NotFoundError) Error() string

type ResolutionProvider

type ResolutionProvider interface {
	Get(svc service.AllServices) (Resolver, error)
	PositionalArgumentHelp() string
}

ResolutionProvider is an interface for commands that provide resolution, either custom or the built-in ones

type Resolver

type Resolver func(arg string) (uuid string, err error)

Resolver represents the most basic argument resolver, a function that accepts and argument and returns an uuid (or error)

Jump to

Keyboard shortcuts

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