accesslog_aliyun_oss

package module
v0.0.0-...-dff91d6 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: MIT Imports: 7 Imported by: 2

README

accesslog-aliyun-oss

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	HTTPClient   = oss.HTTPClient
	NewOSSClient = oss.New
)

Functions

func NewCacheHTTPClient

func NewCacheHTTPClient(cli *http.Client, cachePath string) *http.Client

func ProcessAccessLogWithClient

func ProcessAccessLogWithClient(client *Client, bucketName, dateStr string, callback func(entry accesslog.Entry[AccessLog], err error) error) error

Types

type AccessLog

type AccessLog struct {
	// 请求者的IP地址。Requester's IP address.
	RemoteIP string
	// 保留字段,固定值为-。Reserved field, fixed value is "-".
	Reserved1 string
	// 保留字段,固定值为-。Reserved field, fixed value is "-".
	Reserved2 string
	// OSS收到请求的时间。Time when OSS received the request.
	Time string
	// 包含query string的请求URL。Request URL including query string.
	RequestURL string
	// OSS返回的HTTP状态码。HTTP status code returned by OSS.
	HTTPStatus string
	// 请求产生的下行流量。单位:Byte。Downstream traffic generated by the request. Unit: Byte.
	SentBytes string
	// 完成本次请求耗费的时间。单位:ms。Time taken to complete the request. Unit: ms.
	RequestTime string
	// 请求的HTTP Referer。HTTP referer of the request.
	Referer string
	// HTTP的User-Agent头。HTTP User-Agent header.
	UserAgent string
	// 请求访问的目标域名。Target domain name of the request.
	HostName string
	// 请求的Request ID。Request ID of the request.
	RequestID string
	// 是否已开启日志转存。Indicates if log transfer is enabled.
	LoggingFlag string
	// 请求者的用户ID。Requester's user ID.
	RequesterAliyunID string
	// 请求类型。Type of request.
	Operation string
	// 请求的目标Bucket名称。Name of the target bucket.
	BucketName string
	// 请求的目标Object名称。Name of the target object.
	ObjectName string
	// 目标Object大小。单位:Byte。Size of the target object. Unit: Byte.
	ObjectSize string
	// OSS处理本次请求所花的时间。单位:毫秒。Time taken by OSS to process the request. Unit: ms.
	ServerCostTime string
	// OSS返回的错误码。Error code returned by OSS.
	ErrorCode string
	// 请求的长度。单位:Byte。Length of the request. Unit: Byte.
	RequestLength string
	// Bucket拥有者ID。Bucket owner's ID.
	UserID string
	// Object大小的变化量。Change in object size.
	DeltaDataSize string
	// 请求是否为CDN回源请求。Indicates if the request is a CDN back-to-origin request.
	SyncRequest string
	// 目标Object的存储类型。Storage type of the target object.
	StorageClass string
	// 是否通过生命周期规则或CopyObject转换了Object的存储类型。Indicates if the storage type of the object was changed via lifecycle rules or CopyObject.
	TargetStorageClass string
	// 通过传输加速域名访问目标Bucket时使用的传输加速接入点。Transmission acceleration access point used when accessing the target bucket via a transmission acceleration domain.
	TransmissionAccelerationAccessPoint string
	// 请求者的AccessKey ID。Requester's AccessKey ID.
	AccessKeyID string
}

func (AccessLog) Formatted

func (a AccessLog) Formatted() (f AccessLogFormatted, err error)

type AccessLogFormatted

type AccessLogFormatted struct {
	RemoteIP                            string
	Time                                string
	RequestMethod                       string
	RequestScheme                       string
	RequestHost                         string
	RequestPath                         string
	RequestQuery                        string
	RequestProto                        string
	Status                              string
	BodySentBytes                       string
	RequestTime                         string
	Referer                             string
	UserAgent                           string
	HostName                            string
	RequestID                           string
	LoggingFlag                         string
	RequesterAliyunID                   string
	Operation                           string
	BucketName                          string
	ObjectName                          string
	ObjectSize                          string
	ServerCostTime                      string
	ErrorCode                           string
	RequestLength                       string
	UserID                              string
	DeltaDataSize                       string
	SyncRequest                         string
	StorageClass                        string
	TargetStorageClass                  string
	TransmissionAccelerationAccessPoint string
	AccessKeyID                         string
}

func (AccessLogFormatted) Fields

func (AccessLogFormatted) Fields() []string

func (AccessLogFormatted) Values

func (e AccessLogFormatted) Values(fields []string) []string

type Client

type Client = oss.Client

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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