_select

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: May 5, 2025 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clear

func Clear(repo *cache.RepoCache, namespace string) error

Clear will clear the selected entity, if any

func IsErrNoValidId

func IsErrNoValidId(err error) bool

func Resolve

func Resolve[CacheT cache.CacheEntity](repo *cache.RepoCache,
	typename string, namespace string, resolver Resolver[CacheT],
	args []string) (CacheT, []string, error)

Resolve first try to resolve an entity using the first argument of the command line. If it fails, it falls back to the select mechanism.

Returns:

  • the entity if any
  • the new list of command line arguments with the entity prefix removed if it has been used
  • an error if the process failed

func Select

func Select(repo *cache.RepoCache, namespace string, id entity.Id) error

Select will select a bug for future use

Types

type ErrNoValidId

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

func NewErrNoValidId

func NewErrNoValidId(typename string) *ErrNoValidId

func (ErrNoValidId) Error

func (e ErrNoValidId) Error() string

type Resolver

type Resolver[CacheT cache.CacheEntity] interface {
	Resolve(id entity.Id) (CacheT, error)
	ResolvePrefix(prefix string) (CacheT, error)
}

Jump to

Keyboard shortcuts

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