Documentation
¶
Index ¶
Constants ¶
View Source
const DefaultConnectionString = "postgres://%s:%s@localhost:5432/%s?sslmode=disable"
DefaultConnectionString is the default string for formatting
View Source
const DefaultType = "postgres"
DefaultType is the default database type
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Info ¶
Info represents the connection details
func NewDefaultInfo ¶
NewDefaultInfo creates database info type
func (*Info) ConnectionString ¶
ConnectionString returns the formatted connection string
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository that reprents the access to the underlying database
func NewDefaultRepository ¶
func NewDefaultRepository() (*Repository, error)
NewDefaultRepository returns production database access
func NewRepository ¶
func NewRepository(info *Info) (*Repository, error)
NewRepository returns production database access
func (*Repository) Create ¶
func (r *Repository) Create(entity interface{}) error
Create the entity in the database
func (*Repository) Migrate ¶
func (r *Repository) Migrate(entities []interface{}) error
Migrate placeholder for service specific migration
func (*Repository) Open ¶
func (r *Repository) Open() error
Open the database and sets the underlying configuration
func (*Repository) Ping ¶
func (r *Repository) Ping() error
Ping pings the underlying database to ensure it's contactable
Click to show internal directories.
Click to hide internal directories.