Documentation ¶
Index ¶
- Variables
- type ByAge
- type Migration
- type Migrations
- type PostgresDataSource
- func (p *PostgresDataSource) AggregateType(q straumur.Query, s string) (map[string]int, error)
- func (p *PostgresDataSource) GetById(id int) (*straumur.Event, error)
- func (p *PostgresDataSource) Query(q straumur.Query) ([]*straumur.Event, error)
- func (p *PostgresDataSource) Save(e *straumur.Event) (err error)
- type StringSlice
- type TransactionFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var MigrationTuples = make(map[string]string)
Functions ¶
This section is empty.
Types ¶
type Migrations ¶
type Migrations []Migration
func (Migrations) FilterDates ¶
func (m Migrations) FilterDates(t []time.Time) (nm Migrations)
Returns a new Migration array with the provided dates filtered out
func (Migrations) Len ¶
func (m Migrations) Len() int
func (Migrations) Swap ¶
func (m Migrations) Swap(i, j int)
type PostgresDataSource ¶
type PostgresDataSource struct {
// contains filtered or unexported fields
}
func NewPostgresDataSource ¶
func NewPostgresDataSource(connection string) (*PostgresDataSource, error)
Creates a new PostgresDataSource
func (*PostgresDataSource) AggregateType ¶
func (*PostgresDataSource) GetById ¶
func (p *PostgresDataSource) GetById(id int) (*straumur.Event, error)
Gets an event by id
type StringSlice ¶
type StringSlice []string
func (*StringSlice) Scan ¶
func (s *StringSlice) Scan(src interface{}) error
Implements sql.Scanner for the String slice type Scanners take the database value (in this case as a byte slice) and sets the value of the type. Here we cast to a string and do a regexp based parse
type TransactionFunc ¶
Callback for a managed transaction
Example:
err := p.wrapTransaction(func(tx *sql.Tx) error { rows, err := tx.Query(query, args...) if err != nil { return err } }
Click to show internal directories.
Click to hide internal directories.