Documentation ¶
Overview ¶
Package transcriber is a generated GoMock package.
Index ¶
Constants ¶
const ( ErrMessageInvalidField = "invalid field error: %s" ErrMessageInvalidFieldType = "invalid field type on '%v', expected type '%v', received value '%v'" ErrMessageInvalidFieldCriteria = "invalid field criteria on '%v', expected criteria '%v', received value '%v'" ErrMessageInvalidFieldRequired = "'%v' field is required" )
const (
ErrUnexpectedPanic = "validator: unexpected panic occurred: %v" // Error message for unexpected panics.
)
Variables ¶
var ( ErrTargetIsNotPointer = errors.New("validator: target must be a pointer") ErrTargetIsNotStruct = errors.New("validator: target must be a pointer to a struct") ErrTargetIsNil = errors.New("validator: target cannot be nil") ErrPayloadMaxSize = errors.New("validator: the source's size exceeds the limit") )
Functions ¶
func DefaultTranscriber ¶
func DefaultTranscriber() *transcriber
DefaultTranscriber returns a new instance of Transcriber with the default solver. Use the default solver if you don't need to customize the transcription process.
func NewTranscriber ¶
func NewTranscriber(solver Solver) *transcriber
NewTranscriber returns a new instance of Transcriber with the given solver.
Types ¶
type InvalidFieldError ¶
type InvalidFieldError struct { Field string `json:"field"` Message string `json:"message"` Criteria string `json:"-"` }
InvalidFieldError is a struct that holds the field name and the error message.
func (InvalidFieldError) Error ¶
func (e InvalidFieldError) Error() string
type InvalidFieldsErrors ¶
type InvalidFieldsErrors []InvalidFieldError
func (InvalidFieldsErrors) Error ¶
func (errs InvalidFieldsErrors) Error() string
type MockSolver ¶
type MockSolver struct {
// contains filtered or unexported fields
}
MockSolver is a mock of Solver interface.
func NewMockSolver ¶
func NewMockSolver(ctrl *gomock.Controller) *MockSolver
NewMockSolver creates a new mock instance.
func (*MockSolver) EXPECT ¶
func (m *MockSolver) EXPECT() *MockSolverMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockSolverMockRecorder ¶
type MockSolverMockRecorder struct {
// contains filtered or unexported fields
}
MockSolverMockRecorder is the mock recorder for MockSolver.
type MockTranscriber ¶
type MockTranscriber struct {
// contains filtered or unexported fields
}
MockTranscriber is a mock of Transcriber interface.
func NewMockTranscriber ¶
func NewMockTranscriber(ctrl *gomock.Controller) *MockTranscriber
NewMockTranscriber creates a new mock instance.
func (*MockTranscriber) DecodeAndValidate ¶
func (m *MockTranscriber) DecodeAndValidate(ctx context.Context, source io.Reader, target any) error
DecodeAndValidate mocks base method.
func (*MockTranscriber) EXPECT ¶
func (m *MockTranscriber) EXPECT() *MockTranscriberMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockTranscriberMockRecorder ¶
type MockTranscriberMockRecorder struct {
// contains filtered or unexported fields
}
MockTranscriberMockRecorder is the mock recorder for MockTranscriber.
func (*MockTranscriberMockRecorder) DecodeAndValidate ¶
func (mr *MockTranscriberMockRecorder) DecodeAndValidate(ctx, source, target any) *gomock.Call
DecodeAndValidate indicates an expected call of DecodeAndValidate.