tingparse

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateSplit

func CalculateSplit(min map[string]int, msg map[string]int, meg map[string]int, bil tingbill.Bill) (tingbill.BillSplit, error)

CalculateSplit accepts 3 map[string]int, one tingbill.Bill, and returns a tingbill.BillSplit and an error. The maps are for usage results from ParseMinutes, ParseMessages

func ParseBill

func ParseBill(r io.Reader) (tingbill.Bill, error)

ParseBill accepts an io.Reader from a bill.toml file, and returns a tingbill.Bill with relevant data, or an error. The data is later used to calculate cost splits against device usage.

func ParseMegabytes

func ParseMegabytes(megReader io.Reader) (map[string]int, error)

ParseMegabytes accepts an io.Reader from a megabytes csv file, and returns a map containing usage data, or an error. The map's keys are `deviceID`s and the value is how much data that device used in the billable month.

func ParseMessages

func ParseMessages(msgReader io.Reader) (map[string]int, error)

ParseMessages accepts an io.Reader from a messages csv file, and returns a map containing usage data, or an error. The map's keys are `deviceID`s and the value is how many messages that device used in the billable month.

func ParseMinutes

func ParseMinutes(minReader io.Reader) (map[string]int, error)

ParseMinutes accepts an io.Reader from a minutes csv file, and returns a map containing usage data, or an error. The map's keys are `deviceID`s and the value is how many minutes that device used in the billable month.

Types

This section is empty.

Jump to

Keyboard shortcuts

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