Documentation ¶
Index ¶
- Constants
- Variables
- func NewSchema(folderPath, logo string, doSave, interactive, distMode bool) schema.Schema
- func OpenSchema(path string) schema.Schema
- type Acc
- func (a *Acc) AppendExpensesSuffix(suffix string, overwrite bool)
- func (a *Acc) AppendInvoiceSuffix(suffix string, overwrite bool)
- func (a Acc) Conditions() util.Conditions
- func (a Acc) NewDistributedModeAcc(repoPath string) Acc
- func (a Acc) Save(path string)
- func (a Acc) SaveSchema(s schema.Schema)
- func (a Acc) SaveSchemaToFolder(s schema.Schema)
- func (a Acc) String() string
- func (a Acc) Type() string
- func (a Acc) Validate() util.ValidateResults
Constants ¶
const DefaultConfigFile = "acc.yaml"
DefaultConfigFile states the default name of the config/project file.
Variables ¶
var DefaultProjectFiles = []string{ DefaultConfigFile, schema.DefaultExpensesFile, schema.DefaultInvoicesFile, schema.DefaultMiscRecordsFile, schema.DefaultPartiesFile, schema.DefaultProjectsFile, schema.DefaultStatementFile, }
DefaultProjectFiles contains the default names of all the project files of flat mode. This is used to check if a Acc project is present in a given folder.
Functions ¶
func OpenSchema ¶
OpenSchema reads first the Acc file and then tries to open all linked files.
Types ¶
type Acc ¶
type Acc struct { // Company contains the information about the organisation which uses acc. Company schema.Company `yaml:"company" default:""` JournalConfig schema.JournalConfig `yaml:"journalConfig" default:""` Currency string `yaml:"currency" default:"CHF"` DistributedMode bool `yaml:"distributedMode" default:"false"` ExpensesFilePath string `yaml:"expensesFilePath" default:"expenses.yaml"` InvoicesFilePath string `yaml:"invoicesFilePath" default:"invoices.yaml"` MiscRecordsFilePath string `yaml:"miscRecordsFilePath" default:"misc.yaml"` PartiesFilePath string `yaml:"partiesFilePath" default:"parties.yaml"` ProjectsFilePath string `yaml:"projectsFilePath" default:"projects.yaml"` StatementFilePath string `yaml:"statementFilePath" default:"bank.yaml"` FileName string `yaml:"-"` }
Acc represents an entry point into the utils and also provides general information.
func (*Acc) AppendExpensesSuffix ¶
func (*Acc) AppendInvoiceSuffix ¶
func (Acc) Conditions ¶
func (a Acc) Conditions() util.Conditions
Conditions returns the validation conditions.
func (Acc) NewDistributedModeAcc ¶
NewDistributedModeAcc acc takes a flat file acc configuration file and returns the new structure for a config file in project (aka. folder) mode.
func (Acc) Save ¶
Save writes the element as a json to the given path. Indented states whether «prettify» the json output.
func (Acc) SaveSchema ¶
func (Acc) SaveSchemaToFolder ¶
SaveProjectToFolder saves all files linked in the Acc config to the base folder defined in the schema.
func (Acc) Validate ¶
func (a Acc) Validate() util.ValidateResults
Validate the element and return the result.