domain

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: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dlr

type Dlr struct {
	Id     uuid.UUID `json:"id"` // Id is the id of the dlr.
	mo.Dlr           // Dlr is the basic values of the dlr.

	// Only for view
	CreatedAt time.Time `json:"created_at"` // CreatedAt is the create time.
	UpdatedAt time.Time `json:"updated_at"` // UpdatedAt is the update time.
}

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

func NewDlr

func NewDlr(id uuid.UUID,
	dlr mo.Dlr) *Dlr

NewDlr creates a new *Dlr.

func NewEmptyDlr

func NewEmptyDlr() *Dlr

NewEmptyDlr creates a new *Dlr with empty values.

func (*Dlr) Clear

func (s *Dlr) Clear()

Clear clears the Dlr.

func (*Dlr) Clone

func (s *Dlr) Clone() *Dlr

Clone returns a clone of the Dlr.

func (*Dlr) Equals

func (s *Dlr) Equals(other *Dlr) bool

Equals returns true if the Dlr is equal to the other Dlr.

func (*Dlr) IsEmpty

func (s *Dlr) IsEmpty() bool

IsEmpty returns true if the Dlr is empty.

func (*Dlr) IsNotEmpty

func (s *Dlr) IsNotEmpty() bool

IsNotEmpty returns true if the Dlr is not empty.

func (*Dlr) String

func (s *Dlr) String() string

String returns a string representation of the Dlr.

func (*Dlr) Validate

func (s *Dlr) Validate() error

Validate validates the Dlr.

type DlrFilter

type DlrFilter struct {
	Id        uuid.UUID    `json:"id"`         // Id is the id of the dlr.
	DlrData   string       `json:"dlr_name"`   // DlrData is the dlr name of the dlr.
	DlrType   mo.DlrType   `json:"dlr_type"`   // DlrType is the type of the dlr.
	DlrStatus mo.DlrStatus `json:"dlr_status"` // DlrStatus is the status of the dlr.
	Tags      []string     `json:"tags"`       // Tags is the tags of the dlr.

	CreatedAtFrom time.Time `json:"created_at_from"` // CreatedAt is in the between of CreatedAtFrom and CreatedAtTo.
	CreatedAtTo   time.Time `json:"created_at_to"`   // CreatedAt is in the between of CreatedAtFrom and CreatedAtTo.
	UpdatedAtFrom time.Time `json:"updated_at_from"` // UpdatedAt is in the between of UpdatedAtFrom and UpdatedAtTo.
	UpdatedAtTo   time.Time `json:"updated_at_to"`   // UpdatedAt is in the between of UpdatedAtFrom and UpdatedAtTo.

	SearchText string          `json:"search_text"` // SearchText is the full-text search value.
	SortType   string          `json:"sort_type"`   // SortType is the sorting type (ASC,DESC).
	SortField  mo.DlrSortField `json:"sort_field"`  // SortField is the sorting field of the dlr.

	Limit  int `json:"limit"`  // Limit provides to limitation row size.
	Offset int `json:"offset"` // Offset provides a starting row number of the limitation.
}

DlrFilter is a struct that represents the filter of a dlr.

func NewDlrFilter

func NewDlrFilter(id uuid.UUID,
	dlrData string,
	dlrType mo.DlrType,
	dlrStatus mo.DlrStatus,
	tags []string,
	createdAtFrom time.Time,
	createdAtTo time.Time,
	updatedAtFrom time.Time,
	updatedAtTo time.Time,
	searchText string,
	sortType string,
	sortField mo.DlrSortField,
	limit int,
	offset int) *DlrFilter

NewDlrFilter creates a new *DlrFilter.

func NewEmptyDlrFilter

func NewEmptyDlrFilter() *DlrFilter

NewEmptyDlrFilter creates a new *DlrFilter with empty values.

func (*DlrFilter) String

func (s *DlrFilter) String() string

String returns a string representation of the DlrFilter.

type Dlrs

type Dlrs struct {
	Dlrs      []Dlr `json:"dlrs"`       // Dlrs is the slice of *Dlr.
	TotalRows int64 `json:"total_rows"` // TotalRows is the total number of rows.
}

Dlrs contains a slice of *Dlr and total number of dlrs.

type LogData

type LogData struct {
	Id            uuid.UUID `json:"id"` // Id is the id of the log.
	*pb.LogHeader           // LogHeader is the header of the log.
	*pb.LogBody             // LogBody is the body of the log.
}

LogData is a struct that represents the entity of a log.

func NewLogData

func NewLogData() *LogData

NewLogData creates a new *LogData.

func (*LogData) GenerateLogData

func (s *LogData) GenerateLogData(logType pb.LogType,
	path string,
	userId string,
	message string) *pb.LogData

GenerateLogData generated a new *pb.LogData

func (*LogData) String

func (s *LogData) String() string

String returns a string representation of the LogData.

Jump to

Keyboard shortcuts

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