export

package
v1.0.0-alpha.17 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: Apache-2.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package export writes a rows file in the import format of another cost tool: FOCUS 1.4 CSV, a Vantage custom provider's CSV, or Datadog's Custom Costs CSV. Every amount leaves as the row wrote it. Nothing is converted, rounded or added up, and a tool that takes one currency refuses a row in another.

Index

Constants

This section is empty.

Variables

View Source
var ErrNoRows = errors.New("the rows file holds no rows")

ErrNoRows is a rows file that holds no row, of which no format writes a file.

Formats are the formats in the order the help names them.

Functions

This section is empty.

Types

type Export

type Export struct {
	Files []File
	// OmittedTags are the tag keys a Datadog file has no column for, because
	// a row lacks them and Datadog takes no blank cell.
	OmittedTags []string
}

Export is what a format made of a rows file.

func Write

func Write(format Format, lines io.Reader) (Export, error)

Write reads rows as JSON lines and writes them in format. A line that is not a row of the contract refuses the export, as does a row the format cannot take, and nothing is written.

type File

type File struct {
	Body []byte
	Rows int
}

File is one file of an export and the number of rows it holds.

type Format

type Format string

Format is a value of costroid export --format.

const (
	FocusCSV Format = "focus-csv"
	Vantage  Format = "vantage"
	Datadog  Format = "datadog"
)

The formats export writes.

func ParseFormat

func ParseFormat(name string) (Format, error)

ParseFormat reads a --format value.

type RowsError

type RowsError struct {
	Format Format
	Rows   []string
	Reason string
}

RowsError refuses rows a format cannot take. It names the first 10 and counts the rest.

func (*RowsError) Error

func (e *RowsError) Error() string

Jump to

Keyboard shortcuts

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