dto

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

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

Go to latest
Published: Sep 8, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddLogReq

type AddLogReq struct {
	ServiceName string `json:"service_name" validate:"required"`
	Level       string `json:"level" validate:"required"`
	Content     []byte `json:"content" validate:"required"`
	TraceId     string `json:"trace_id" validate:"required"`
}

type GetLogsReq

type GetLogsReq struct {
	ServiceName string         `json:"service_name,omitempty"`
	Level       string         `json:"level,omitempty"`
	TraceId     string         `json:"trace_id,omitempty"`
	CreatedFrom int64          `json:"created_from,omitempty"`
	CreatedTo   int64          `json:"created_to,omitempty"`
	Pagination  *PaginationReq `json:"pagination,omitempty"`
	Sort        *SortReq       `json:"sort,omitempty"`
}

type Log

type Log struct {
	Id          string    `json:"id"`
	ServiceName string    `json:"service_name"`
	Level       string    `json:"level"`
	Content     []byte    `json:"content"`
	TraceId     string    `json:"trace_id"`
	CreatedAt   time.Time `json:"created_at"`
}

func (*Log) ToProto

func (l *Log) ToProto() *pb.LogInfo

type Logs

type Logs []*Log

func (Logs) ToProto

func (lgs Logs) ToProto() []*pb.LogInfo

type PaginationReq

type PaginationReq struct {
	Page  int `json:"page,omitempty" validate:"gte=0"`
	Limit int `json:"limit,omitempty" validate:"gte=0,lte=1000"`
}

type PaginationRes

type PaginationRes struct {
	CurrentPage int   `json:"current_page,omitempty"`
	TotalPage   int   `json:"total_page,omitempty"`
	Skip        int64 `json:"skip,omitempty"`
	Limit       int   `json:"limit,omitempty"`
	Total       int64 `json:"total,omitempty"`
}

type SortReq

type SortReq struct {
	Field string `json:"field,omitempty"`
	Desc  bool   `json:"desc,omitempty"`
}

Jump to

Keyboard shortcuts

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