Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bundle ¶
type Bundle struct {
Package string
Version Version
Notes string
Metadata map[string]string
CreatedAt time.Time `firestore:",serverTimestamp"`
}
Bundle represents a package release bundle.
type IOProgress ¶
IOProgress is implemented by both ProgressReader and ProgressWriter.
type IsDiscard ¶
type IsDiscard interface {
IsDiscard() bool
}
IsDiscard is satisfied by all ProgressReader and ProgressWriter returned by this package so release.Manager implementations can optimize better.
type Manager ¶
type Manager interface {
// Create creates or updates a package.
Create(context.Context, Package) error
// UpdatePackageMetadata merges the given metadata keys into an existing
// package's manifest without touching other fields (Notes, Latest).
UpdatePackageMetadata(ctx context.Context, pkg string, metadata map[string]string) error
// DeletePackage deletes a package but package bundles are not deleted.
// Note that this does not prevent the next call to Upload to fail.
// In order to delete all traces of a package, all bundles must be deleted
// first via Delete.
DeletePackage(context.Context, string) error
// Get fetches a Package manifest.
GetPackage(context.Context, string) (Package, error)
// ListPackages lists all packages.
ListPackages(context.Context, map[string]string) (iterator.Iterator[Package], error)
// Upload uploads a package bundle and reports progress via ProgressReader.
// It updates the Latest field of the Package.
// If package has not been created via Create then it creates a new one.
Upload(context.Context, Bundle, ProgressReader) error
// Get downloads a Package bundle by package name and version and reports
// progress via ProgressWriter.
Get(context.Context, string, Version, ProgressWriter) (Bundle, error)
// Delete deletes a package bundle by package name and version.
Delete(context.Context, string, Version) error
// List lists all bundles of a package.
List(context.Context, string, map[string]string) (iterator.Iterator[Bundle], error)
}
Manager abstracts the ability to manage packages and releases.
type Package ¶
type Package struct {
Name string
Latest Version
Notes string
Metadata map[string]string
CreatedAt time.Time `firestore:",serverTimestamp"`
}
Package represents.. well, a package.
type ProgressReader ¶
ProgressReader wraps io.Reader to add a Progress hook so implementations are able to provide a mechanism for clients to know about the current Create progress.
func NewRelayProgressReader ¶
func NewRelayProgressReader(r io.Reader, in IOProgress) ProgressReader
NewRelayProgressReader returns a ProgressReader that relays reads to the given io.Reader and relays progress to the given IOProgress.
func NopProgressReader ¶
func NopProgressReader(r io.Reader) ProgressReader
NopProgressReader wraps r to satisfy ProgressReader, discarding any calls to Progress.
If r satisfies io.ReadWriteSeeker then the returned ProgressReader will satisfy io.ReadWriteSeeker as well.
type ProgressWriter ¶
ProgressWriter wraps io.Writer to add a Progress hook so implementations are able to provide a mechanism for clients to know about the current Get progress.
func NewRelayProgressWriter ¶
func NewRelayProgressWriter(w io.Writer, out IOProgress) ProgressWriter
NewRelayProgressWriter returns a ProgressWriter that relays writes to the given io.Writer and relays progress to the given IOProgress.
func NopProgressWriter ¶
func NopProgressWriter(w io.Writer) ProgressWriter
NopProgressWriter wraps w to satisfy ProgressWriter, discarding any calls to Progress.
If w satisfies io.ReadWriteSeeker then the returned ProgressWriter will satisfy io.ReadWriteSeeker as well.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package releasetest is a generated GoMock package.
|
Package releasetest is a generated GoMock package. |