sawari

package module
v0.0.0-...-85c9bc4 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2020 License: MIT Imports: 8 Imported by: 0

README

Sawari

CLI to automate fuel receipt

Example Output can be viewed here 🚀

Install

if you have your $GOPATH configured
go get -u github.com/minhajuddinkhan/sawari/bin/sawari
if you don't
(linux)
wget https://github.com/minhajuddinkhan/sawari/releases/download/v1.0/sawari-linux  
chmod +x sawari-linux
sudo mv sawari-linux /bin/sawari
(macOS)
curl https://github.com/minhajuddinkhan/sawari/releases/download/v1.0/sawari-darwin -Lo sawari
chmod +x sawari
cp sawari /usr/local/bin/

Usage

sawari form --env [path-to-env-file]
Your env file should look like this
NAME="Minhaj Uddin Khan"
EMPLOYEE_CODE="877"
CEILING="5000"
DESIGNATION="Senior Software Developer (Grade -1)"
NOTE: If env not provided, the cli will prompt for information

Documentation

Index

Constants

View Source
const (
	// RectStartingX  .
	RectStartingX = 25
	// RectStartingY .
	RectStartingY = 100
)
View Source
const (

	// HeaderBoxHeight standard height of a cell
	HeaderBoxHeight = 7
	// HeaderBoxWidth standard width of a cell
	HeaderBoxWidth = 80
)

Variables

This section is empty.

Functions

func MakeBody

func MakeBody(pdf *gofpdf.Fpdf, entries []Entry, totalAmount int)

MakeBody makes body

func MakeHeader

func MakeHeader(pdf *gofpdf.Fpdf, creds Creds) error

MakeHeader generates header

func TakeInput

func TakeInput(msg string) string

Types

type Creds

type Creds struct {
	Name           string
	EmployeeCode   string
	Designation    string
	MonthlyCeiling string
}

Creds Creds

func NewCreds

func NewCreds() Creds

NewCreds gives credentials

type Entry

type Entry struct {
	Serial      int
	Date        string
	Description string
	Amount      string
}

Entry Entry

Directories

Path Synopsis
bin
sawari command

Jump to

Keyboard shortcuts

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