yumdb

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogError string = "ERROR"
	LogInfo  string = "INFO"
)

Variables

View Source
var LogSchemas embed.FS
View Source
var MetadataSchemas embed.FS
View Source
var RepositorySchemas embed.FS
View Source
var StatusSchemas embed.FS

Functions

This section is empty.

Types

type DBTime

type DBTime struct {
	time.Time
}

func (*DBTime) Scan

func (dbt *DBTime) Scan(value any) error

Scan implements the Scanner interface.

func (DBTime) Value

func (dbt DBTime) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type Event

type Event struct {
	ID      string `db:"id"`
	Payload []byte `db:"payload"`
}

events table

type ExtraMetadata

type ExtraMetadata struct {
	Type         string `db:"type"`
	Filename     string `db:"filename"`
	Checksum     string `db:"checksum"`
	OpenChecksum string `db:"open_checksum"`
	Size         uint64 `db:"size"`
	OpenSize     uint64 `db:"open_size"`
	Timestamp    int64  `db:"timestamp"`
	Data         []byte `db:"data"`
}

type Log

type Log struct {
	ID      uint64 `db:"id"`
	Level   string `db:"level"`
	Date    int64  `db:"date"`
	Message string `db:"message"`
}

type LogDB

type LogDB struct {
	*sqlx.DB
	// contains filtered or unexported fields
}

func OpenLogDB

func OpenLogDB(ctx context.Context, bucket *blob.Bucket, dataDir string, repository string) (*LogDB, error)

func (*LogDB) AddLog

func (db *LogDB) AddLog(ctx context.Context, level string, message string) error

func (*LogDB) Close

func (db *LogDB) Close(removeDB bool) error

func (*LogDB) Path

func (db *LogDB) Path() string

func (*LogDB) Sync

func (db *LogDB) Sync(ctx context.Context) error

func (*LogDB) WalkLogs

func (db *LogDB) WalkLogs(ctx context.Context, walkFn WalkLogFunc) error

type MetadataDB

type MetadataDB struct {
	*sqlx.DB
	// contains filtered or unexported fields
}

func OpenMetadataDB

func OpenMetadataDB(ctx context.Context, bucket *blob.Bucket, dataDir string, repository string) (*MetadataDB, error)

func (*MetadataDB) AddExtraMetadata

func (db *MetadataDB) AddExtraMetadata(ctx context.Context, extraRepodata *ExtraMetadata) error

func (*MetadataDB) AddPackage

func (db *MetadataDB) AddPackage(ctx context.Context, pkg *PackageMetadata) error

func (*MetadataDB) Close

func (db *MetadataDB) Close(removeDB bool) error

func (*MetadataDB) CountPackages

func (db *MetadataDB) CountPackages(ctx context.Context) (int, error)

func (*MetadataDB) Path

func (db *MetadataDB) Path() string

func (*MetadataDB) Sync

func (db *MetadataDB) Sync(ctx context.Context) error

func (*MetadataDB) WalkExtraMetadata

func (db *MetadataDB) WalkExtraMetadata(ctx context.Context, walkFn WalkExtraMetadataFunc) error

func (*MetadataDB) WalkPackageMetadata

func (db *MetadataDB) WalkPackageMetadata(ctx context.Context, walkFn WalkPackageMetadataFunc) error

type PackageMetadata

type PackageMetadata struct {
	Name      string `db:"name"`
	ID        string `db:"id"`
	Primary   []byte `db:"meta_primary"`
	Filelists []byte `db:"meta_filelists"`
	Other     []byte `db:"meta_other"`
}

type Properties

type Properties struct {
	Created    bool   `db:"created"`
	Mirror     bool   `db:"mirror"`
	MirrorURLs []byte `db:"mirror_urls"`
	GPGKey     []byte `db:"gpg_key"`
}

type RepositoryDB

type RepositoryDB struct {
	*sqlx.DB
	// contains filtered or unexported fields
}

func OpenRepositoryDB

func OpenRepositoryDB(ctx context.Context, bucket *blob.Bucket, dataDir string, repository string) (*RepositoryDB, error)

func (*RepositoryDB) AddPackage

func (db *RepositoryDB) AddPackage(ctx context.Context, pkg *RepositoryPackage) error

func (*RepositoryDB) Close

func (db *RepositoryDB) Close(removeDB bool) error

func (*RepositoryDB) GetPackage

func (db *RepositoryDB) GetPackage(ctx context.Context, id string) (*RepositoryPackage, error)

func (*RepositoryDB) HasPackageID

func (db *RepositoryDB) HasPackageID(ctx context.Context, id string) (bool, error)

func (*RepositoryDB) Path

func (db *RepositoryDB) Path() string

func (*RepositoryDB) Sync

func (db *RepositoryDB) Sync(ctx context.Context) error

func (*RepositoryDB) WalkPackages

func (db *RepositoryDB) WalkPackages(ctx context.Context, walkFn WalkPackageFunc) error

type RepositoryPackage

type RepositoryPackage struct {
	Tag          string `db:"tag"`
	ID           string `db:"id"`
	Name         string `db:"name"`
	UploadTime   int64  `db:"upload_time"`
	BuildTime    int64  `db:"build_time"`
	Size         uint64 `db:"size"`
	Architecture string `db:"architecture"`
	SourceRPM    string `db:"source_rpm"`
	Version      string `db:"version"`
	Release      string `db:"release"`
	Groups       string `db:"groups"`
	License      string `db:"license"`
	Vendor       string `db:"vendor"`
	Summary      string `db:"summary"`
	Description  string `db:"description"`
	Verified     bool   `db:"verified"`
	GPGSignature string `db:"gpg_signature"`
}

type Reposync

type Reposync struct {
	Syncing        bool  `db:"syncing"`
	LastSyncTime   int64 `db:"last_sync_time"`
	TotalPackages  int   `db:"total_packages"`
	SyncedPackages int   `db:"synced_packages"`
}

type StatusDB

type StatusDB struct {
	*sqlx.DB
	// contains filtered or unexported fields
}

func OpenStatusDB

func OpenStatusDB(ctx context.Context, bucket *blob.Bucket, dataDir string, repository string) (*StatusDB, error)

func (*StatusDB) AddEvent

func (db *StatusDB) AddEvent(ctx context.Context, event *eventv1.EventPayload) error

func (*StatusDB) Close

func (db *StatusDB) Close(removeDB bool) error

func (*StatusDB) CountEnvents added in v0.0.4

func (db *StatusDB) CountEnvents(ctx context.Context) (int, error)

func (*StatusDB) GetProperties

func (db *StatusDB) GetProperties(ctx context.Context) (*Properties, error)

func (*StatusDB) GetReposync

func (db *StatusDB) GetReposync(ctx context.Context) (*Reposync, error)

func (*StatusDB) Path

func (db *StatusDB) Path() string

func (*StatusDB) RemoveEvent

func (db *StatusDB) RemoveEvent(ctx context.Context, id string) error

func (*StatusDB) Sync

func (db *StatusDB) Sync(ctx context.Context) error

func (*StatusDB) UpdateProperties

func (db *StatusDB) UpdateProperties(ctx context.Context, properties *Properties) error

func (*StatusDB) UpdateReposync

func (db *StatusDB) UpdateReposync(ctx context.Context, reposync *Reposync) error

func (*StatusDB) WalkEvents

func (db *StatusDB) WalkEvents(ctx context.Context, walkFn WalkEventsFunc) error

type WalkEventsFunc

type WalkEventsFunc func(*eventv1.EventPayload) error

type WalkExtraMetadataFunc

type WalkExtraMetadataFunc func(*ExtraMetadata) error

type WalkLogFunc

type WalkLogFunc func(*Log) error

type WalkPackageFunc

type WalkPackageFunc func(*RepositoryPackage) error

type WalkPackageMetadataFunc

type WalkPackageMetadataFunc func(*PackageMetadata) error

Jump to

Keyboard shortcuts

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