Documentation
¶
Index ¶
- func Debug(format string, v ...interface{})
- func Error(format string, v ...interface{})
- func ExtractLastUserMessage(messages interface{}) string
- func FormatPrompt(messages interface{}) string
- func GenerateID() string
- func GenerateMachineID() string
- func Info(format string, v ...interface{})
- func LogBanner()
- func LogDebug(debug bool, format string, v ...interface{})
- func LogEndpoints(port string)
- func LogProviderRequest(provider, model string)
- func LogProviderResponse(provider string, duration time.Duration, contentLen int)
- func LogProviders(providers map[string]map[string]interface{})
- func LogServerStart(port string)
- func SendJSONError(w http.ResponseWriter, message string, code int)
- func SendSSEChunk(w http.ResponseWriter, data interface{}) error
- func SetLevel(l Level)
- func SetNoColor(nc bool)
- func SetOutput(output io.Writer)
- func Warn(format string, v ...interface{})
- type Level
- type RequestLogger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractLastUserMessage ¶
func ExtractLastUserMessage(messages interface{}) string
func FormatPrompt ¶
func FormatPrompt(messages interface{}) string
func GenerateID ¶
func GenerateID() string
func GenerateMachineID ¶
func GenerateMachineID() string
func LogEndpoints ¶
func LogEndpoints(port string)
func LogProviderRequest ¶
func LogProviderRequest(provider, model string)
func LogProviderResponse ¶
func LogProviders ¶
func LogServerStart ¶
func LogServerStart(port string)
func SendJSONError ¶
func SendJSONError(w http.ResponseWriter, message string, code int)
func SendSSEChunk ¶
func SendSSEChunk(w http.ResponseWriter, data interface{}) error
func SetNoColor ¶
func SetNoColor(nc bool)
Types ¶
type RequestLogger ¶
type RequestLogger struct {
ID string
Method string
Path string
Query string
IP string
StartTime time.Time
// contains filtered or unexported fields
}
func NewRequestLogger ¶
func NewRequestLogger(method, path, query, ip string) *RequestLogger
func (*RequestLogger) End ¶
func (rl *RequestLogger) End(statusCode int, format string, v ...interface{})
func (*RequestLogger) Error ¶
func (rl *RequestLogger) Error(err error)
func (*RequestLogger) Start ¶
func (rl *RequestLogger) Start()
Click to show internal directories.
Click to hide internal directories.