store

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2019 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Index

type Index interface {
	Versions(module string) ([]string, error)
	Info(coordinates.Module) (repository.RevInfo, error)
	Contains(coordinates.Module) (bool, int64, error)
	UpdateID(coordinates.SerialModule) error
	Mod(coordinates.Module) (string, error) // go.mod file
	Remove(coordinates.Module) error
	Put(ModuleAddition) error
	IDs() (Ranges, error)
	Summary() (int, int, error)
}

The Index is used to provide:

  • .mod file content
  • .info file content
  • boolean whether a module@version exists in the store
  • list of versions of a given module that exist in the store
  • list of version intervals for all modules in the store

The real implementation is an index backed by boltdb, so we get better performance than keeping actual files on disk.

func NewIndex

func NewIndex(options IndexOptions) (Index, error)

type IndexOptions

type IndexOptions struct {
	Directory   string
	OpenTimeout time.Duration
}

type ModuleAddition

type ModuleAddition struct {
	Mod      coordinates.Module
	UniqueID int64
	ModFile  string
}

type Options

type Options struct {
	Directory    string
	TmpDirectory string
}

type Range

type Range = coordinates.RangeID

Range is an alias of coordinates.RangeID for brevity.

type Ranges

type Ranges = coordinates.RangeIDs

Ranges is an alias of coordinates.RangeIDs for brevity.

type ZipStore

type ZipStore interface {
	PutZip(coordinates.Module, repository.Blob) error
	GetZip(coordinates.Module) (repository.Blob, error)
	DelZip(coordinates.Module) error
}

func NewStore

func NewStore(options Options, emitter stats.Sender) ZipStore

Directories

Path Synopsis
Package storetest contains autogenerated mocks.
Package storetest contains autogenerated mocks.

Jump to

Keyboard shortcuts

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