calc

package
v0.0.0-...-67051ba Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package calc provides the core business API. This layer wraps handles all the logic needed to execute operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Core

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

Core manages the set of APIs for user access.

func NewCore

func NewCore(log *logger.Logger) *Core

NewCore constructs a core for user api access.

func (*Core) Execute

func (c *Core) Execute(ctx context.Context, text string) (Result, error)

Execute iterates splits the string into sections and then it iterates them executing all operations inside, to have a final result

type Result

type Result struct {
	Total    float64   `json:"total"`
	SumGroup []float64 `json:"sumGroup"`
}

Result represents the Execute API web response.

Jump to

Keyboard shortcuts

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