Documentation
¶
Index ¶
- type ModuleStore
- func (s *ModuleStore) Archive(ctx context.Context, source, filename string) (storage.ArchiveInfo, storage.SizeReadCloser, error)
- func (s *ModuleStore) Catalog(ctx context.Context, token string, pageSize int) ([]paths.AllPathParams, string, error)
- func (s *ModuleStore) Delete(ctx context.Context, module, version string) error
- func (s *ModuleStore) DeleteArchive(ctx context.Context, source, filename string) error
- func (s *ModuleStore) Exists(ctx context.Context, module, vsn string) (bool, error)
- func (s *ModuleStore) GoMod(ctx context.Context, module, vsn string) ([]byte, error)
- func (s *ModuleStore) Info(ctx context.Context, module, vsn string) ([]byte, error)
- func (s *ModuleStore) List(ctx context.Context, moduleName string) ([]string, error)
- func (s *ModuleStore) ListArchives(ctx context.Context, source string) ([]storage.ArchiveInfo, error)
- func (s *ModuleStore) Releases(ctx context.Context, source string) (*storage.ReleaseList, error)
- func (s *ModuleStore) Save(ctx context.Context, module, version string, mod []byte, zip io.Reader, ...) error
- func (s *ModuleStore) SaveArchive(ctx context.Context, source string, info storage.ArchiveInfo, body io.Reader) error
- func (s *ModuleStore) SaveReleases(ctx context.Context, source string, list *storage.ReleaseList) error
- func (s *ModuleStore) Zip(ctx context.Context, module, vsn string) (storage.SizeReadCloser, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ModuleStore ¶
type ModuleStore struct {
// contains filtered or unexported fields
}
ModuleStore represents a mongo backed storage backend.
func NewStorage ¶
func NewStorage(conf *config.MongoConfig, timeout time.Duration) (*ModuleStore, error)
NewStorage returns a connected Mongo backed storage that satisfies the Backend interface.
func (*ModuleStore) Archive ¶ added in v0.20.0
func (s *ModuleStore) Archive(ctx context.Context, source, filename string) (storage.ArchiveInfo, storage.SizeReadCloser, error)
func (*ModuleStore) Catalog ¶ added in v0.3.0
func (s *ModuleStore) Catalog(ctx context.Context, token string, pageSize int) ([]paths.AllPathParams, string, error)
Catalog implements the (./pkg/storage).Cataloger interface. It returns a list of modules and versions contained in the storage.
func (*ModuleStore) Delete ¶
func (s *ModuleStore) Delete(ctx context.Context, module, version string) error
Delete removes a specific version of a module.
func (*ModuleStore) DeleteArchive ¶ added in v0.20.0
func (s *ModuleStore) DeleteArchive(ctx context.Context, source, filename string) error
func (*ModuleStore) ListArchives ¶ added in v0.20.0
func (s *ModuleStore) ListArchives(ctx context.Context, source string) ([]storage.ArchiveInfo, error)
func (*ModuleStore) Releases ¶ added in v0.20.0
func (s *ModuleStore) Releases(ctx context.Context, source string) (*storage.ReleaseList, error)
func (*ModuleStore) Save ¶
func (s *ModuleStore) Save(ctx context.Context, module, version string, mod []byte, zip io.Reader, zipMD5, info []byte) error
Save stores a module in mongo storage.
func (*ModuleStore) SaveArchive ¶ added in v0.20.0
func (s *ModuleStore) SaveArchive(ctx context.Context, source string, info storage.ArchiveInfo, body io.Reader) error
func (*ModuleStore) SaveReleases ¶ added in v0.20.0
func (s *ModuleStore) SaveReleases(ctx context.Context, source string, list *storage.ReleaseList) error
func (*ModuleStore) Zip ¶ added in v0.1.0
func (s *ModuleStore) Zip(ctx context.Context, module, vsn string) (storage.SizeReadCloser, error)
Zip implements storage.Getter.
Click to show internal directories.
Click to hide internal directories.