contacts

command module
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

README

Contacts

It eases maintenance of database contacts (structure defined in eztools and database).

command line parameters

  • -h, --help, --version: show version and help info
  • -log {file name}: log to the file
  • -v, -vv, -vvv: enable verbose logging
  • -imp {file name}: import from a file, better to be used with -enc, if not UTF-8
    It must contain header and content, with fields separated by commas.
    Key fields must be included, to match a line to an existing record.
  • -exp {file name}: export to a file, better to be used with -enc, if not UTF-8
    If the file already exists, it must contain at least field list as the first line. Only listed fields are exported.
    With no fields above given, all fields are exported.
    Fields separated by commas.
  • -enc {encoding}: encoding of the import file. {encoding} may be
    • gbk

config file

EZTools' config file is needed. Refer to readme and sample file of the project.

database

Database is specified in config file and needs to consist following fields in tables,

table chore

The name "chore" is specified in config file

  • Table names, mandatory
  • Field names, mandatory, for TblContacts, if not specified otherwise
    • FldLeader. for TblTeam. "leader" as in sample.
    • FldName. "name" as in sample.
    • FldNick. "nick" as in sample.
    • FldTeam. "team" as in sample.
    • FldNumber. "number" as in sample.
  • record ID's for auto update, optional.
    • contactsApp: app name on update server
    • contactsDir: dir name on update server
    • contactsUrl: URL of update server
    • contactsUrlDev: URL of update server for tests. A version "dev" or empty is a test version.
INSERT INTO TABLE chore (id, str) VALUES ("TblContacts", "contacts");
INSERT INTO TABLE chore (id, str) VALUES ("TblTeam", "team");
INSERT INTO TABLE chore (id, str) VALUES ("FldLeader", "leader");
INSERT INTO TABLE chore (id, str) VALUES ("FldName", "name");
INSERT INTO TABLE chore (id, str) VALUES ("FldNick", "nick");
INSERT INTO TABLE chore (id, str) VALUES ("FldTeam", "team");
INSERT INTO TABLE chore (id, str) VALUES ("FldNumber", "number");
INSERT INTO TABLE chore (id, str) VALUES ("contactsApp", "contacts");
INSERT INTO TABLE chore (id, str) VALUES ("contactsDir", "public/");
INSERT INTO TABLE chore (id, str) VALUES ("contactsUrl", "http://1.1.1.1:8080/");
INSERT INTO TABLE chore (id, str) VALUES ("contactsUrlDev", "http://1.1.1.1:8081/");

table contacts

Field ID whose name same as in table chore should be auto generated.
Fields must exist with names specified in table chore. Order is flexible.
Other fields are optional and may scatter among mandatory fields.

field type configured in chore
id int the primary key
name string FldName
nick string FldNick
number string FldNumber
team int FldTeam
CREATE TABLE contacts (id TINYINT AUTOINCREMENT, number TINYTEXT, name TINYTEXT NOT NULL, team TINYINT, ext TINYTEXT, phone TINYTEXT, mail TINYTEXT NOT NULL, ldap TINYTEXT, uid TINYTEXT, PRIMARY KEY(id)) CHARSET=utf8;

table team

Field ID whose name same as in table chore should be auto generated.
Field str whose name same as in table chore must exist.
Field leader whose name set in table chore must exist.

field type configured in chore
id int the primary key
str string the second field
leader int FldLeader
CREATE TABLE team (id TINYINT AUTOINCREMENT, str TINYTEXT, leader TINYINT, PRIMARY KEY(id));

operations

  1. Exit
  2. Add a contact
  3. Modify a contact
  4. Delete a contact
  5. Assign a team leader
  6. Rename a team
  7. Delete a team

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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