infrastructure

package
v0.0.0-...-165d855 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DlrSortMap map[mo.DlrSortField]string = map[mo.DlrSortField]string{
	mo.DlrSortFieldId:        "id",
	mo.DlrSortFieldCreatedAt: "created_at",
	mo.DlrSortFieldUpdatedAt: "updated_at",
}

Functions

This section is empty.

Types

type Dlr

type Dlr struct {
	tgorm.Model

	DlrData   string         `json:"dlr_data" gorm:"not null;default:''"`  // DlrData is the dlr data of the dlr.
	DlrType   int            `json:"dlr_type" gorm:"not null;default:0"`   // DlrType is the type of the dlr.
	DlrStatus int            `json:"dlr_status" gorm:"not null;default:0"` // DlrStatus is the status of the dlr.
	Tags      pq.StringArray `json:"tags" gorm:"type:text[]"`              // Tags is the tags of the dlr.
}

Dlr is a struct that represents the db mapper of a dlr basic values.

func NewDlr

func NewDlr(id uuid.UUID,
	dlrData string,
	dlrType int,
	dlrStatus int,
	tags pq.StringArray) *Dlr

NewDlr creates a new *Dlr.

func NewDlrFromEntity

func NewDlrFromEntity(entity me.Dlr) *Dlr

NewDlrFromEntity creates a new *Dlr from entity.

func (*Dlr) String

func (s *Dlr) String() string

String returns a string representation of the Dlr.

func (*Dlr) ToEntity

func (s *Dlr) ToEntity() *me.Dlr

ToEntity returns a entity representation of the Dlr.

type Dlrs

type Dlrs []*Dlr

func NewDlrFromEntities

func NewDlrFromEntities(entities []me.Dlr) Dlrs

NewDlrsFromEntities creates a new []*Dlr from entities.

func (Dlrs) ToEntities

func (s Dlrs) ToEntities() []me.Dlr

ToEntities creates a new []me.Dlr entity.

Jump to

Keyboard shortcuts

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