Documentation ¶
Index ¶
- Variables
- func NewBoltDatabase(path string) types.PackageDatabase
- func NewInMemoryDatabase(singleton bool) types.PackageDatabase
- type BoltDatabase
- func (db *BoltDatabase) Clean() error
- func (db *BoltDatabase) Clone(to types.PackageDatabase) error
- func (db *BoltDatabase) Copy() (types.PackageDatabase, error)
- func (db *BoltDatabase) Create(id string, v []byte) (string, error)
- func (db *BoltDatabase) CreatePackage(p *types.Package) (string, error)
- func (db *BoltDatabase) FindPackage(tofind *types.Package) (*types.Package, error)
- func (db *BoltDatabase) FindPackageByFile(pattern string) (types.Packages, error)
- func (db *BoltDatabase) FindPackageCandidate(p *types.Package) (*types.Package, error)
- func (db *BoltDatabase) FindPackageLabel(labelKey string) (types.Packages, error)
- func (db *BoltDatabase) FindPackageLabelMatch(pattern string) (types.Packages, error)
- func (db *BoltDatabase) FindPackageMatch(pattern string) (types.Packages, error)
- func (db *BoltDatabase) FindPackageVersions(p *types.Package) (types.Packages, error)
- func (db *BoltDatabase) FindPackages(p *types.Package) (types.Packages, error)
- func (db *BoltDatabase) Get(s string) (string, error)
- func (db *BoltDatabase) GetAllPackages(packages chan *types.Package) error
- func (db *BoltDatabase) GetPackage(ID string) (*types.Package, error)
- func (db *BoltDatabase) GetPackageFiles(p *types.Package) ([]string, error)
- func (db *BoltDatabase) GetPackages() []string
- func (db *BoltDatabase) GetRevdeps(p *types.Package) (types.Packages, error)
- func (db *BoltDatabase) RemovePackage(p *types.Package) error
- func (db *BoltDatabase) RemovePackageFiles(p *types.Package) error
- func (db *BoltDatabase) Retrieve(ID string) ([]byte, error)
- func (db *BoltDatabase) Set(k, v string) error
- func (db *BoltDatabase) SetPackageFiles(p *types.PackageFile) error
- func (db *BoltDatabase) UpdatePackage(p *types.Package) error
- func (db *BoltDatabase) World() types.Packages
- type InMemoryDatabase
- func (db *InMemoryDatabase) Clean() error
- func (db *InMemoryDatabase) Clone(to types.PackageDatabase) error
- func (db *InMemoryDatabase) Copy() (types.PackageDatabase, error)
- func (db *InMemoryDatabase) Create(id string, v []byte) (string, error)
- func (db *InMemoryDatabase) CreatePackage(p *types.Package) (string, error)
- func (db *InMemoryDatabase) FindPackage(p *types.Package) (*types.Package, error)
- func (db *InMemoryDatabase) FindPackageByFile(pattern string) (types.Packages, error)
- func (db *InMemoryDatabase) FindPackageCandidate(p *types.Package) (*types.Package, error)
- func (db *InMemoryDatabase) FindPackageLabel(labelKey string) (types.Packages, error)
- func (db *InMemoryDatabase) FindPackageLabelMatch(pattern string) (types.Packages, error)
- func (db *InMemoryDatabase) FindPackageMatch(pattern string) (types.Packages, error)
- func (db *InMemoryDatabase) FindPackageVersions(p *types.Package) (types.Packages, error)
- func (db *InMemoryDatabase) FindPackages(p *types.Package) (types.Packages, error)
- func (db *InMemoryDatabase) Get(s string) (string, error)
- func (db *InMemoryDatabase) GetAllPackages(packages chan *types.Package) error
- func (db *InMemoryDatabase) GetPackage(ID string) (*types.Package, error)
- func (db *InMemoryDatabase) GetPackageFiles(p *types.Package) ([]string, error)
- func (db *InMemoryDatabase) GetPackages() []string
- func (db *InMemoryDatabase) GetRevdeps(p *types.Package) (types.Packages, error)
- func (db *InMemoryDatabase) RemovePackage(p *types.Package) error
- func (db *InMemoryDatabase) RemovePackageFiles(p *types.Package) error
- func (db *InMemoryDatabase) Retrieve(ID string) ([]byte, error)
- func (db *InMemoryDatabase) Set(k, v string) error
- func (db *InMemoryDatabase) SetPackageFiles(p *types.PackageFile) error
- func (db *InMemoryDatabase) UpdatePackage(p *types.Package) error
- func (db *InMemoryDatabase) World() types.Packages
Constants ¶
This section is empty.
Variables ¶
var DBInMemoryInstance = &InMemoryDatabase{ Mutex: &sync.Mutex{}, FileDatabase: map[string][]string{}, Database: map[string]string{}, CacheNoVersion: map[string]map[string]interface{}{}, ProvidesDatabase: map[string]map[string]*types.Package{}, RevDepsDatabase: map[string]map[string]*types.Package{}, cached: map[string]interface{}{}, }
Functions ¶
func NewBoltDatabase ¶
func NewBoltDatabase(path string) types.PackageDatabase
func NewInMemoryDatabase ¶
func NewInMemoryDatabase(singleton bool) types.PackageDatabase
Types ¶
type BoltDatabase ¶
type BoltDatabase struct { sync.Mutex Path string ProvidesDatabase map[string]map[string]*types.Package // contains filtered or unexported fields }
func (*BoltDatabase) Clean ¶
func (db *BoltDatabase) Clean() error
func (*BoltDatabase) Clone ¶
func (db *BoltDatabase) Clone(to types.PackageDatabase) error
func (*BoltDatabase) Copy ¶
func (db *BoltDatabase) Copy() (types.PackageDatabase, error)
func (*BoltDatabase) CreatePackage ¶
func (db *BoltDatabase) CreatePackage(p *types.Package) (string, error)
Encode encodes the package to string. It returns an ID which can be used to retrieve the package later on.
func (*BoltDatabase) FindPackage ¶
func (*BoltDatabase) FindPackageByFile ¶
func (db *BoltDatabase) FindPackageByFile(pattern string) (types.Packages, error)
func (*BoltDatabase) FindPackageCandidate ¶
func (*BoltDatabase) FindPackageLabel ¶
func (db *BoltDatabase) FindPackageLabel(labelKey string) (types.Packages, error)
func (*BoltDatabase) FindPackageLabelMatch ¶
func (db *BoltDatabase) FindPackageLabelMatch(pattern string) (types.Packages, error)
func (*BoltDatabase) FindPackageMatch ¶
func (db *BoltDatabase) FindPackageMatch(pattern string) (types.Packages, error)
func (*BoltDatabase) FindPackageVersions ¶
FindPackageVersions return the list of the packages beloging to cat/name
func (*BoltDatabase) FindPackages ¶
FindPackages return the list of the packages beloging to cat/name (any versions in requested range) FIXME: Optimize, see inmemorydb
func (*BoltDatabase) GetAllPackages ¶
func (db *BoltDatabase) GetAllPackages(packages chan *types.Package) error
func (*BoltDatabase) GetPackage ¶
func (db *BoltDatabase) GetPackage(ID string) (*types.Package, error)
func (*BoltDatabase) GetPackageFiles ¶
func (db *BoltDatabase) GetPackageFiles(p *types.Package) ([]string, error)
func (*BoltDatabase) GetPackages ¶
func (db *BoltDatabase) GetPackages() []string
func (*BoltDatabase) GetRevdeps ¶
GetRevdeps uses a new inmemory db to calcuate revdeps TODO: Have a memory instance for boltdb, so we don't compute each time we get called as this is REALLY expensive. But we don't perform usually those operations in a file db.
func (*BoltDatabase) RemovePackage ¶
func (db *BoltDatabase) RemovePackage(p *types.Package) error
func (*BoltDatabase) RemovePackageFiles ¶
func (db *BoltDatabase) RemovePackageFiles(p *types.Package) error
func (*BoltDatabase) Set ¶
func (db *BoltDatabase) Set(k, v string) error
func (*BoltDatabase) SetPackageFiles ¶
func (db *BoltDatabase) SetPackageFiles(p *types.PackageFile) error
func (*BoltDatabase) UpdatePackage ¶
func (db *BoltDatabase) UpdatePackage(p *types.Package) error
func (*BoltDatabase) World ¶
func (db *BoltDatabase) World() types.Packages
type InMemoryDatabase ¶
type InMemoryDatabase struct { *sync.Mutex Database map[string]string FileDatabase map[string][]string CacheNoVersion map[string]map[string]interface{} ProvidesDatabase map[string]map[string]*types.Package RevDepsDatabase map[string]map[string]*types.Package // contains filtered or unexported fields }
func (*InMemoryDatabase) Clean ¶
func (db *InMemoryDatabase) Clean() error
func (*InMemoryDatabase) Clone ¶
func (db *InMemoryDatabase) Clone(to types.PackageDatabase) error
func (*InMemoryDatabase) Copy ¶
func (db *InMemoryDatabase) Copy() (types.PackageDatabase, error)
func (*InMemoryDatabase) Create ¶
func (db *InMemoryDatabase) Create(id string, v []byte) (string, error)
func (*InMemoryDatabase) CreatePackage ¶
func (db *InMemoryDatabase) CreatePackage(p *types.Package) (string, error)
Encode encodes the package to string. It returns an ID which can be used to retrieve the package later on.
func (*InMemoryDatabase) FindPackage ¶
func (*InMemoryDatabase) FindPackageByFile ¶
func (db *InMemoryDatabase) FindPackageByFile(pattern string) (types.Packages, error)
func (*InMemoryDatabase) FindPackageCandidate ¶
func (*InMemoryDatabase) FindPackageLabel ¶
func (db *InMemoryDatabase) FindPackageLabel(labelKey string) (types.Packages, error)
func (*InMemoryDatabase) FindPackageLabelMatch ¶
func (db *InMemoryDatabase) FindPackageLabelMatch(pattern string) (types.Packages, error)
func (*InMemoryDatabase) FindPackageMatch ¶
func (db *InMemoryDatabase) FindPackageMatch(pattern string) (types.Packages, error)
func (*InMemoryDatabase) FindPackageVersions ¶
FindPackages return the list of the packages beloging to cat/name
func (*InMemoryDatabase) FindPackages ¶
FindPackages return the list of the packages beloging to cat/name (any versions in requested range)
func (*InMemoryDatabase) GetAllPackages ¶
func (db *InMemoryDatabase) GetAllPackages(packages chan *types.Package) error
func (*InMemoryDatabase) GetPackage ¶
func (db *InMemoryDatabase) GetPackage(ID string) (*types.Package, error)
func (*InMemoryDatabase) GetPackageFiles ¶
func (db *InMemoryDatabase) GetPackageFiles(p *types.Package) ([]string, error)
func (*InMemoryDatabase) GetPackages ¶
func (db *InMemoryDatabase) GetPackages() []string
func (*InMemoryDatabase) GetRevdeps ¶
GetRevdeps returns the package reverse dependencies, matching also selectors in versions (>, <, >=, <=) TODO: Code should use db explictly
func (*InMemoryDatabase) RemovePackage ¶
func (db *InMemoryDatabase) RemovePackage(p *types.Package) error
func (*InMemoryDatabase) RemovePackageFiles ¶
func (db *InMemoryDatabase) RemovePackageFiles(p *types.Package) error
func (*InMemoryDatabase) Set ¶
func (db *InMemoryDatabase) Set(k, v string) error
func (*InMemoryDatabase) SetPackageFiles ¶
func (db *InMemoryDatabase) SetPackageFiles(p *types.PackageFile) error
func (*InMemoryDatabase) UpdatePackage ¶
func (db *InMemoryDatabase) UpdatePackage(p *types.Package) error
func (*InMemoryDatabase) World ¶
func (db *InMemoryDatabase) World() types.Packages