Documentation
¶
Index ¶
- type Data
- func (d *Data) CountLogsGroup(tagKey string) ([]LogGroupResult, error)
- func (d *Data) CountLogsSize() (int64, error)
- func (d *Data) CreateLog(log *LogData) error
- func (d *Data) CreateLogGroup(groupLog *LogGroup) error
- func (d *Data) DeleteLogByFileId(fileId string) error
- func (d *Data) DeleteLogGroupByGroupId(groupId string) error
- func (d *Data) FindLogByFileId(FileId string) (*LogData, error)
- func (d *Data) FindLogGroup(groupId string) (*LogGroup, error)
- func (d *Data) FindLogGroups(query *FileListQuery) (*Page[*LogGroup], error)
- func (d *Data) FindLogs(query *FileListQuery) (*Page[*LogData], error)
- func (d *Data) FindOldestLogs(size int) ([]*LogData, error)
- func (d *Data) FindShouldDeleteLogs(size int) ([]*LogData, error)
- func (d *Data) FindTimeoutLogs(before time.Time, size int) ([]*LogData, error)
- func (d *Data) UpdateLogGroup(groupLog *LogGroup) error
- func (d *Data) UpdateLogStatus(fileId string, status Status) error
- type DataApi
- type FileListQuery
- type LogData
- type LogGroup
- type LogGroupResult
- type Model
- type OrderData
- type Page
- type PageQuery
- type Status
- type Sum
- type Tag
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Data ¶
type Data struct {
// contains filtered or unexported fields
}
func (*Data) CountLogsGroup ¶ added in v1.8.0
func (d *Data) CountLogsGroup(tagKey string) ([]LogGroupResult, error)
func (*Data) CountLogsSize ¶
func (*Data) CreateLogGroup ¶
func (*Data) DeleteLogByFileId ¶
func (*Data) DeleteLogGroupByGroupId ¶
func (*Data) FindLogGroups ¶
func (d *Data) FindLogGroups(query *FileListQuery) (*Page[*LogGroup], error)
func (*Data) FindShouldDeleteLogs ¶
func (*Data) FindTimeoutLogs ¶
func (*Data) UpdateLogGroup ¶
type DataApi ¶
type DataApi interface {
CreateLogGroup(logGroup *LogGroup) error
UpdateLogGroup(logGroup *LogGroup) error
FindLogGroup(groupId string) (*LogGroup, error)
FindLogGroups(query *FileListQuery) (*Page[*LogGroup], error)
DeleteLogGroupByGroupId(groupId string) error
CountLogsGroup(tagKey string) ([]LogGroupResult, error)
CreateLog(log *LogData) error
FindLogs(query *FileListQuery) (*Page[*LogData], error)
UpdateLogStatus(fileId string, status Status) error
DeleteLogByFileId(fileId string) error
FindLogByFileId(fileId string) (*LogData, error)
FindTimeoutLogs(before time.Time, size int) ([]*LogData, error)
FindOldestLogs(size int) ([]*LogData, error)
CountLogsSize() (int64, error)
}
func NewData ¶
func NewData(config *config.Config, taskManager *task.TaskManager, st storage.StorageApi) (DataApi, error)
type FileListQuery ¶
func (*FileListQuery) GetFrom ¶
func (f *FileListQuery) GetFrom() *time.Time
func (*FileListQuery) GetTo ¶
func (f *FileListQuery) GetTo() *time.Time
type LogData ¶
type LogData struct {
Model
Status Status `json:"status"`
Size int64 `json:"size"`
FileId string `gorm:"index:unique" json:"fileId"`
LogGroupID *uint `json:"-" gorm:"index;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
Tags []*Tag `gorm:"many2many:log_tags;" json:"tags"`
Name string `json:"name"`
}
type LogGroupResult ¶ added in v1.8.0
type Model ¶
type Model struct {
ID uint `gorm:"primarykey" json:"-"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
}
func (*Model) GetOrderValue ¶
Click to show internal directories.
Click to hide internal directories.