models

package
v0.0.0-...-f8ae444 Latest Latest
Warning

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

Go to latest
Published: May 6, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DbNotify

type DbNotify struct {
	Table  string `json:"table"`
	Action string `json:"action"`
	Id     int    `json:"id"`
}

type DbRequest

type DbRequest struct {
	Id            uint      `gorm:"PRIMARY_KEY;AUTO_INCREMENT" mapstructure:"id"`
	Method        string    `gorm:"type:varchar(10);NOT NULL" mapstructure:"method"`
	Url           string    `gorm:"NOT NULL" mapstructure:"url"`
	Headers       HeaderMap `gorm:"type:jsonb;NOT NULL" mapstructure:"headers"`
	Body          string    `gorm:"NOT NULL" mapstructure:"body"`
	ContentLength int64     `gorm:"NOT NULL" mapstructure:"content_length"`
	Host          string    `gorm:"NOT NULL" mapstructure:"host"`
	RequestedOn   time.Time `gorm:"NOT NULL" mapstructure:"requested_on"`
	CreatedAt     time.Time `gorm:"NOT NULL" mapstructure:"created_at"`
}

Gorm is used for saving/retrieving data from database and mapping to Go structs. MapStructure is used for converting DB notify events to Go structs

func (DbRequest) TableName

func (db DbRequest) TableName() string

type DbResponse

type DbResponse struct {
	Id            uint      `gorm:"PRIMARY_KEY;AUTO_INCREMENT" mapstructure:"id"`
	RequestId     uint      `gorm:"NOT NULL" mapstructure:"request_id"`
	Status        string    `gorm:"type:varchar(50);NOT NULL" mapstructure:"status"`
	StatusCode    int       `gorm:"NOT NULL" mapstructure:"status_code"`
	Headers       HeaderMap `gorm:"type:jsonb;NOT NULL" mapstructure:"headers"`
	Body          string    `gorm:"NOT NULL" mapstructure:"body"`
	ContentLength int64     `gorm:"NOT NULL" mapstructure:"content_length"`
	MimeType      string    `gorm:"type:varchar(50);NOT NULL" mapstructure:"mime_type"`
	Protocol      string    `gorm:"type:varchar(50);NOT NULL" mapstructure:"protocol"`
	RespondedOn   time.Time `gorm:"NOT NULL" mapstructure:"responded_on"`
	CreatedAt     time.Time `gorm:"NOT NULL" mapstructure:"created_at"`
}

Gorm is used for saving/retrieving data from database and mapping to Go structs. MapStructure is used for converting DB notify events to Go structs

func (DbResponse) TableName

func (db DbResponse) TableName() string

type HeaderMap

type HeaderMap map[string]interface{}

HeaderMap Postgresql's JSONB data type

func (*HeaderMap) Scan

func (hm *HeaderMap) Scan(value interface{}) error

Scan scan value into HeaderMap

func (HeaderMap) Value

func (hm HeaderMap) Value() (driver.Value, error)

Value get value of HeaderMap

Jump to

Keyboard shortcuts

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