yumdb

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

This section is empty.

Types

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 {
	*sqlite.DB
}

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) WalkLogs

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

type MetadataDB

type MetadataDB struct {
	*sqlite.DB
}

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) CountPackages

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

func (*MetadataDB) RemoveExtraMetadata added in v0.0.9

func (db *MetadataDB) RemoveExtraMetadata(ctx context.Context, dataType string) (bool, error)

func (*MetadataDB) RemovePackage added in v0.0.9

func (db *MetadataDB) RemovePackage(ctx context.Context, id string) (bool, 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 {
	*sqlite.DB
}

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) CountPackages added in v0.0.18

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

func (*RepositoryDB) GetPackage

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

func (*RepositoryDB) GetPackageByTag added in v0.0.15

func (db *RepositoryDB) GetPackageByTag(ctx context.Context, tag string) (*RepositoryPackage, error)

func (*RepositoryDB) HasPackageID

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

func (*RepositoryDB) RemovePackage added in v0.0.9

func (db *RepositoryDB) RemovePackage(ctx context.Context, id string) (bool, 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"`
}

func (RepositoryPackage) RPMName added in v0.0.18

func (pkg RepositoryPackage) RPMName() string

type Reposync

type Reposync struct {
	Syncing        bool   `db:"syncing"`
	StartTime      int64  `db:"start_time"`
	EndTime        int64  `db:"end_time"`
	TotalPackages  int    `db:"total_packages"`
	SyncedPackages int    `db:"synced_packages"`
	SyncError      string `db:"sync_error"`
}

type StatusDB

type StatusDB struct {
	*sqlite.DB
}

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) CountEvents added in v0.0.18

func (db *StatusDB) CountEvents(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) RemoveEvent

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

func (*StatusDB) SetCreatedProperty added in v0.0.18

func (db *StatusDB) SetCreatedProperty(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