Documentation ¶
Index ¶
Constants ¶
View Source
const ServiceName = "sqlite3"
ServiceName defines the name of sqlite3 service used for dependency injection
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockService ¶
type MockService struct { gousu.MockService GetDBFunc func() *sql.DB GetDBSafeFunc func() (*sql.DB, error) GetDBFuncCalled int GetDBSafeFuncCalled int }
MockService for simply mocking IService
func NewMockService ¶
func NewMockService() *MockService
NewMockService creates a new initialized instance of MockService
func (*MockService) GetDB ¶
func (s *MockService) GetDB() *sql.DB
GetDB calls GetDBFunc and increases GetDBFuncCalled
type Options ¶
type Options struct { // SetupSQL can contain the content of a sql-file for updating the // database on startup SetupSQL string // UpdateSQL can contain the content of a sql-file for updating the // database on startup UpdateSQL string // GetDBRevisionSQL can be used for retrieving the revision of the database // used, must return/select one integer field GetDBRevisionSQL string // OpenFunc can be used to override the default sql.Open OpenFunc func(driverName string, dataSourceName string) (*sql.DB, error) }
Options can contain parameters passed to the sqlite3 service
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service provides the interaction with the sqlite3 database
func NewServiceBase ¶
NewServiceBase creates a new instance of sqlite3-service, should be used instead
of generating it manually
func (*Service) Health ¶
Health checks the health of the sqlite3-service by pinging the sqlite3 database
Click to show internal directories.
Click to hide internal directories.