Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
Backend is a complete storage backend (i.e. file system, database) implementation - a lister, reader and saver
type Cataloger ¶ added in v0.3.0
type Cataloger interface {
// Catalog gets all the modules / versions.
Catalog(ctx context.Context, token string, pageSize int) ([]paths.AllPathParams, string, error)
}
Cataloger is the interface that lists all the modules and version contained in the storage
type Checker ¶
type Checker interface {
// Exists checks whether or not module in specified version is present
// in the backing storage
Exists(ctx context.Context, module, version string) (bool, error)
}
Checker is the interface that checks if the version of the module exists
func WithChecker ¶ added in v0.9.0
WithChecker wraps the backend with a Checker implementaiton
type Deleter ¶
type Deleter interface {
// Delete must return ErrNotFound if the module/version are not
// found.
Delete(ctx context.Context, module, vsn string) error
}
Deleter deletes module metadata and its source from underlying storage
type Getter ¶
type Getter interface {
Info(ctx context.Context, module, vsn string) ([]byte, error)
GoMod(ctx context.Context, module, vsn string) ([]byte, error)
Zip(ctx context.Context, module, vsn string) (SizeReadCloser, error)
}
Getter gets module metadata and its source from underlying storage
type Lister ¶
type Lister interface {
// List gets all the versions for the given baseURL & module.
// It returns ErrNotFound if the module isn't found
List(ctx context.Context, module string) ([]string, error)
}
Lister is the interface that lists versions of a specific baseURL & module
type Module ¶
type Module struct {
// TODO(marwan-at-work): ID is a mongo-specific field, it should not be
// in the generic storage.Module struct.
ID primitive.ObjectID `bson:"_id,omitempty"`
Module string `bson:"module"`
Version string `bson:"version"`
Mod []byte `bson:"mod"`
Info []byte `bson:"info"`
}
Module represents a vgo module saved in a storage backend.
type RevInfo ¶
type RevInfo struct {
Version string `json:"Version"` // version string
Time time.Time `json:"Time"` // commit time
}
RevInfo is json-encodable into the response body for GET baseURL/module/@v/version.info
This struct is taken directly from https://research.swtch.com/vgo-module (see "Download Protocol" header)
type Saver ¶
type Saver interface {
Save(ctx context.Context, module, version string, mod []byte, zip io.Reader, info []byte) error
}
Saver saves module metadata and its source to underlying storage
type SizeReadCloser ¶ added in v0.11.0
type SizeReadCloser interface {
io.ReadCloser
Size() int64
}
SizeReadCloser extends io.ReadCloser with a Size() method that tells you the length of the io.ReadCloser if read in full
func NewSizer ¶ added in v0.11.0
func NewSizer(rc io.ReadCloser, size int64) SizeReadCloser
NewSizer is a helper wrapper to return an implementation of ReadCloserSizer
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package gcp provides a storage driver to upload module files to a google cloud platform storage bucket.
|
Package gcp provides a storage driver to upload module files to a google cloud platform storage bucket. |
|
Package s3 provides a storage driver to upload module files to amazon s3 storage bucket.
|
Package s3 provides a storage driver to upload module files to amazon s3 storage bucket. |