Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service interface { // Health returns a map of health status information. // The keys and values in the map are service-specific. Health() map[string]string // Close terminates the database connection. // It returns an error if the connection cannot be closed. Close() error // ExecuteQuery executes the query with the given arguments. // It returns the result of the query execution. ExecuteQuery(query string, args ...interface{}) (sql.Result, error) // QueryRow executes the query with the given arguments and returns a single row. // It returns the result of the query execution. QueryRow(query string, args ...interface{}) *sql.Row // Query executes the query with the given arguments and returns the result set. // It returns the result of the query execution. Query(query string, args ...interface{}) (*sql.Rows, error) // Transaction executes the function within a transaction. // If the function returns an error, the transaction is rolled back. // If the function returns nil, the transaction is committed. Transaction(ctx context.Context, fn func(tx *sql.Tx) error) error }
Service represents a service that interacts with a database.
Click to show internal directories.
Click to hide internal directories.