Documentation
¶
Overview ¶
Package models contains generated code for schema 'Cookies'.
Index ¶
- Variables
- func Convert(res []*Cookie) []*http.Cookie
- func Errorf(s string, v ...interface{})
- func Logf(s string, v ...interface{})
- func SetErrorLogger(logger interface{})
- func SetLogger(logger interface{})
- type Cookie
- type DB
- type EncryptedValue
- type ErrInsertFailed
- type ErrInvalidTime
- type ErrUpdateFailed
- type ErrUpsertFailed
- type Error
- type ExpiresUTC
- type Time
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",
}
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 Errorf ¶
func Errorf(s string, v ...interface{})
Errorf logs an error message using the package error logger.
func SetErrorLogger ¶
func SetErrorLogger(logger interface{})
SetErrorLogger sets the package error logger. Valid logger types:
io.Writer func(string, ...interface{}) (int, error) // fmt.Printf func(string, ...interface{}) // log.Printf
Types ¶
type Cookie ¶
type Cookie struct { HostKey string `json:"host_key"` // host_key Name string `json:"name"` // name EncryptedValue EncryptedValue `json:"encrypted_value"` // encrypted_value Path string `json:"path"` // path ExpiresUTC ExpiresUTC `json:"expires_utc"` // expires_utc IsSecure bool `json:"is_secure"` // is_secure IsHTTPOnly bool `json:"is_http_only"` // is_http_only }
Cookie is a browser cookie.
type DB ¶
type DB interface { ExecContext(context.Context, string, ...interface{}) (sql.Result, error) QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error) QueryRowContext(context.Context, string, ...interface{}) *sql.Row }
DB is the common interface for database operations that can be used with types from schema 'Cookies'.
This works with both database/sql.DB and database/sql.Tx.
type EncryptedValue ¶
type EncryptedValue []byte
EncryptedValue wraps an encrypted value.
func (EncryptedValue) Bytes ¶
func (v EncryptedValue) Bytes() []byte
Bytes returns the encrypted value as bytes.
func (*EncryptedValue) Scan ¶
func (v *EncryptedValue) Scan(z interface{}) error
Scan satisfies the sql.Scanner interface.
func (EncryptedValue) String ¶
func (v EncryptedValue) String() string
String satisfies the fmt.Stringer interface.
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 ¶ added in v0.2.3
type ErrUpsertFailed struct {
Err error
}
ErrUpsertFailed is the upsert failed error.
func (*ErrUpsertFailed) Error ¶ added in v0.2.3
func (err *ErrUpsertFailed) Error() string
Error satisfies the error interface.
func (*ErrUpsertFailed) Unwrap ¶ added in v0.2.3
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 ExpiresUTC ¶
ExpiresUTC wraps a UTC based expiry time.
func (*ExpiresUTC) Scan ¶
func (v *ExpiresUTC) Scan(z interface{}) error
Scan satisfies the sql.Scanner interface.
func (ExpiresUTC) Time ¶
func (v ExpiresUTC) Time() time.Time
Time returns the value as a standard time.