项目作者: takatoshiono

项目描述 :
csvmask is a CSV masking tool
高级语言: Go
项目地址: git://github.com/takatoshiono/csvmask.git
创建时间: 2019-08-21T13:06:10Z
项目社区:https://github.com/takatoshiono/csvmask

开源协议:

下载


csvmask CircleCI codecov

csvmask is a CSV masking tool.

Usage

  1. Prepare CSV encoded data
  1. $ cat testdata/test.csv
  2. "ID","Name","Address"
  3. 4085ff59-39bd-4cc3-8a55-c5b1c6785922,Adam Smith,Kirkcaldy United Kingdom
  1. Create template
  1. {{.Field1}},{{hash .Field2}},{{.Field3}}
  1. Execute csvmask with template
  1. $ cat testdata/test.csv | csvmask -template "{{.Field1}},{{hash .Field2}},{{.Field3}}" -skipheader
  2. ID,Name,Address
  3. 4085ff59-39bd-4cc3-8a55-c5b1c6785922,PbZ8hc4alo56RYc9/m+vECyVdjHqZRGMlxUGigh3/uE,Kirkcaldy United Kingdom

Template

The template is a text of text/template package of Go.

Arguments

The fields of CSV record can be referred as arguments. The name is preceeded by a period such as

  • .Field1
  • .Field2
  • .Field3

Functions

The following functions are defined.

  • hash
  • checksum
  • right
  • left

Installation

Just get binaries

Go to the releases page and download zip file.

go get

  1. $ go get -u github.com/takatoshiono/csvmask

Build yourself

First clone the repository and

  1. $ make install