Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoEnv error = errors.New("no env variable provided -- ensure that the environment variables for POSTGRES_USER and POSTGRES_PASSWORD are set") ErrMissingUser error = errors.New("unset Postgres user variable: please export the POSTGRES_USER variable") ErrMissingPassword error = errors.New("unset Postgres password variable: please export the POSTGRES_PASSWORD variable") ErrMissingDatabase error = errors.New("unset Postgres database variable: please export the POSTGRES_DATABASE variable") )
Functions ¶
func New ¶
func New(address, port, database string) (sqldb io.WriteCloser, err error)
New function will take in a postgres DB address, port and database name; and create a new instance of a Postgres object; returning an io.WriteCloser and an error.
func WithPostgres ¶
func WithPostgres(addr, port, database string) log.LoggerConfig
WithPostgres function takes in an address and port to a Postgres server, and a database name; and returns a LoggerConfig so that this type of writer is defined in a Logger
Types ¶
type Postgres ¶
type Postgres struct {
// contains filtered or unexported fields
}
func (*Postgres) Close ¶
Close method is implemented for compatibility with the Database interface.
While this ORM doesn't force users to close the connection, MongoDB does, and the method should be available for use
Click to show internal directories.
Click to hide internal directories.