database

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CatalogEntry

type CatalogEntry struct {
	Name string `json:"name" yaml:"name"`
	Tag  string `json:"tag" yaml:"tag"`

	Fetcher       string                           `json:"-" yaml:"fetcher"`
	FetcherConfig *fieldcollection.FieldCollection `json:"-" yaml:"fetcher_config"`

	Links []CatalogLink `json:"links" yaml:"links"`
}

func (CatalogEntry) Key

func (c CatalogEntry) Key() string
type CatalogLink struct {
	IconClass string `json:"icon_class" yaml:"icon_class"`
	Name      string `json:"name" yaml:"name"`
	URL       string `json:"url" yaml:"url"`
}

type CatalogMeta

type CatalogMeta struct {
	CatalogName    string     `gorm:"primaryKey" json:"-"`
	CatalogTag     string     `gorm:"primaryKey" json:"-"`
	CurrentVersion string     `json:"current_version,omitempty"`
	Error          string     `json:"error,omitempty"`
	LastChecked    *time.Time `json:"last_checked,omitempty"`
	VersionTime    *time.Time `json:"version_time,omitempty"`
}

type CatalogMetaStore

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

func (CatalogMetaStore) GetMeta

func (c CatalogMetaStore) GetMeta(ce *CatalogEntry) (*CatalogMeta, error)

func (CatalogMetaStore) PutMeta

func (c CatalogMetaStore) PutMeta(cm *CatalogMeta) error

type Client

type Client struct {
	Catalog CatalogMetaStore
	Logs    LogStore
	// contains filtered or unexported fields
}

func NewClient

func NewClient(dbtype, dsn string) (*Client, error)

type LogEntry

type LogEntry struct {
	CatalogName string    `gorm:"index:catalog_key" json:"catalog_name"`
	CatalogTag  string    `gorm:"index:catalog_key" json:"catalog_tag"`
	Timestamp   time.Time `gorm:"index:,sort:desc" json:"timestamp"`
	VersionTo   string    `json:"version_to"`
	VersionFrom string    `json:"version_from"`
}

type LogStore

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

func (LogStore) Add

func (l LogStore) Add(le *LogEntry) error

func (LogStore) List

func (l LogStore) List(num, page int) ([]LogEntry, error)

func (LogStore) ListForCatalogEntry

func (l LogStore) ListForCatalogEntry(ce *CatalogEntry, num, page int) ([]LogEntry, error)

Jump to

Keyboard shortcuts

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