Documentation ¶
Index ¶
- Constants
- Variables
- func DurationToMilliseconds(d time.Duration) int64
- func JulianDayToTime(d float64) time.Time
- func JulianDayToTimestamp(f float64) *timestamppb.Timestamp
- func JulianNow() float64
- func MillisecondsToDuration(ms int64) time.Duration
- func StmtBytes(stmt *sqlite.Stmt, colName string) []byte
- func StmtJulianToTime(stmt *sqlite.Stmt, colName string) time.Time
- func StmtJulianToTimestamp(stmt *sqlite.Stmt, colName string) *timestamppb.Timestamp
- func TimeToJulianDay(t time.Time) float64
- func TimestampJulian(ts *timestamppb.Timestamp) float64
- type Database
- func (db *Database) Close() error
- func (db *Database) ReadTX(ctx context.Context, fn TxFn) (err error)
- func (db *Database) Reset(ctx context.Context, shouldClear bool) (err error)
- func (db *Database) WriteTX(ctx context.Context, fn TxFn) (err error)
- func (db *Database) WriteWithoutTx(ctx context.Context, fn TxFn) error
- type TxFn
Constants ¶
View Source
const (
UnixEpochJulianDay = 2440587.5
)
Variables ¶
View Source
var JulianZeroTime = JulianDayToTime(0)
Functions ¶
func DurationToMilliseconds ¶
func JulianDayToTime ¶
JulianDayToTime converts a Julian day into a time.Time.
func JulianDayToTimestamp ¶
func JulianDayToTimestamp(f float64) *timestamppb.Timestamp
func MillisecondsToDuration ¶
func StmtJulianToTimestamp ¶
func StmtJulianToTimestamp(stmt *sqlite.Stmt, colName string) *timestamppb.Timestamp
func TimeToJulianDay ¶
TimeToJulianDay converts a time.Time into a Julian day.
func TimestampJulian ¶
func TimestampJulian(ts *timestamppb.Timestamp) float64
Types ¶
Click to show internal directories.
Click to hide internal directories.