domain

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogData

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

	// 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.
}

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

func NewEmptyLogData

func NewEmptyLogData() *LogData

NewEmptyLogData creates a new *LogData with empty values.

func NewLogData

func NewLogData(id uuid.UUID,
	logHeader mo.LogHeader,
	logBody mo.LogBody) *LogData

NewLogData creates a new *LogData.

func (*LogData) Clear

func (s *LogData) Clear()

Clear clears the LogData.

func (*LogData) Clone

func (s *LogData) Clone() *LogData

Clone returns a clone of the LogData.

func (*LogData) Equals

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

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

func (*LogData) IsEmpty

func (s *LogData) IsEmpty() bool

IsEmpty returns true if the LogData is empty.

func (*LogData) IsNotEmpty

func (s *LogData) IsNotEmpty() bool

IsNotEmpty returns true if the LogData is not empty.

func (*LogData) String

func (s *LogData) String() string

String returns a string representation of the LogData.

func (*LogData) Validate

func (s *LogData) Validate() error

Validate validates the LogData.

type LogDataFilter

type LogDataFilter struct {
	Id            uuid.UUID  `json:"id"`                                      // Id is the id of the log.
	EventDateFrom time.Time  `json:"event_date_from"`                         // EventDate of the log is in the between of EventDateFrom and EventDateTo.
	EventDateTo   time.Time  `json:"event_date_to"`                           // EventDate of the log is in the between of EventDateFrom and EventDateTo.
	LogType       mo.LogType `json:"log_type"`                                // LogType is the type of the log.
	ServiceName   string     `json:"service_name" gorm:"not null;default:''"` // ServiceName is the name of source micro service.
	Path          string     `json:"path" gorm:"not null;default:''"`         // Path is the name of the source function of the source micro service.
	UserId        string     `json:"user_id" gorm:"not null;default:''"`      // UserId represents the id of the user that the log is for.

	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.LogSortField `json:"sort_field"`  // SortField is the sorting field of the logData.

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

LogDataFilter is a struct that represents the filter of a log.

func NewEmptyLogDataFilter

func NewEmptyLogDataFilter() *LogDataFilter

NewEmptyLogDataFilter creates a new *LogDataFilter with empty values.

func NewLogDataFilter

func NewLogDataFilter(id uuid.UUID,
	eventDateFrom time.Time,
	eventDateTo time.Time,
	logType mo.LogType,
	serviceName string,
	path string,
	userId string,
	createdAtFrom time.Time,
	createdAtTo time.Time,
	updatedAtFrom time.Time,
	updatedAtTo time.Time,
	searchText string,
	sortType string,
	sortField mo.LogSortField,
	limit int,
	offset int) *LogDataFilter

NewLogDataFilter creates a new *LogDataFilter.

func (*LogDataFilter) String

func (s *LogDataFilter) String() string

String returns a string representation of the LogDataFilter.

Jump to

Keyboard shortcuts

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