Documentation ¶
Index ¶
- Constants
- Variables
- func DBConnection() *sql.DB
- func Decrypt(encryptedString string, passphrase string) (decryptedString string)
- func Encrypt(stringToEncrypt string, passphrase string) (encryptedString string)
- type Date
- func (date *Date) GobDecode(b []byte) error
- func (date *Date) GobEncode() ([]byte, error)
- func (date Date) GormDataType() string
- func (date Date) MarshalJSON() ([]byte, error)
- func (date *Date) Scan(value interface{}) error
- func (date *Date) String() string
- func (date *Date) StringValue() string
- func (date *Date) Time() time.Time
- func (date *Date) UnmarshalJSON(b []byte) error
- func (date Date) Value() (driver.Value, error)
- type SecureString
Constants ¶
const ( DateLayout = "2006-01-02" DatetimeLayout = "2006-01-02 15:04:05" )
Supported date and datetime layouts
Variables ¶
var DB *gorm.DB
Functions ¶
func DBConnection ¶ added in v0.7.84
Types ¶
type Date ¶ added in v0.7.84
Date provides a custom time type that can represent a date or datetime with a custom formatter.
func (*Date) GobDecode ¶ added in v0.7.84
GobDecode decodes the binary data from GobEncode into the Date type.
func (*Date) GobEncode ¶ added in v0.7.84
GobEncode encodes the Date type to a binary format for use with the gob package.
func (Date) GormDataType ¶ added in v0.7.84
GormDataType returns the data type that GORM should use for the Date type.
func (Date) MarshalJSON ¶ added in v0.7.84
MarshalJSON writes a quoted string in the custom format.
func (*Date) Scan ¶ added in v0.7.84
Scan scans the value from the database and sets the Date value.
func (*Date) StringValue ¶ added in v0.7.84
StringValue returns the Date value as a string in the custom format.
func (*Date) UnmarshalJSON ¶ added in v0.7.84
UnmarshalJSON parses a JSON string in the custom format and sets the Date value.
type SecureString ¶ added in v0.7.84
type SecureString string
func (*SecureString) Scan ¶ added in v0.7.84
func (s *SecureString) Scan(value interface{}) error
Scan implements the sql.Scanner interface, decrypting the string value.