Documentation
¶
Index ¶
- func MatchArgWithWhitespace(arg string, value string) bool
- type AmbiguousResolutionError
- type CachingDatabase
- type CachingIPAddress
- type CachingKubernetes
- type CachingLoadBalancer
- type CachingNetwork
- type CachingRouter
- type CachingServer
- type CachingServerGroup
- type CachingStorage
- type NotFoundError
- type ResolutionProvider
- type Resolver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MatchArgWithWhitespace ¶ added in v2.5.0
MatchStringWithWhitespace checks if arg that may include whitespace matches given value. This checks both quoted args and auto-completed args handled with completion.RemoveWordBreaks.
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 ¶
type CachingDatabase struct{}
CachingDatabase implements resolver for servers, caching the results
func (CachingDatabase) Get ¶
func (s CachingDatabase) Get(ctx context.Context, svc internal.AllServices) (Resolver, error)
Get implements ResolutionProvider.Get
func (CachingDatabase) PositionalArgumentHelp ¶
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 ¶
func (s CachingIPAddress) Get(ctx context.Context, svc internal.AllServices) (Resolver, error)
Get implements ResolutionProvider.Get
func (CachingIPAddress) PositionalArgumentHelp ¶
func (s CachingIPAddress) PositionalArgumentHelp() string
PositionalArgumentHelp implements resolver.ResolutionProvider
type CachingKubernetes ¶ added in v2.4.0
type CachingKubernetes struct{}
CachingKubernetes implements resolver for Kubernetes clusters, caching the results
func (CachingKubernetes) Get ¶ added in v2.4.0
func (s CachingKubernetes) Get(ctx context.Context, svc service.AllServices) (Resolver, error)
Get implements ResolutionProvider.Get
func (CachingKubernetes) PositionalArgumentHelp ¶ added in v2.4.0
func (s CachingKubernetes) PositionalArgumentHelp() string
PositionalArgumentHelp implements resolver.ResolutionProvider
type CachingLoadBalancer ¶
type CachingLoadBalancer struct{}
CachingLoadBalancer implements resolver for servers, caching the results
func (CachingLoadBalancer) Get ¶
func (s CachingLoadBalancer) Get(ctx context.Context, svc internal.AllServices) (Resolver, error)
Get implements ResolutionProvider.Get
func (CachingLoadBalancer) PositionalArgumentHelp ¶
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 ¶
func (s *CachingNetwork) Get(ctx context.Context, svc internal.AllServices) (Resolver, error)
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
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 ¶
func (s *CachingRouter) Get(ctx context.Context, svc internal.AllServices) (Resolver, error)
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 ¶
func (s CachingServer) Get(ctx context.Context, svc internal.AllServices) (Resolver, error)
Get implements ResolutionProvider.Get
func (CachingServer) PositionalArgumentHelp ¶
func (s CachingServer) PositionalArgumentHelp() string
PositionalArgumentHelp implements resolver.ResolutionProvider
type CachingServerGroup ¶ added in v2.9.0
type CachingServerGroup struct{}
CachingServerGroup implements resolver for servers, caching the results
func (CachingServerGroup) Get ¶ added in v2.9.0
func (s CachingServerGroup) Get(ctx context.Context, svc internal.AllServices) (Resolver, error)
Get implements ResolutionProvider.Get
func (CachingServerGroup) PositionalArgumentHelp ¶ added in v2.9.0
func (s CachingServerGroup) 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 ¶
func (s *CachingStorage) Get(ctx context.Context, svc internal.AllServices) (Resolver, error)
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
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(ctx context.Context, svc service.AllServices) (Resolver, error) PositionalArgumentHelp() string }
ResolutionProvider is an interface for commands that provide resolution, either custom or the built-in ones