common

package
v0.0.0-...-7d3b672 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DUPLICATE_REGEX = regexp.MustCompile(`(?i)\bduplicate\b`)
)

Functions

func IsDuplicateError

func IsDuplicateError(err error) bool

Types

type GetRawDataOrigin

type GetRawDataOrigin interface {
	GetRawDataOrigin() *RawDataOrigin
}

type Model

type Model struct {
	ID        uint64    `gorm:"primaryKey" json:"id"`
	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
}

type NoPKModel

type NoPKModel struct {
	CreatedAt     time.Time `json:"createdAt"`
	UpdatedAt     time.Time `json:"updatedAt"`
	RawDataOrigin `swaggerignore:"true"`
}

func NewNoPKModel

func NewNoPKModel() NoPKModel

type RawDataOrigin

type RawDataOrigin struct {
	// can be used for flushing outdated records from table
	RawDataParams string `gorm:"column:_raw_data_params;type:varchar(160);index" json:"_raw_data_params"`
	RawDataTable  string `gorm:"column:_raw_data_table;type:varchar(160)" json:"_raw_data_table"`
	// can be used for debugging
	RawDataId uint64 `gorm:"column:_raw_data_id" json:"_raw_data_id"`
	// we can store record index into this field, which is helpful for debugging
	RawDataRemark string `gorm:"column:_raw_data_remark" json:"_raw_data_remark"`
}

embedded fields for tool layer tables

func (*RawDataOrigin) GetRawDataOrigin

func (c *RawDataOrigin) GetRawDataOrigin() *RawDataOrigin

type ScopeConfig

type ScopeConfig struct {
	Model
	Entities []string `gorm:"type:json;serializer:json" json:"entities" mapstructure:"entities"`
}

Jump to

Keyboard shortcuts

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