usecase

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMixedCurrenciesDataSourceIsNotSupported = errors.New("usecase: mixed currencies data source is not supported")

Functions

This section is empty.

Types

type IDomain

type IDomain interface {
	PlotGraph(target io.Writer, ps *domain.PlotGraphParameters) error
}

type IInfra

type IInfra interface {
	SaveImage(ctx context.Context, image []byte, imageName string, message string) error
}

type IRepository

type IRepository interface {
	SUMServiceCostGCPAsc(ctx context.Context, billingTable string, billingProject string, from time.Time, to time.Time, tz *time.Location, costThreshold float64) ([]domain.GCPServiceCost, error)
	DailyServiceCostGCP(ctx context.Context, billingTable string, billingProject string, from time.Time, to time.Time, tz *time.Location, costThreshold float64) ([]domain.GCPServiceCost, error)
	DailyServiceCostGCPMapByService(servicesOrderBySUMServiceCostGCP []string, dailyServiceCostGCP []domain.GCPServiceCost) map[string][]domain.GCPServiceCost
}

type Option

type Option func(r *UseCase) *UseCase

func WithDomain

func WithDomain(d *domain.Domain) Option

func WithInfra

func WithInfra(i *infra.Infra) Option

func WithRepository

func WithRepository(r *repository.Repository) Option

type PlotDailyServiceCostGCPParameters

type PlotDailyServiceCostGCPParameters struct {
	BillingTable   string
	BillingProject string
	From           time.Time
	To             time.Time
	TimeZone       *time.Location
	ImageFormat    string
	Message        string
}

type UseCase

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

func New

func New(opts ...Option) *UseCase

func (*UseCase) PlotDailyServiceCostGCP

func (u *UseCase) PlotDailyServiceCostGCP(ctx context.Context, buf *bytes.Buffer, ps *PlotDailyServiceCostGCPParameters) error

Jump to

Keyboard shortcuts

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