handlers

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: AGPL-3.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SpaHandler

func SpaHandler(staticDir string) http.HandlerFunc

Types

type AnalyticsApi added in v0.2.9

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

func NewAnalyticsApi added in v0.2.9

func NewAnalyticsApi(
	mux *boilerplate.DefaultGrpcServer,
	analyticsSvc AnalyticsSvc,
) *AnalyticsApi

type AnalyticsSvc added in v0.2.9

type AnalyticsSvc interface {
	GetDebitsAndCreditsSummary(
		ctx context.Context,
		req *analyticsv1.GetDebitsAndCreditsSummaryRequest,
	) (*analyticsv1.GetDebitsAndCreditsSummaryResponse, error)
}

type ApplicableAccountSvc added in v0.2.0

type ApplicableAccountSvc interface {
	GetAll(
		ctx context.Context,
	) (map[gomoneypbv1.TransactionType]*applicable_accounts.PossibleAccount, error)
}

type CategoriesApi

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

func NewCategoriesApi

func NewCategoriesApi(
	mux *boilerplate.DefaultGrpcServer,
	categoriesSvc CategoriesSvc,
) *CategoriesApi

type ConfigApi

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

func NewConfigApi

func NewConfigApi(
	mux *boilerplate.DefaultGrpcServer,
	userSvc ConfigSvc,
	serviceTokenSvc ServiceTokenSvc,
) (*ConfigApi, error)

type ConverterSvc

type ConverterSvc interface {
	Convert(
		ctx context.Context,
		fromCurrency string,
		toCurrency string,
		amount decimal.Decimal,
	) (decimal.Decimal, error)
}

type CurrencyApi

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

func NewCurrencyApi

func NewCurrencyApi(
	mux *boilerplate.DefaultGrpcServer,
	currencySvc CurrencySvc,
	converterSvc ConverterSvc,
	decimalSvc DecimalSvc,
) (*CurrencyApi, error)

func (*CurrencyApi) CreateCurrency

func (a *CurrencyApi) CreateCurrency(
	ctx context.Context,
	c *connect.Request[currencyv1.CreateCurrencyRequest],
) (*connect.Response[currencyv1.CreateCurrencyResponse], error)

func (*CurrencyApi) DeleteCurrency

func (a *CurrencyApi) DeleteCurrency(ctx context.Context, c *connect.Request[currencyv1.DeleteCurrencyRequest]) (*connect.Response[currencyv1.DeleteCurrencyResponse], error)

func (*CurrencyApi) Exchange

func (a *CurrencyApi) Exchange(
	ctx context.Context,
	c *connect.Request[currencyv1.ExchangeRequest],
) (*connect.Response[currencyv1.ExchangeResponse], error)

func (*CurrencyApi) GetCurrencies

func (a *CurrencyApi) GetCurrencies(
	ctx context.Context,
	c *connect.Request[currencyv1.GetCurrenciesRequest],
) (*connect.Response[currencyv1.GetCurrenciesResponse], error)

func (*CurrencyApi) UpdateCurrency

func (a *CurrencyApi) UpdateCurrency(
	ctx context.Context,
	c *connect.Request[currencyv1.UpdateCurrencyRequest],
) (*connect.Response[currencyv1.UpdateCurrencyResponse], error)

type DecimalSvc

type DecimalSvc interface {
	ToString(ctx context.Context, amount decimal.Decimal, currency string) string
}

type DryRunSvc

type DryRunSvc interface {
	DryRunRule(ctx context.Context, req *rulesv1.DryRunRuleRequest) (*rulesv1.DryRunRuleResponse, error)
}

type ImportApi

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

func NewImportApi

func NewImportApi(
	mux *boilerplate.DefaultGrpcServer,
	importSvc ImportSvc,
) (*ImportApi, error)

func (*ImportApi) ParseTransactions added in v0.2.9

type MaintenanceApi added in v0.2.0

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

func NewMaintenanceApi added in v0.2.0

func NewMaintenanceApi(
	mux *boilerplate.DefaultGrpcServer,
	recalculateSvc RecalculateSvc,
) *MaintenanceApi

type MapperSvc added in v0.2.0

type MapperSvc interface {
	MapAccount(ctx context.Context, acc *database.Account) *gomoneypbv1.Account
}

type RecalculateSvc added in v0.2.0

type RecalculateSvc interface {
	RecalculateAll(
		ctx context.Context,
	) error
}

type RulesApi

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

func NewRulesApi

func NewRulesApi(
	mux *boilerplate.DefaultGrpcServer,
	cfg *RulesApiConfig,
) *RulesApi

func (*RulesApi) CreateScheduleRule added in v0.1.1

func (*RulesApi) DeleteScheduleRule added in v0.1.1

func (*RulesApi) ListScheduleRules added in v0.1.1

func (*RulesApi) UpdateScheduleRule added in v0.1.1

type RulesApiConfig added in v0.1.1

type RulesApiConfig struct {
	RulesScheduleSvc RulesScheduleSvc
	RuleSvc          RulesSvc
	DryRunSvc        DryRunSvc
	SchedulerSvc     SchedulerSvc
}

type SchedulerSvc added in v0.1.1

type SchedulerSvc interface {
	ValidateCronExpression(cronExpression string) error
}

type TagsApi

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

func NewTagsApi

func NewTagsApi(
	mux *boilerplate.DefaultGrpcServer,
	tagSvc TagSvc,
) *TagsApi

type TransactionApi

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

func NewTransactionApi

func NewTransactionApi(
	mux *boilerplate.DefaultGrpcServer,
	transactionsSvc TransactionsSvc,
	applicableAccountSvc ApplicableAccountSvc,
	mapper MapperSvc,
) *TransactionApi

type TransactionHistoryApi added in v1.2.0

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

func NewTransactionHistoryApi added in v1.2.0

type TransactionHistoryMapper added in v1.2.0

type TransactionHistoryMapper interface {
	MapTransactionHistoryEvent(row *database.TransactionHistory) *historyv1.TransactionHistoryEvent
}

type TransactionHistorySvc added in v1.2.0

type TransactionHistorySvc interface {
	List(ctx context.Context, transactionID int64) ([]*database.TransactionHistory, error)
}

type UserApi

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

func NewUserApi

func NewUserApi(
	mux *boilerplate.DefaultGrpcServer,
	userSvc UserSvc,
) (*UserApi, error)

type UserSvc

type UserSvc interface {
	Login(
		ctx context.Context,
		req *usersv1.LoginRequest,
	) (*usersv1.LoginResponse, error)

	Create(
		ctx context.Context,
		req *usersv1.CreateRequest,
	) (*usersv1.CreateResponse, error)
}

Jump to

Keyboard shortcuts

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