Files
coder/coderd/httpmw/loggermw/loggermock/loggermock.go
T
Spike Curtis 49b34a716a fix: fix slog to always use array of Fields (#21426)
Upgrades to slog v3 which includes a small, but backward incompatible API change to the acceptible call arguments when logging. This change allows us to verify via compile time type checking that arguments are correct and won't cause a panic, as was possible in slog v1, which this replaces (v2 was tagged but never used in coder/coder).

It also updates dependencies that also use slog and were updated.

I've left the `aibridge` dependency as a commit SHA, under the assumption that the team there (cc @pawbana @dannykopping ) will tag and update the dependency soon and on their own schedule.

Other dependencies, I pushed new tags.
2026-01-08 10:29:41 +04:00

85 lines
2.6 KiB
Go

// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/coder/coder/v2/coderd/httpmw/loggermw (interfaces: RequestLogger)
//
// Generated by this command:
//
// mockgen -destination=loggermock/loggermock.go -package=loggermock . RequestLogger
//
// Package loggermock is a generated GoMock package.
package loggermock
import (
context "context"
reflect "reflect"
slog "cdr.dev/slog/v3"
rbac "github.com/coder/coder/v2/coderd/rbac"
gomock "go.uber.org/mock/gomock"
)
// MockRequestLogger is a mock of RequestLogger interface.
type MockRequestLogger struct {
ctrl *gomock.Controller
recorder *MockRequestLoggerMockRecorder
isgomock struct{}
}
// MockRequestLoggerMockRecorder is the mock recorder for MockRequestLogger.
type MockRequestLoggerMockRecorder struct {
mock *MockRequestLogger
}
// NewMockRequestLogger creates a new mock instance.
func NewMockRequestLogger(ctrl *gomock.Controller) *MockRequestLogger {
mock := &MockRequestLogger{ctrl: ctrl}
mock.recorder = &MockRequestLoggerMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockRequestLogger) EXPECT() *MockRequestLoggerMockRecorder {
return m.recorder
}
// WithAuthContext mocks base method.
func (m *MockRequestLogger) WithAuthContext(actor rbac.Subject) {
m.ctrl.T.Helper()
m.ctrl.Call(m, "WithAuthContext", actor)
}
// WithAuthContext indicates an expected call of WithAuthContext.
func (mr *MockRequestLoggerMockRecorder) WithAuthContext(actor any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WithAuthContext", reflect.TypeOf((*MockRequestLogger)(nil).WithAuthContext), actor)
}
// WithFields mocks base method.
func (m *MockRequestLogger) WithFields(fields ...slog.Field) {
m.ctrl.T.Helper()
varargs := []any{}
for _, a := range fields {
varargs = append(varargs, a)
}
m.ctrl.Call(m, "WithFields", varargs...)
}
// WithFields indicates an expected call of WithFields.
func (mr *MockRequestLoggerMockRecorder) WithFields(fields ...any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WithFields", reflect.TypeOf((*MockRequestLogger)(nil).WithFields), fields...)
}
// WriteLog mocks base method.
func (m *MockRequestLogger) WriteLog(ctx context.Context, status int) {
m.ctrl.T.Helper()
m.ctrl.Call(m, "WriteLog", ctx, status)
}
// WriteLog indicates an expected call of WriteLog.
func (mr *MockRequestLoggerMockRecorder) WriteLog(ctx, status any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WriteLog", reflect.TypeOf((*MockRequestLogger)(nil).WriteLog), ctx, status)
}