document

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

Package document is a generated GoMock package.

Index

Constants

View Source
const (
	DownloaderTimeFormat = "2006-01"
)
View Source
const ResolverTimeFormat = "02.01.2006"

Variables

View Source
var ErrDocumentExists = errors.New("document exists")

Functions

func ProvideDocumentRepository

func ProvideDocumentRepository(db *gorm.DB, logger *log.Logger) (*database.Repository[*Model], error)

Types

type DateResolver

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

func NewDateResolver

func NewDateResolver(logger *log.Logger) DateResolver

func (DateResolver) Resolve

func (r DateResolver) Resolve(parentTimestamp time.Time, documentDate string) time.Time

type DateResolverInterface

type DateResolverInterface interface {
	Resolve(parentTimestamp time.Time, documentDate string) time.Time
}

type Downloader

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

func NewDownloader

func NewDownloader(logger *log.Logger) Downloader

func (Downloader) Download

func (d Downloader) Download(baseDir string, document Model) error

type DownloaderInterface

type DownloaderInterface interface {
	Download(baseDir string, document Model) error
}

type MockDownloaderInterface

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

MockDownloaderInterface is a mock of DownloaderInterface interface.

func NewMockDownloaderInterface

func NewMockDownloaderInterface(ctrl *gomock.Controller) *MockDownloaderInterface

NewMockDownloaderInterface creates a new mock instance.

func (*MockDownloaderInterface) Download

func (m *MockDownloaderInterface) Download(baseDir string, document Model) error

Download mocks base method.

func (*MockDownloaderInterface) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

type MockDownloaderInterfaceMockRecorder

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

MockDownloaderInterfaceMockRecorder is the mock recorder for MockDownloaderInterface.

func (*MockDownloaderInterfaceMockRecorder) Download

func (mr *MockDownloaderInterfaceMockRecorder) Download(baseDir, document any) *gomock.Call

Download indicates an expected call of Download.

type Model

type Model struct {
	TransactionUUID string `gorm:"foreignKey:UUID"`
	ID              string `gorm:"primaryKey"`
	URL             string `gorm:"-"`
	Detail          string
	Title           string
	Filepath        string
}

func NewModel

func NewModel(transactionUUID, id, url, detail, title, filename string) Model

func (Model) TableName

func (Model) TableName() string

type ModelBuilder

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

func NewModelBuilder

func NewModelBuilder(dateResolver DateResolverInterface, logger *log.Logger) ModelBuilder

func (ModelBuilder) Build

func (b ModelBuilder) Build(
	parentUUID string,
	parentTimestamp time.Time,
	response details.NormalizedResponse,
) ([]Model, error)

type ModelBuilderInterface

type ModelBuilderInterface interface {
	Build(transactionUUID string, parentTimestamp time.Time, response details.NormalizedResponse) ([]Model, error)
}

type RepositoryInterface

type RepositoryInterface interface {
	database.RepositoryInterface[*Model]
}

Jump to

Keyboard shortcuts

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