log_driver

package
v1.9.6-beta Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Drivers

func Drivers() []string

func NewFactoryManager

func NewFactoryManager() *factoryManager

func RegisterFactory

func RegisterFactory(name string, factory IFactory)

func SetDriver

func SetDriver(name string, driver ILogDriver)

Types

type DriverManager

type DriverManager struct {
	// contains filtered or unexported fields
}

func NewDriverManager

func NewDriverManager() *DriverManager

func (*DriverManager) Get

func (m *DriverManager) Get(name string) (ILogDriver, bool)

func (*DriverManager) Set

func (m *DriverManager) Set(name string, driver ILogDriver)

type IFactory

type IFactory interface {
	Create(config string) (ILogDriver, map[string]interface{}, error)
}

func GetFactory

func GetFactory(name string) (IFactory, bool)

type ILogDriver

type ILogDriver interface {
	LogInfo(clusterId string, id string) (*LogInfo, error)
	LogCount(clusterId string, conditions map[string]string, spendHour int64, group string) (map[string]int64, error)
	Logs(clusterId string, conditions map[string]string, start time.Time, end time.Time, limit int64, offset int64) ([]*LogItem, int64, error)
	LogRecords(clusterId string, start time.Time, end time.Time) ([]*LogItem, error)
}

func GetDriver

func GetDriver(name string) (ILogDriver, bool)

type LogInfo

type LogInfo struct {
	*LogItem
	ContentType       string
	RequestBody       string
	ProxyBody         string
	ProxyResponseBody string
	ResponseBody      string
	RequestHeader     string
	ResponseHeader    string
}

type LogItem

type LogItem struct {
	ID            string
	Strategy      string
	Service       string
	API           string
	Method        string
	Url           string
	RemoteIP      string
	Consumer      string
	Authorization string
	InputToken    int64
	OutputToken   int64
	TotalToken    int64
	AIProvider    string
	AIModel       string
	StatusCode    int64
	ResponseTime  int64
	Traffic       int64
	RecordTime    time.Time
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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