transcriber

package
v0.0.0-...-48c6f6e Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package transcriber is a generated GoMock package.

Index

Constants

View Source
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"
)
View Source
const (
	ErrUnexpectedPanic = "validator: unexpected panic occurred: %v" // Error message for unexpected panics.
)

Variables

View Source
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.

func (*MockSolver) Validate

func (m *MockSolver) Validate(ctx context.Context, val any) error

Validate mocks base method.

type MockSolverMockRecorder

type MockSolverMockRecorder struct {
	// contains filtered or unexported fields
}

MockSolverMockRecorder is the mock recorder for MockSolver.

func (*MockSolverMockRecorder) Validate

func (mr *MockSolverMockRecorder) Validate(ctx, val any) *gomock.Call

Validate indicates an expected call of Validate.

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

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.

type Solver

type Solver interface {
	Validate(ctx context.Context, val any) error
}

Solver is an interface that defines the necessary signature for a validator solver.

type Transcriber

type Transcriber interface {
	DecodeAndValidate(ctx context.Context, source io.Reader, target any) error
}

Transcriber is an interface that defines the necessary signature for a transcriber.

Jump to

Keyboard shortcuts

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