log

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteOld

func DeleteOld(targetTimestamp int64) (int64, error)

func GetAll

func GetAll(logType int, startTimestamp int64, endTimestamp int64, modelName string, username string, tokenName string, groupID string, startIdx int, num int, channel string) ([]*model.Log, error)

func GetByID added in v0.0.3

func GetByID(logID string) (*model.Log, error)

func GetUser

func GetUser(userId string, logType int, startTimestamp int64, endTimestamp int64, modelName string, tokenName string, startIdx int, num int) ([]*model.Log, error)

func GetUserByID added in v0.0.3

func GetUserByID(userId string, logID string) (*model.Log, error)

func MinLogTimestampByUserId

func MinLogTimestampByUserId(userId string, logTypes []int) (int64, error)

func RecordConsumeLog

func RecordConsumeLog(ctx context.Context, log *model.Log)

func RecordLog

func RecordLog(ctx context.Context, userId string, logType int, content string)

func RecordTestLog

func RecordTestLog(ctx context.Context, log *model.Log)

func RecordTopupLog

func RecordTopupLog(ctx context.Context, userId string, content string, quota int)

func SearchAll

func SearchAll(keyword string) ([]*model.Log, error)

func SearchLogModelsByPeriod

func SearchLogModelsByPeriod(userId string, start, end int) ([]string, error)

func SearchLogsByPeriodAndModel

func SearchLogsByPeriodAndModel(userId string, start, end int, granularity string, models []string) ([]*model.LogStatistic, error)

func SearchUser

func SearchUser(userId string, keyword string) ([]*model.Log, error)

func SumUsedQuota

func SumUsedQuota(logType int, startTimestamp int64, endTimestamp int64, modelName string, username string, tokenName string, channel string) int64

func SumUsedQuotaByUserId

func SumUsedQuotaByUserId(logType int, userId string, startTimestamp int64, endTimestamp int64) (int64, error)

func SumUsedQuotaByUserIdWithModels added in v0.0.6

func SumUsedQuotaByUserIdWithModels(logType int, userId string, startTimestamp int64, endTimestamp int64, models []string) (int64, error)

func SumUsedToken

func SumUsedToken(logType int, startTimestamp int64, endTimestamp int64, modelName string, username string, tokenName string) int

Types

This section is empty.

Jump to

Keyboard shortcuts

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