Documentation
¶
Index ¶
- Constants
- type Database
- type Service
- func (s *Service) AdaptPostgresModelToTypeLogbook(m *pgmodels.Logbook) (types.Logbook, error)
- func (s *Service) AdaptPostgresModelToTypeQso(m *pgmodels.Qso) (types.Qso, error)
- func (s *Service) AdaptSqliteModelToTypeLogbook(m *sqmodels.Logbook) (types.Logbook, error)
- func (s *Service) AdaptSqliteModelToTypeQso(m *sqmodels.Qso) (types.Qso, error)
- func (s *Service) AdaptTypeToPostgresModelLogbook(lb types.Logbook) (*pgmodels.Logbook, error)
- func (s *Service) AdaptTypeToPostgresModelQso(q types.Qso) (*pgmodels.Qso, error)
- func (s *Service) AdaptTypeToSqliteModelLogbook(lb types.Logbook) (*sqmodels.Logbook, error)
- func (s *Service) AdaptTypeToSqliteModelQso(q types.Qso) (*sqmodels.Qso, error)
- func (s *Service) BeginTxContext(ctx context.Context) (*sql.Tx, context.CancelFunc, error)
- func (s *Service) Close() error
- func (s *Service) DeleteQso(id int64) error
- func (s *Service) DeleteQsoContext(ctx context.Context, id int64) error
- func (s *Service) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
- func (s *Service) FetchQsoById(id int64) (types.Qso, error)
- func (s *Service) FetchQsoByIdContext(ctx context.Context, id int64) (types.Qso, error)
- func (s *Service) Initialize() error
- func (s *Service) InsertLogbook(logbook types.Logbook) (types.Logbook, error)
- func (s *Service) InsertLogbookContext(ctx context.Context, logbook types.Logbook) (types.Logbook, error)
- func (s *Service) InsertQso(qso types.Qso) (types.Qso, error)
- func (s *Service) InsertQsoContext(ctx context.Context, qso types.Qso) (types.Qso, error)
- func (s *Service) LogStats(prefix string)
- func (s *Service) Migrate() error
- func (s *Service) Open() error
- func (s *Service) Ping() error
- func (s *Service) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
- func (s *Service) UpdateQso(qso types.Qso) error
- func (s *Service) UpdateQsoContext(ctx context.Context, qso types.Qso) error
Constants ¶
const ( ServiceName = types.DatabaseServiceName PostgresDriver = "postgres" SqliteDriver = "sqlite" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
ConfigService *config.Service `di.inject:"configservice"`
Logger *logging.Service `di.inject:"loggingservice"`
DatabaseConfig *types.DatastoreConfig
// contains filtered or unexported fields
}
func (*Service) AdaptPostgresModelToTypeLogbook ¶ added in v0.0.8
AdaptPostgresModelToTypeLogbook adapts postgres model Logbook to types.Logbook.
func (*Service) AdaptPostgresModelToTypeQso ¶ added in v0.0.8
AdaptPostgresModelToTypeQso adapts postgres model to types.Qso.
func (*Service) AdaptSqliteModelToTypeLogbook ¶ added in v0.0.8
AdaptSqliteModelToTypeLogbook adapts sqlite model Logbook to types.Logbook.
func (*Service) AdaptSqliteModelToTypeQso ¶ added in v0.0.8
AdaptSqliteModelToTypeQso adapts sqlite model to types.Qso.
func (*Service) AdaptTypeToPostgresModelLogbook ¶ added in v0.0.8
AdaptTypeToPostgresModelLogbook adapts a types.Logbook into a postgres model Logbook.
func (*Service) AdaptTypeToPostgresModelQso ¶ added in v0.0.8
AdaptTypeToPostgresModelQso adapts a types.Qso into a postgres model Qso.
func (*Service) AdaptTypeToSqliteModelLogbook ¶ added in v0.0.8
AdaptTypeToSqliteModelLogbook adapts a types.Logbook into a sqlite model Logbook.
func (*Service) AdaptTypeToSqliteModelQso ¶ added in v0.0.8
AdaptTypeToSqliteModelQso adapts a types.Qso into a sqlite model Qso.
func (*Service) BeginTxContext ¶
BeginTxContext starts a new transaction.
func (*Service) DeleteQso ¶ added in v0.0.8
DeleteQso delegates to DeleteQsoContext with a background context.
func (*Service) DeleteQsoContext ¶ added in v0.0.8
DeleteQsoContext deletes a QSO with a caller-provided context.
func (*Service) ExecContext ¶
func (*Service) FetchQsoById ¶ added in v0.0.7
func (*Service) FetchQsoByIdContext ¶ added in v0.0.8
func (*Service) Initialize ¶
Initialize initializes the database service. No constructor is provided as this service is to be initialized within an IOC/DI container.
func (*Service) InsertLogbook ¶ added in v0.0.8
func (*Service) InsertLogbookContext ¶ added in v0.0.8
func (*Service) InsertQso ¶ added in v0.0.7
InsertQso inserts a QSO using a background context with default timeout semantics.
func (*Service) InsertQsoContext ¶ added in v0.0.8
InsertQsoContext inserts a QSO with caller-provided context. If the context has no deadline, a default timeout is applied.