Documentation
¶
Index ¶
- func EnsureDBExists(cfg *config.Config) error
- func TestDBExistence(cfg *config.Config) error
- func TestDBHost(cfg *config.Config) error
- type Client
- type Invoices
- func (db *Invoices) AddClient(c *Client) (int64, error)
- func (db *Invoices) GetAllClients() ([]*Client, error)
- func (db *Invoices) GetClient(id int64) *Client
- func (db *Invoices) GetClients(keyword string) ([]*Client, error)
- func (db *Invoices) RemoveClient(keyword string) error
- func (db *Invoices) UpdateClient(c *Client) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureDBExists ¶
EnsureDBExists creates the database and the correct tables.
func TestDBExistence ¶
TestDBExistence checks for the host and the database.
Types ¶
type Client ¶
type Client struct {
// ID is autogenerated.
ID int64
// Company is the primary string reference.
Company string
// Email is the primary contact. Add to the contacts table for more.
Email string
// Phone if applicable.
Phone string
// Address to print on invoices.
Address string
// VATID or org. no.
VATID string
// Created timestamp.
Created time.Time
}
Client structure translated from the database.
type Invoices ¶
Invoices is the name of our DB type to make it clear this isn't generic.
func (*Invoices) GetAllClients ¶
GetAllClients returns all clients.
func (*Invoices) GetClients ¶
GetClients returns all matching clients.
func (*Invoices) RemoveClient ¶
func (*Invoices) UpdateClient ¶
UpdateClient changes the details of a client.
Click to show internal directories.
Click to hide internal directories.