Documentation
¶
Overview ¶
Package models contains generated code for schema 'cookies.sqlite'.
Index ¶
- Variables
- func Convert(res []*Cookie) []*http.Cookie
- func Errorf(s string, v ...any)
- func Logf(s string, v ...any)
- func SetErrorLogger(logger any)
- func SetLogger(logger any)
- type Cookie
- type DB
- type ErrInsertFailed
- type ErrInvalidTime
- type ErrUpdateFailed
- type ErrUpsertFailed
- type Error
- type Time
- func (t Time) Format(layout string) string
- func (t Time) MarshalJSON() ([]byte, error)
- func (t *Time) Parse(s string) error
- func (t *Time) Scan(v any) error
- func (t Time) String() string
- func (t Time) Time() time.Time
- func (t *Time) UnmarshalJSON(data []byte) error
- func (t Time) Value() (driver.Value, error)
Constants ¶
This section is empty.
Variables ¶
var TimestampFormats = []string{ "2006-01-02 15:04:05.999999999-07:00", "2006-01-02T15:04:05.999999999-07:00", "2006-01-02 15:04:05.999999999", "2006-01-02T15:04:05.999999999", "2006-01-02 15:04:05", "2006-01-02T15:04:05", "2006-01-02 15:04", "2006-01-02T15:04", "2006-01-02", } // Cookie is a browser cookie.
TimestampFormats are the timestamp formats used by SQLite3 database drivers to store a time.Time in SQLite3.
The first format in the slice will be used when saving time values into the database. When parsing a string from a timestamp or datetime column, the formats are tried in order.
Functions ¶
func SetErrorLogger ¶
func SetErrorLogger(logger any)
SetErrorLogger sets the package error logger. Valid logger types:
io.Writer func(string, ...any) (int, error) // fmt.Printf func(string, ...any) // log.Printf
Types ¶
type Cookie ¶
type Cookie struct { Expiry int64 `json:"expiry"` // expiry Host string `json:"host"` // host Name string `json:"name"` // name Value string `json:"value"` // value Path string `json:"path"` // path IsSecure bool `json:"is_secure"` // is_secure IsHTTPOnly bool `json:"is_http_only"` // is_http_only }
type DB ¶
type DB interface { ExecContext(context.Context, string, ...any) (sql.Result, error) QueryContext(context.Context, string, ...any) (*sql.Rows, error) QueryRowContext(context.Context, string, ...any) *sql.Row }
DB is the common interface for database operations that can be used with types from schema 'cookies.sqlite'.
This works with both database/sql.DB and database/sql.Tx.
type ErrInsertFailed ¶
type ErrInsertFailed struct {
Err error
}
ErrInsertFailed is the insert failed error.
func (*ErrInsertFailed) Error ¶
func (err *ErrInsertFailed) Error() string
Error satisfies the error interface.
func (*ErrInsertFailed) Unwrap ¶
func (err *ErrInsertFailed) Unwrap() error
Unwrap satisfies the unwrap interface.
type ErrInvalidTime ¶
type ErrInvalidTime string
ErrInvalidTime is the invalid Time error.
func (ErrInvalidTime) Error ¶
func (err ErrInvalidTime) Error() string
Error satisfies the error interface.
type ErrUpdateFailed ¶
type ErrUpdateFailed struct {
Err error
}
ErrUpdateFailed is the update failed error.
func (*ErrUpdateFailed) Error ¶
func (err *ErrUpdateFailed) Error() string
Error satisfies the error interface.
func (*ErrUpdateFailed) Unwrap ¶
func (err *ErrUpdateFailed) Unwrap() error
Unwrap satisfies the unwrap interface.
type ErrUpsertFailed ¶
type ErrUpsertFailed struct {
Err error
}
ErrUpsertFailed is the upsert failed error.
func (*ErrUpsertFailed) Error ¶
func (err *ErrUpsertFailed) Error() string
Error satisfies the error interface.
func (*ErrUpsertFailed) Unwrap ¶
func (err *ErrUpsertFailed) Unwrap() error
Unwrap satisfies the unwrap interface.
type Error ¶
type Error string
Error is an error.
const ( // ErrAlreadyExists is the already exists error. ErrAlreadyExists Error = "already exists" // ErrDoesNotExist is the does not exist error. ErrDoesNotExist Error = "does not exist" // ErrMarkedForDeletion is the marked for deletion error. ErrMarkedForDeletion Error = "marked for deletion" )
Error values.
type Time ¶
type Time struct {
// contains filtered or unexported fields
}
Time is a SQLite3 Time that scans for the various timestamps values used by SQLite3 database drivers to store time.Time values.
func (Time) MarshalJSON ¶
MarshalJSON satisfies the [json.Marshaler] interface.
func (*Time) UnmarshalJSON ¶
UnmarshalJSON satisfies the [json.Unmarshaler] interface.