Documentation ¶
Index ¶
- func AddFileToExistingPackage(pvi *PackageInfo, pfci *PackageFileCreationInfo) (*packages_model.PackageVersion, *packages_model.PackageFile, error)
- func Cleanup(unused context.Context, olderThan time.Duration) error
- func CreateAuthorizationToken(u *user_model.User) (string, error)
- func CreatePackageAndAddFile(pvci *PackageCreationInfo, pfci *PackageFileCreationInfo) (*packages_model.PackageVersion, *packages_model.PackageFile, error)
- func CreatePackageOrAddFileToExisting(pvci *PackageCreationInfo, pfci *PackageFileCreationInfo) (*packages_model.PackageVersion, *packages_model.PackageFile, error)
- func DeletePackageFile(ctx context.Context, pf *packages_model.PackageFile) error
- func DeletePackageVersionAndReferences(ctx context.Context, pv *packages_model.PackageVersion) error
- func GetFileStreamByPackageNameAndVersion(ctx context.Context, pvi *PackageInfo, pfi *PackageFileInfo) (io.ReadCloser, *packages_model.PackageFile, error)
- func GetFileStreamByPackageVersion(ctx context.Context, pv *packages_model.PackageVersion, pfi *PackageFileInfo) (io.ReadCloser, *packages_model.PackageFile, error)
- func GetFileStreamByPackageVersionAndFileID(ctx context.Context, owner *user_model.User, versionID, fileID int64) (io.ReadCloser, *packages_model.PackageFile, error)
- func GetPackageFileStream(ctx context.Context, pf *packages_model.PackageFile) (io.ReadCloser, *packages_model.PackageFile, error)
- func NewPackageBlob(hsr packages_module.HashedSizeReader) *packages_model.PackageBlob
- func ParseAuthorizationToken(req *http.Request) (int64, error)
- func RemovePackageVersion(doer *user_model.User, pv *packages_model.PackageVersion) error
- func RemovePackageVersionByNameAndVersion(doer *user_model.User, pvi *PackageInfo) error
- type PackageCreationInfo
- type PackageFileCreationInfo
- type PackageFileInfo
- type PackageInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddFileToExistingPackage ¶
func AddFileToExistingPackage(pvi *PackageInfo, pfci *PackageFileCreationInfo) (*packages_model.PackageVersion, *packages_model.PackageFile, error)
AddFileToExistingPackage adds a file to an existing package. If the package does not exist, ErrPackageNotExist is returned
func CreateAuthorizationToken ¶
func CreateAuthorizationToken(u *user_model.User) (string, error)
func CreatePackageAndAddFile ¶
func CreatePackageAndAddFile(pvci *PackageCreationInfo, pfci *PackageFileCreationInfo) (*packages_model.PackageVersion, *packages_model.PackageFile, error)
CreatePackageAndAddFile creates a package with a file. If the same package exists already, ErrDuplicatePackageVersion is returned
func CreatePackageOrAddFileToExisting ¶
func CreatePackageOrAddFileToExisting(pvci *PackageCreationInfo, pfci *PackageFileCreationInfo) (*packages_model.PackageVersion, *packages_model.PackageFile, error)
CreatePackageOrAddFileToExisting creates a package with a file or adds the file if the package exists already
func DeletePackageFile ¶
func DeletePackageFile(ctx context.Context, pf *packages_model.PackageFile) error
DeletePackageFile deletes the package file and its properties
func DeletePackageVersionAndReferences ¶
func DeletePackageVersionAndReferences(ctx context.Context, pv *packages_model.PackageVersion) error
DeletePackageVersionAndReferences deletes the package version and its properties and files
func GetFileStreamByPackageNameAndVersion ¶
func GetFileStreamByPackageNameAndVersion(ctx context.Context, pvi *PackageInfo, pfi *PackageFileInfo) (io.ReadCloser, *packages_model.PackageFile, error)
GetFileStreamByPackageNameAndVersion returns the content of the specific package file
func GetFileStreamByPackageVersion ¶
func GetFileStreamByPackageVersion(ctx context.Context, pv *packages_model.PackageVersion, pfi *PackageFileInfo) (io.ReadCloser, *packages_model.PackageFile, error)
GetFileStreamByPackageVersion returns the content of the specific package file
func GetFileStreamByPackageVersionAndFileID ¶
func GetFileStreamByPackageVersionAndFileID(ctx context.Context, owner *user_model.User, versionID, fileID int64) (io.ReadCloser, *packages_model.PackageFile, error)
GetFileStreamByPackageVersionAndFileID returns the content of the specific package file
func GetPackageFileStream ¶
func GetPackageFileStream(ctx context.Context, pf *packages_model.PackageFile) (io.ReadCloser, *packages_model.PackageFile, error)
GetPackageFileStream returns the content of the specific package file
func NewPackageBlob ¶
func NewPackageBlob(hsr packages_module.HashedSizeReader) *packages_model.PackageBlob
NewPackageBlob creates a package blob instance
func RemovePackageVersion ¶
func RemovePackageVersion(doer *user_model.User, pv *packages_model.PackageVersion) error
RemovePackageVersion deletes the package version and all associated files
func RemovePackageVersionByNameAndVersion ¶
func RemovePackageVersionByNameAndVersion(doer *user_model.User, pvi *PackageInfo) error
RemovePackageVersionByNameAndVersion deletes a package version and all associated files
Types ¶
type PackageCreationInfo ¶
type PackageCreationInfo struct { PackageInfo SemverCompatible bool Creator *user_model.User Metadata interface{} Properties map[string]string }
PackageCreationInfo describes a package to create
type PackageFileCreationInfo ¶
type PackageFileCreationInfo struct { PackageFileInfo Data packages_module.HashedSizeReader IsLead bool Properties map[string]string OverwriteExisting bool }
PackageFileCreationInfo describes a package file to create
type PackageFileInfo ¶
PackageFileInfo describes a package file
type PackageInfo ¶
type PackageInfo struct { Owner *user_model.User PackageType packages_model.Type Name string Version string }
PackageInfo describes a package