Documentation ¶
Index ¶
- type Factory
- type Postgres
- func (p *Postgres) Add(table string, values map[string]string) error
- func (p *Postgres) Delete(table string, values map[string]string) error
- func (p *Postgres) Exists(table string, values map[string]string) (bool, error)
- func (p *Postgres) Get(table string, values map[string]string, columns ...string) ([]map[string]string, error)
- func (p *Postgres) Set(table string, values, cond map[string]string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
Factory is initialized with the config file and then used to make client data objects of the appropriate type when clients are created.
func NewFactory ¶
func NewFactory(databaseLogin, databasePassword, databaseName, databaseIP, databasePort string) (*Factory, error)
NewFactory creates a new clientdata factory using a postgres datastore.
func (*Factory) Create ¶
func (cdf *Factory) Create(name string) clientdata.ClientData
Create returns a ClientData object of the type for the factory.
type Postgres ¶
type Postgres struct {
// contains filtered or unexported fields
}
Postgres is a type of datastore using a postgresql database.
func NewPostgres ¶
func NewPostgres(databaseLogin, databasePassword, databaseName, databaseIP, databasePort string) (*Postgres, error)
NewPostgres sets up the connection to the database and returns a Postgres datastore.
func (*Postgres) Exists ¶
Exists takes a table to check and a map representing a row to compare to and returns true if there is a match in the database.
Click to show internal directories.
Click to hide internal directories.