Documentation ¶
Index ¶
- Variables
- func Wait(ctx context.Context, db driver.Pinger, checkPeriod time.Duration)
- type Database
- type Gorm
- func (db *Gorm) Close() error
- func (db *Gorm) Connect(ctx context.Context, cfg config.Database) error
- func (db *Gorm) CreateState(s State) error
- func (db *Gorm) DB() *gorm.DB
- func (db *Gorm) DeleteState(s State) error
- func (db *Gorm) Ping(ctx context.Context) error
- func (db *Gorm) State(indexName string) (s State, err error)
- func (db *Gorm) UpdateState(s State) error
- type PgGo
- func (db *PgGo) Close() error
- func (db *PgGo) Connect(ctx context.Context, cfg config.Database) error
- func (db *PgGo) CreateState(s State) error
- func (db *PgGo) DB() *pg.DB
- func (db *PgGo) DeleteState(s State) error
- func (db *PgGo) Ping(ctx context.Context) error
- func (db *PgGo) State(indexName string) (s State, err error)
- func (db *PgGo) UpdateState(s State) error
- type State
- type StateRepository
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrConnectionIsNotInitialized = errors.New("connection is not initialized") ErrUnsupportedDatabaseType = errors.New("unsupported database type") )
errors
Functions ¶
Types ¶
type Database ¶
type Database interface { Connect(ctx context.Context, cfg config.Database) error StateRepository driver.Pinger io.Closer }
Database -
type Gorm ¶
type Gorm struct {
// contains filtered or unexported fields
}
Gorm -
type PgGo ¶
type PgGo struct {
// contains filtered or unexported fields
}
PgGo -
type State ¶
type State struct { IndexName string `gorm:"primaryKey" pg:",pk" json:"index_name"` IndexType string `json:"index_type"` Hash string `json:"hash,omitempty"` Level uint64 `json:"level"` UpdatedAt int `gorm:"autoUpdateTime"` // contains filtered or unexported fields }
State -
func (*State) BeforeInsert ¶
BeforeInsert -
func (*State) BeforeUpdate ¶
BeforeUpdate -
Click to show internal directories.
Click to hide internal directories.