interfaces

package
v0.0.0-...-eb5064c Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppConfig

type AppConfig interface {
	SetTimezone(tz string) error
	Timezone() string
	TxTypeMappings() ([]common.Ct2BpTxMapping, error)
	BlockpitTxTypes() ([]common.TxDisplayName, error)
	SetCointracking2BlockpitMapping(ctTxType string, bpTxType string) error
	SwapHandling() string
	SetSwapHandling(handling string) error
}

type AppContext

type AppContext interface {
	// Context returns the application context used for wails runtime calls
	// or nil if wasn't set yet
	Context() context.Context
	SetContext(ctx context.Context)

	SetLastSelectedFileDirFromFile(filepath string)
	LastSelectedFileDir() string

	ExportFiles() []*common.ExportFileInfo
	AddExportFile(file *common.ExportFileInfo)

	AllTxIDs() []string
}

type BlockpitBackend

type BlockpitBackend interface {
	ExportToBlockpitXlsx() error
}

type BlockpitTx

type BlockpitTx struct {
	TxType common.TxDisplayName
	CtTx   *common.CointrackingTx
}

type BlockpitTxConverter

type BlockpitTxConverter interface {
	// FromCointrackingTx converts a CointrackingTx to a BlockpitTx
	// it may return multiple BlockpitTx if the conversion requires it depending
	// on the swap handling setting for example
	FromCointrackingTx(ctTx *common.CointrackingTx) ([]*BlockpitTx, error)
}

type CoinTrackingBackend

type CoinTrackingBackend interface {
	OpenExportFile(timezone string) (string, error)
}

type CointrackingCsvReader

type CointrackingCsvReader interface {
	ReadFile(
		filepath string,
		loc *time.Location,
		existingTxIDs []string,
	) (*common.ExportFileInfo, error)
}

type Initializer

type Initializer interface {
	Init() error
}

type TransactionsFileWriter

type TransactionsFileWriter interface {
	WriteTransactionsToFile(filePath string, transactions []*common.CointrackingTx) error
}

type TxTypeManager

type TxTypeManager interface {
	// GetMapping returns the list of mappings between CoinTracking and Blockpit
	GetMapping() ([]common.Ct2BpTxMapping, error)
	// SetMapping sets a mapping for a CoinTracking transaction type to a Blockpit transaction type
	SetMapping(ctTxType ct.CtTxType, bpTxType bp.BpTxType) error
	// BlockpitTxTypes returns all Blockpit transaction types
	BlockpitTxTypes() ([]common.TxDisplayName, error)
	// BlockpitTxType returns the mapped Blockpit type to a CoinTracking transaction type
	BlockpitTxType(ctTxType ct.CtTxType) (common.TxDisplayName, error)
}

type WailsLogger

type WailsLogger interface {
	LogPrint(ctx context.Context, message string)
	LogPrintf(ctx context.Context, format string, args ...any)
	LogTrace(ctx context.Context, message string)
	LogTracef(ctx context.Context, format string, args ...any)
	LogDebug(ctx context.Context, message string)
	LogDebugf(ctx context.Context, format string, args ...any)
	LogInfo(ctx context.Context, message string)
	LogInfof(ctx context.Context, format string, args ...any)
	LogWarning(ctx context.Context, message string)
	LogWarningf(ctx context.Context, format string, args ...any)
	LogError(ctx context.Context, message string)
	LogErrorf(ctx context.Context, format string, args ...any)
	LogFatal(ctx context.Context, message string)
	LogFatalf(ctx context.Context, format string, args ...any)
}

type WailsRuntime

type WailsRuntime interface {
	OpenFileDialog(dialogOptions runtime.OpenDialogOptions) (string, error)
	SaveFileDialog(dialogOptions runtime.SaveDialogOptions) (string, error)
	EventsEmit(eventName string, optionalData ...any)
}

type XMLFile

type XMLFile interface {
	io.Closer
	SetSheetHeader(sheetNr int, headers []string) error
	SetSheetRow(sheetNr int, rowNr int, data []any) error
	SaveAs(filePath string) error
}

type XMLFileFactory

type XMLFileFactory interface {
	NewXMLFile() XMLFile
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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