data

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DiscogsS3BaseUrl = "https://discogs-data-dumps.s3-us-west-2.amazonaws.com/"

Functions

func BatchInsertItems

func BatchInsertItems(repo Repository) func(ctx context.Context, i interface{}) (interface{}, error)

func DispatchChecksumFetch

func DispatchChecksumFetch() func(context.Context, interface{}) (interface{}, error)

func FetchFiles

func FetchFiles(k *koanf.Koanf, dataRepo Repository) (map[string]string, error)

func NotNilFilter

func NotNilFilter() func(i interface{}) bool

func ParseDumpModel

func ParseDumpModel(ctx context.Context) func(item rxgo.Item) rxgo.Observable

func PopulateFromUri

func PopulateFromUri() func(ctx context.Context, i interface{}) (interface{}, error)

func SetChecksumValues

func SetChecksumValues(m map[time.Time]map[string]string) func(ctx context.Context, i interface{}) (interface{}, error)

func UpdateData

func UpdateData(ctx context.Context, repo Repository) (int, error)

func ValidUriFilter

func ValidUriFilter() func(i interface{}) bool

ValidUriFilter filter items by validating URI, judged by date, types and uri pattern.

Types

type Data

type Data struct {
	ETag        string `xml:"ETag" gorm:"column:etag"`
	GeneratedAt time.Time
	Checksum    string
	TargetType  string `gorm:"column:target_type"`
	Uri         string `xml:"Key"`
}

func (Data) TableName

func (Data) TableName() string

type Repository

type Repository interface {
	BatchInsert([]*Data) (int, error)
	FindByYearMonthType(year, month, typ string) (*Data, error)
}

func NewDataRepository

func NewDataRepository(db *gorm.DB) Repository

Jump to

Keyboard shortcuts

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