lib

package
v0.0.0-...-bca9761 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2017 License: ISC Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitLog

func InitLog(c *Configuration)

InitLog starts log.

func Mkdir

func Mkdir(dir string)

Mkdir Create out dir if not exist, only one deep

func MkdirAll

func MkdirAll(dir string)

MkdirAll Create out dir if not exist recursivly

Types

type Configuration

type Configuration struct {
	////////////////////
	//Config variables from config file
	////////////////////
	//In
	InFlatFile string
	InDir      string
	InFileExt  string

	//Out
	OutDir string
	OutLog string
	//Lines
	OutLinesName          string
	OutLinesErrorName     string
	OutLinesColumns       string
	OutLinesRowOffset     int64
	OutLinesDuplicateName string
	//Files
	OutFileExt             string
	OutFileRenameInt       bool
	OutFileRenameIntOffset int64
	OutXtenderStructure    bool
	OutZipped              bool
	OutZippedDeleteSource  bool
	//AutoBatch
	OutAutoBatch        bool
	OutAutoBatchCount   int64
	OutAutoBatchName    string
	OutAutoBatchZeroPad int

	//Missing
	Missing      bool
	MissingIn    string
	MissingCount int64

	//Global
	//Applies to both in and out
	DirDepth        int
	FolderSize      int
	Delimiter       string
	ComputeChecksum bool

	//Columns
	ColObjectID   int
	ColFileName   int
	ColFileExtIn  int
	ColFileExtOut int
	// contains filtered or unexported fields
}

Configuration stores settings from config.json And internally calculated configs See README for description of each variable.

func (*Configuration) Parse

func (c *Configuration) Parse(configFile string)

Parse parses config file into memory

func (*Configuration) Process

func (c *Configuration) Process()

Process Creates output files and directories and calls processIndex

type Line

type Line struct {
	*Configuration
	Line    string   //String of the entire line
	Columns []string //Parsed columns
	ID      int64    //Calculated uniqueobject ID.  Used for path calculation.
	LastID  int64    //Remeber last object ID processed.  Prevents duplicates.
	Dir     string   //Directory of object file
	Path    string   //Full path of object calc. from objectID
	File    *os.File //File to write the line out to
	// contains filtered or unexported fields
}

Line represents line contents and settings.

func (*Line) GenLineFromColumns

func (l *Line) GenLineFromColumns() (err error)

GenLineFromColumns Instead of copying the line from flat in, grab only some columns and write those to out.

func (*Line) GetBatch

func (l *Line) GetBatch() string

GetBatch Return the batch name, including incrementer

func (*Line) GetInPath

func (l *Line) GetInPath() (fullPath string, err error)

GetInPath Get full path for file in

func (*Line) GetOutPath

func (l *Line) GetOutPath() (out string, err error)

GetOutPath Get full path for out file

func (*Line) GetPathFromID

func (l *Line) GetPathFromID() (p string, e error)

GetPathFromID Calculate the ApplicationXtender from a given object id, s See README for examples and further explaination.

func (*Line) OutLineFile

func (l *Line) OutLineFile()

OutLineFile Create the "OutLines" file. Should call defer os.Close

func (*Line) ProcessLine

func (l *Line) ProcessLine() (b bool)

ProcessLine copies file to output. Returns false in the event of error or empty

Jump to

Keyboard shortcuts

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