model

package
v0.0.0-...-f4de95a Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EmptyObjectJSON = json.RawMessage("{}")

Functions

func ScanJSON

func ScanJSON(src interface{}, target interface{}) error

ScanJSON is a generic scanner function to parse json from row data

func ToBaseFieldDTO

func ToBaseFieldDTO(m *BaseField) *dto.BaseField

func ToModifierDTO

func ToModifierDTO(model *Modifier) *dto.Modifier

Types

type BaseField

type BaseField struct {
	CreatedAt  time.Time       `db:"createdAt"`
	UpdatedAt  time.Time       `db:"updatedAt"`
	ModifiedBy *Modifier       `db:"modifiedBy"`
	Version    int64           `db:"version"`
	Metadata   json.RawMessage `db:"metadata"`
}

func NewBaseField

func NewBaseField(modifiedBy *Modifier) BaseField

type Modifier

type Modifier struct {
	ID       string `json:"id"`
	Role     string `json:"role"`
	FullName string `json:"fullName"`
}

func ToModifier

func ToModifier(subject *dto.Subject) *Modifier

func (*Modifier) Scan

func (m *Modifier) Scan(src interface{}) error

func (*Modifier) Value

func (m *Modifier) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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