ngos

package module
v0.0.0-...-64a8391 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2019 License: Apache-2.0 Imports: 9 Imported by: 1

README

ngos

Go Report Card

(EXPERIMENTAL, there are still many bugs)

Tool for comparing two CSV files, and create the output of the difference. Ngos can compare millions of lines of csv file just in second.

TODO:

  • Implement Concurrency
Usage
  • Build binary from source
$ go get github.com/Bhinneka/ngos

$ go install github.com/Bhinneka/ngos/cmd/ngos

$ ngos -v
$ ngos -old old_file.csv -new new_file.csv -o output.csv

Which is

  • old_file.csv
Los Angeles,34°03′N,118°15′W
New York City,40°42′46″N,74°00′21″W
Paris,48°51′24″N,2°21′03″E
  • new_file.csv
Los Angeles,34°03′N,118°15′W
New York City,40°42′46″N,74°00′21″W
Paris,48°51′24″N,2°21′03″E
Jakarta,48°51′24″N,2°21′03″W

  • output.csv
Jakarta,48°51′24″N,2°21′03″W

Documentation

Index

Constants

View Source
const (
	// Version ,  the version of Ngos
	Version = "0.0.0"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Arguments

type Arguments struct {
	OldCSVFile    string
	NewCSVFile    string
	OutputCSVFile string
	ShowVersion   bool
	Help          func()
}

Arguments struct will hold flag and arguments from stdin

func ParseArgs

func ParseArgs() (*Arguments, error)

ParseArgs function, this function will parse flag and arguments from stdin to Argumetns struct

type CSVReader

type CSVReader struct {
}

CSVReader struct

func (CSVReader) Read

func (CSVReader) Read(path string) ([][]string, error)

Read function

type CSVWriter

type CSVWriter struct {
}

CSVWriter struct

func (CSVWriter) Write

func (CSVWriter) Write(datas [][]string, output string) error

Write function

type Ngos

type Ngos struct {
	Reader Reader
	Writer Writer
	Args   *Arguments
}

Ngos struct

func New

func New(args *Arguments) *Ngos

New function return *Ngos

func (*Ngos) Run

func (n *Ngos) Run()

Run function, will Run Ngos

type Reader

type Reader interface {
	Read(string) ([][]string, error)
}

Reader interface

type Writer

type Writer interface {
	Write([][]string, string) error
}

Writer interface

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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