datatypes

package
v0.0.0-...-824b32f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 5, 2021 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Headers

type Headers map[string]string

Headers is the embedded data-type for storing header values as a JSONB column in database

func (Headers) GormDBDataType

func (Headers) GormDBDataType(db *gorm.DB, field *schema.Field) string

GormDBDataType determines database column data type for Header type, implements GormDataTypeInterface. It returns JSONB type for Postgres, and JSON for mysql and sqlite

func (*Headers) Scan

func (h *Headers) Scan(dest interface{}) error

Scan deseralizes JSON value of Header column into Header struct. Implements sql.Scanner interface.

func (*Headers) UnmarshalJSON

func (h *Headers) UnmarshalJSON(b []byte) error

UnmarshalJSON handles case conversion of header keys

func (Headers) Value

func (h Headers) Value() (driver.Value, error)

Value serializes Header struct into JSON to inserted into database as JSON value. Implements sql.Valuer interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL