mirror of
https://github.com/Finesssee/ProxyPilot.git
synced 2026-11-18 18:04:20 +00:00
32 lines
928 B
Go
32 lines
928 B
Go
package executor
|
|
|
|
import (
|
|
"context"
|
|
"net/http"
|
|
|
|
"github.com/router-for-me/CLIProxyAPI/v6/internal/config"
|
|
"github.com/router-for-me/CLIProxyAPI/v6/internal/runtime/executor/helps"
|
|
)
|
|
|
|
type upstreamRequestLog = helps.UpstreamRequestLog
|
|
|
|
func recordAPIRequest(ctx context.Context, cfg *config.Config, info upstreamRequestLog) {
|
|
helps.RecordAPIRequest(ctx, cfg, info)
|
|
}
|
|
|
|
func recordAPIResponseMetadata(ctx context.Context, cfg *config.Config, status int, headers http.Header) {
|
|
helps.RecordAPIResponseMetadata(ctx, cfg, status, headers)
|
|
}
|
|
|
|
func recordAPIResponseError(ctx context.Context, cfg *config.Config, err error) {
|
|
helps.RecordAPIResponseError(ctx, cfg, err)
|
|
}
|
|
|
|
func appendAPIResponseChunk(ctx context.Context, cfg *config.Config, chunk []byte) {
|
|
helps.AppendAPIResponseChunk(ctx, cfg, chunk)
|
|
}
|
|
|
|
func summarizeErrorBody(contentType string, body []byte) string {
|
|
return helps.SummarizeErrorBody(contentType, body)
|
|
}
|