repository

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 26, 2025 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IRepository added in v0.0.2

type IRepository interface {
	// Fetch DB file
	FetchDB(repoName, archName string) (stream.IFileStream, error)

	// Get list of package names
	PkgNames(repoName, archName string) ([]string, error)

	// Get remote repository
	RemoteRepo(name, arch string) (*remote.RemoteRepo, error)

	// Get list of package files
	PkgFiles(repoName, archName, pkgName string) ([]string, error)

	// File and repository operations
	StoreFile(repo string, arch string, stream stream.IFileSeekStream) error
	StoreFileWithSignedURL(repo string, arch string, name string) (string, error)
	DeleteFile(repo string, arch string, file string) error
	RepoNames() ([]string, error)
	Files(name string, arch string) ([]string, error)
	Arches(repo string) ([]string, error)
	FetchFile(repo string, arch string, file string) (stream.IFileStream, error)
	RepoAdd(name string, arch string, pkg stream.IFileSeekStream, sig stream.IFileSeekStream, useSignedDB bool, gnupgDir *string) error
	RepoRemove(name string, arch string, pkg string, useSignedDB bool, gnupgDir *string) error

	// Meta store operations
	GetPkgFileName(name string) (fp string, err error)
	StorePkgFileName(packageName, filePath string) error
	DeletePkgFileName(packageName string) error

	// Initialization and verification
	Init(name string, useSignedDB bool, gnupgDir *string) error
	VerifyPkgRepo(name string) error
}

IRepository defines the interface for repository operations. Interface definition for repository operations. Each method provides DB, package, file, meta store, and initialization/verification operations. Comments are unified in English.

func New

func New(cfg *conf.AyatoConfig) (IRepository, error)

New creates an implementation of IRepository.

type PkgBinaryStoreProvider

type PkgBinaryStoreProvider interface {
	// StoreFile saves a file.
	StoreFile(repo string, arch string, stream stream.IFileSeekStream) error

	// StoreFileWithSignedURL saves a file with a signed URL.
	StoreFileWithSignedURL(repo string, arch string, name string) (string, error)

	// DeleteFile deletes a file from the database.
	DeleteFile(repo string, arch string, file string) error

	// FetchFile retrieves a file from the database.
	FetchFile(repo string, arch string, file string) (stream.IFileStream, error)

	// RepoAdd はリポジトリにパッケージを追加します。
	RepoAdd(name string, arch string, pkg, sig stream.IFileSeekStream, useSignedDB bool, gnupgDir *string) error

	// RepoRemove はリポジトリからパッケージを削除します。
	RepoRemove(name string, arch string, pkg string, useSignedDB bool, gnupgDir *string) error

	// Init はデータベースを初期化します。
	Init(name string, arch string, useSignedDB bool, gnupgDir *string) error

	// RepoNames は全リポジトリ名を返します。
	RepoNames() ([]string, error)

	// Files はリポジトリ内のファイル一覧を返します。
	Files(repo string, arch string) ([]string, error)

	// Arches はリポジトリのアーキテクチャ一覧を返します。
	Arches(repo string) ([]string, error)
}

PkgBinaryStoreProvider is an interface for binary file stores.

type PkgNameStoreProvider

type PkgNameStoreProvider blinky.PackageNameToFileProvider

PkgNameStoreProvider is a provider for storing package names and file names.

type Repository

type Repository struct {
	// contains filtered or unexported fields
}

Repository is the main implementation struct for repository operations.

func (*Repository) Arches

func (r *Repository) Arches(repo string) ([]string, error)

Arches returns a list of architectures in the repository.

func (*Repository) DeleteFile

func (r *Repository) DeleteFile(repo string, arch string, file string) error

DeleteFile deletes a file from the binary store.

func (*Repository) DeletePkgFileName

func (r *Repository) DeletePkgFileName(packageName string) error

DeletePkgFileName deletes the entry for the package name from the store.

func (*Repository) FetchDB

func (r *Repository) FetchDB(repoName, archName string) (stream.IFileStream, error)

FetchDB retrieves the DB file for the given repository and architecture.

func (*Repository) FetchFile

func (r *Repository) FetchFile(repo string, arch string, file string) (stream.IFileStream, error)

FetchFile retrieves a file from the binary store.

func (*Repository) Files

func (r *Repository) Files(name string, arch string) ([]string, error)

Files returns a list of files in the repository.

func (*Repository) GetPkgFileName

func (r *Repository) GetPkgFileName(name string) (fp string, err error)

GetPkgFileName retrieves the file name from the package name.

func (*Repository) Init

func (r *Repository) Init(name string, useSignedDB bool, gnupgDir *string) error

Init initializes the repository.

func (*Repository) PkgFiles

func (r *Repository) PkgFiles(repoName, archName, pkgName string) ([]string, error)

PkgFiles returns a list of package files in the repository. TODO: Not yet implemented (get list of package files)

func (*Repository) PkgNames

func (r *Repository) PkgNames(repoName, archName string) ([]string, error)

PkgNames returns all package base names in the repository. FIXME: Inefficient to open DB every time. Optimization with cache, etc. is recommended.

func (*Repository) RemoteRepo

func (r *Repository) RemoteRepo(name, arch string) (*remote.RemoteRepo, error)

RemoteRepo returns the remote repository object for the specified repository name and architecture.

func (*Repository) RepoAdd

func (r *Repository) RepoAdd(name string, arch string, pkg stream.IFileSeekStream, sig stream.IFileSeekStream, useSignedDB bool, gnupgDir *string) error

RepoAdd adds a package to the repository.

func (*Repository) RepoNames

func (r *Repository) RepoNames() ([]string, error)

RepoNames returns all repository names.

func (*Repository) RepoRemove

func (r *Repository) RepoRemove(name string, arch string, pkg string, useSignedDB bool, gnupgDir *string) error

RepoRemove removes a package from the repository.

func (*Repository) StoreFile

func (r *Repository) StoreFile(repo string, arch string, stream stream.IFileSeekStream) error

StoreFile saves a file to the binary store.

func (*Repository) StoreFileWithSignedURL

func (r *Repository) StoreFileWithSignedURL(repo string, arch string, name string) (string, error)

StoreFileWithSignedURL saves a file with a signed URL.

func (*Repository) StorePkgFileName

func (r *Repository) StorePkgFileName(packageName, filePath string) error

StorePkgFileName stores the package name and file path in the store.

func (*Repository) VerifyPkgRepo

func (r *Repository) VerifyPkgRepo(name string) error

VerifyPkgRepo checks whether all required files exist in the repository for each architecture.

Directories

Path Synopsis
binarystore
s3
metastore
localkv
File: https://github.com/BrenekH/blinky/blob/dc156eb662a6f52ab98c41ea792af17ed2e66b8a/keyvaluestore/kv.go
File: https://github.com/BrenekH/blinky/blob/dc156eb662a6f52ab98c41ea792af17ed2e66b8a/keyvaluestore/kv.go
sql

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL