Documentation
¶
Index ¶
- type AmbiguousResolutionError
- type Cache
- type CacheUninitializedError
- type CachingAccount
- type CachingDatabase
- type CachingGateway
- type CachingIPAddress
- type CachingKubernetes
- type CachingLoadBalancer
- type CachingNetwork
- type CachingNetworkPeering
- type CachingObjectStorage
- type CachingResolutionProvider
- type CachingRouter
- type CachingServer
- type CachingServerGroup
- type CachingStorage
- type CachingToken
- type MatchType
- type NonGlobMultipleMatchesError
- type NotFoundError
- type ResolutionProvider
- type Resolved
- type Resolver
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 Cache ¶ added in v3.18.0
type Cache[T any] struct { // contains filtered or unexported fields }
type CacheUninitializedError ¶ added in v3.18.0
type CacheUninitializedError string
func (CacheUninitializedError) Error ¶ added in v3.18.0
func (s CacheUninitializedError) Error() string
type CachingAccount ¶ added in v3.4.0
type CachingAccount struct{}
CachingAccount implements resolver for servers, caching the results
func (CachingAccount) Get ¶ added in v3.4.0
func (s CachingAccount) Get(ctx context.Context, svc internal.AllServices) (Resolver, error)
Get implements ResolutionProvider.Get
func (CachingAccount) PositionalArgumentHelp ¶ added in v3.4.0
func (s CachingAccount) PositionalArgumentHelp() string
PositionalArgumentHelp implements resolver.ResolutionProvider
type CachingDatabase ¶
type CachingDatabase struct {
Cache[upcloud.ManagedDatabase]
}
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 CachingGateway ¶ added in v3.4.0
type CachingGateway struct{}
CachingGatewayimplements resolver for gateways, caching the results
func (CachingGateway) Get ¶ added in v3.4.0
func (s CachingGateway) Get(ctx context.Context, svc internal.AllServices) (Resolver, error)
Get implements ResolutionProvider.Get
func (CachingGateway) PositionalArgumentHelp ¶ added in v3.4.0
func (s CachingGateway) 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 ¶
type CachingKubernetes struct {
Cache[upcloud.KubernetesCluster]
}
CachingKubernetes implements resolver for Kubernetes clusters, caching the results
func (*CachingKubernetes) Get ¶
func (s *CachingKubernetes) Get(ctx context.Context, svc service.AllServices) (Resolver, error)
Get implements ResolutionProvider.Get
func (CachingKubernetes) PositionalArgumentHelp ¶
func (s CachingKubernetes) PositionalArgumentHelp() string
PositionalArgumentHelp implements resolver.ResolutionProvider
type CachingLoadBalancer ¶
type CachingLoadBalancer struct {
Cache[upcloud.LoadBalancer]
}
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 ¶
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) PositionalArgumentHelp ¶
func (s *CachingNetwork) PositionalArgumentHelp() string
PositionalArgumentHelp implements resolver.ResolutionProvider
type CachingNetworkPeering ¶ added in v3.6.0
type CachingNetworkPeering struct {
Cache[upcloud.NetworkPeering]
}
CachingNetworkPeering resolver for network peerings, caching the results
func (*CachingNetworkPeering) Get ¶ added in v3.6.0
func (s *CachingNetworkPeering) Get(ctx context.Context, svc internal.AllServices) (Resolver, error)
Get implements ResolutionProvider.Get
func (CachingNetworkPeering) PositionalArgumentHelp ¶ added in v3.6.0
func (s CachingNetworkPeering) PositionalArgumentHelp() string
PositionalArgumentHelp implements resolver.ResolutionProvider
type CachingObjectStorage ¶ added in v3.7.0
type CachingObjectStorage struct {
Cache[upcloud.ManagedObjectStorage]
}
CachingObjectStorage implements resolver for ObjectStorages, caching the results
func (*CachingObjectStorage) Get ¶ added in v3.7.0
func (s *CachingObjectStorage) Get(ctx context.Context, svc internal.AllServices) (Resolver, error)
Get implements ResolutionProvider.Get
func (CachingObjectStorage) PositionalArgumentHelp ¶ added in v3.7.0
func (s CachingObjectStorage) PositionalArgumentHelp() string
PositionalArgumentHelp implements resolver.ResolutionProvider
type CachingResolutionProvider ¶ added in v3.18.0
type CachingResolutionProvider[T any] interface { ResolutionProvider GetCached(uuid string) (T, error) }
type CachingRouter ¶
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) PositionalArgumentHelp ¶
func (s *CachingRouter) PositionalArgumentHelp() string
PositionalArgumentHelp implements resolver.ResolutionProvider
type CachingServer ¶
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 ¶
type CachingServerGroup struct {
Cache[upcloud.ServerGroup]
}
CachingServerGroup implements resolver for servers, caching the results
func (*CachingServerGroup) Get ¶
func (s *CachingServerGroup) Get(ctx context.Context, svc internal.AllServices) (Resolver, error)
Get implements ResolutionProvider.Get
func (CachingServerGroup) PositionalArgumentHelp ¶
func (s CachingServerGroup) PositionalArgumentHelp() string
PositionalArgumentHelp implements resolver.ResolutionProvider
type CachingStorage ¶
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) PositionalArgumentHelp ¶
func (s *CachingStorage) PositionalArgumentHelp() string
PositionalArgumentHelp implements resolver.ResolutionProvider
type CachingToken ¶ added in v3.15.0
type CachingToken struct{}
CachingToken implements resolver for tokens, caching the results.
func (CachingToken) Get ¶ added in v3.15.0
func (s CachingToken) Get(ctx context.Context, svc internal.AllServices) (Resolver, error)
Get implements ResolutionProvider.Get
func (CachingToken) PositionalArgumentHelp ¶ added in v3.15.0
func (s CachingToken) PositionalArgumentHelp() string
PositionalArgumentHelp implements resolver.ResolutionProvider
type MatchType ¶ added in v3.12.0
type MatchType int
func MatchArgWithEqualFold ¶ added in v3.22.0
MatchArgWithEqualFold checks if arg is a exact or case-insensitive match.
func MatchArgWithGlobPattern ¶ added in v3.14.0
MatchArgWithGlobPattern checks if arg matches given value as a unix style glob pattern.
func MatchTitle ¶ added in v3.14.0
MatchTitle checks if arg matches any of the given values by using MatchArgWithEqualFold and MatchArgWithGlobPattern matchers.
type NonGlobMultipleMatchesError ¶ added in v3.14.0
type NonGlobMultipleMatchesError string
NonGlobMultipleMatchesError is a resolver error when multiple matching entries have been found with non-glob argument.
func (NonGlobMultipleMatchesError) Error ¶ added in v3.14.0
func (s NonGlobMultipleMatchesError) Error() string
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
type Resolved ¶ added in v3.12.0
type Resolved struct {
Arg string
// contains filtered or unexported fields
}
func (*Resolved) AddMatch ¶ added in v3.12.0
AddMatch adds a match to the resolved value. If the match is already present, the highest match type is kept. I.e., exact match is kept over case insensitive match.
func (*Resolved) GetAll ¶ added in v3.12.0
GetAll returns matches with match-type that equals the highest available match-type for the resolved value. I.e., if there is an exact match, only exact matches are returned even if there would be case-insensitive matches.
If match-type is not a glob pattern match, an error is returned if there are multiple matches.