inept

package module
v0.0.0-...-1b042fa Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2017 License: MIT Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Index

func Index(archive archive.Archive, i Indexer) error

func IndexDebs

func IndexDebs(db *gorm.DB, a archive.Archive, hashes []string) error

func IndexSuites

func IndexSuites(repo Repository) error

Types

type Arch

type Arch struct {
	gorm.Model

	Name string
}

type Binary

type Binary struct {
	gorm.Model

	Name     string `gorm:"unique_index:idx_binary"`
	Version  string `gorm:"unique_index:idx_binary"`
	Arch     string `gorm:"unique_index:idx_binary"`
	Location string
}

func IndexDeb

func IndexDeb(db *gorm.DB, a archive.Archive, hashes []string, debFile *deb.Deb) (*Binary, error)

func InsertDeb

func InsertDeb(db *gorm.DB, debFile deb.Deb, location string, size uint64, hashers []*transput.Hasher) (*Binary, error)

func (Binary) Package

func (b Binary) Package(db *gorm.DB) (*archive.Package, error)

func (Binary) Paragraph

func (b Binary) Paragraph(db *gorm.DB) (*control.Paragraph, error)

type BinaryAssociation

type BinaryAssociation struct {
	gorm.Model

	Component Component
	Binary    Binary

	ComponentID uint `gorm:"unique_index:idx_binary_associations"`
	BinaryID    uint `gorm:"unique_index:idx_binary_associations"`
}

type BinaryMetadata

type BinaryMetadata struct {
	gorm.Model

	Binary Binary
	Key    MetadataKey

	BinaryID uint `gorm:"unique_index:idx_binary_metadata"`
	KeyID    uint `gorm:"unique_index:idx_binary_metadata"`

	Value string
}

type Component

type Component struct {
	gorm.Model

	/* Main */
	Name    string `gorm:"unique_index:idx_component"`
	SuiteID uint   `gorm:"unique_index:idx_component"`
	Suite   Suite
}

type Indexer

type Indexer func(dir, file string) error

type MetadataKey

type MetadataKey struct {
	gorm.Model

	Name  string `gorm:"unique"`
	Order int
}

type Repository

type Repository struct {
	DB      *gorm.DB
	Archive *archive.Archive
}

func NewRepository

func NewRepository(db *gorm.DB, arch *archive.Archive) (*Repository, error)

func (Repository) AssociateBinary

func (repo Repository) AssociateBinary(binary *Binary, comp *Component) (*BinaryAssociation, error)

func (Repository) IncludeDeb

func (repo Repository) IncludeDeb(debFile *deb.Deb) (*Binary, error)

func (Repository) UnassociateBinary

func (repo Repository) UnassociateBinary(binaryAssociation *BinaryAssociation) error

type Suite

type Suite struct {
	gorm.Model

	Name        string `gorm:"unique_index:idx_suite"`
	Description string
	Origin      string
	Version     string
}

func (Suite) Components

func (s Suite) Components(db *gorm.DB) ([]Component, error)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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