log_driver

package
v1.3.1-beta Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 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) ([]*Log, int64, error)
}

func GetDriver

func GetDriver(name string) (ILogDriver, bool)

type Log

type Log struct {
	ID            string
	Service       string
	Method        string
	Url           string
	RemoteIP      string
	Consumer      string
	Authorization string
	RecordTime    time.Time
}

type LogInfo

type LogInfo struct {
	ID                string
	ContentType       string
	RequestBody       string
	ProxyBody         string
	ProxyResponseBody string
	ResponseBody      string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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