Documentation
¶
Index ¶
- func CopyWithContext(ctx context.Context, dst io.Writer, src io.Reader) (int64, error)
- func GetDownloadedVersions(baseDir, binaryName string, logger *logrus.Entry) ([]string, error)
- func MoveFile(logger *logrus.Entry, src, dst string) error
- func VerifyChecksum(logger *logrus.Entry, filePath, expectedSHA256 string) error
- type ArchiveBinary
- type ArchiveRelease
- type PermissionManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyWithContext ¶
CopyWithContext copies data from src to dst with context cancellation support
func GetDownloadedVersions ¶
GetDownloadedVersions returns list of locally downloaded versions by scanning the base directory for version directories containing the specified binary
Types ¶
type ArchiveBinary ¶
type ArchiveBinary struct {
Arch string `json:"arch"`
DownloadURL string `json:"download_url"`
SHA256 string `json:"sha256"`
}
ArchiveBinary represents a binary download info
type ArchiveRelease ¶
type ArchiveRelease struct {
Version string `json:"version"`
Date time.Time `json:"date"`
Binaries []ArchiveBinary `json:"binaries"`
}
ArchiveRelease represents a single release from the archive API
type PermissionManager ¶
type PermissionManager struct {
BaseDir string
DirPerm os.FileMode
FilePerm os.FileMode
Logger *logrus.Entry
}
PermissionManager manages directory and file permissions for binary packages
func NewPermissionManager ¶
func NewPermissionManager(baseDir string, dirPerm, filePerm os.FileMode, logger *logrus.Entry) *PermissionManager
NewPermissionManager creates a new PermissionManager with the given configuration
func (*PermissionManager) CreateVersionDirectory ¶
func (pm *PermissionManager) CreateVersionDirectory(version string) (string, error)
CreateVersionDirectory creates directory structure for a version
func (*PermissionManager) EnsureBaseDirectory ¶
func (pm *PermissionManager) EnsureBaseDirectory() error
EnsureBaseDirectory creates the base directory if it doesn't exist
func (*PermissionManager) SetBinaryPermissions ¶
func (pm *PermissionManager) SetBinaryPermissions(binaryPath string) error
SetBinaryPermissions sets proper permissions for a binary file