Documentation
¶
Overview ¶
Package pcodecsmock provides a gomock-driven mock of the pcodecs.Manager interface (= proto/zap_codec.MultiManager) so node/vms test files can program codec expectations without importing proto/zap_codec or luxfi/codec directly.
Wave 2G-Internal of the codec rip (#101) replaces the previous re-export of luxfi/codec/codecmock with an in-tree mock of the proto/zap_codec.MultiManager interface. The mock satisfies pcodecs.Manager by shape — RegisterCodec / Marshal / Unmarshal / Size — and is independent of the underlying codec wire format.
Index ¶
- type Manager
- func (m *Manager) EXPECT() *ManagerRecorder
- func (m *Manager) Marshal(version uint16, source interface{}) ([]byte, error)
- func (m *Manager) RegisterCodec(version uint16, codec zap_codec.Codec) error
- func (m *Manager) Size(version uint16, value interface{}) (int, error)
- func (m *Manager) Unmarshal(source []byte, destination interface{}) (uint16, error)
- type ManagerRecorder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager is the gomock-driven mock of pcodecs.Manager (= zap_codec.MultiManager). Tests reach for pcodecsmock.NewManager(ctrl) to obtain a mock that satisfies pcodecs.Manager by shape.
func NewManager ¶
func NewManager(ctrl *gomock.Controller) *Manager
NewManager constructs a fresh Manager mock against the supplied gomock controller.
func (*Manager) EXPECT ¶ added in v1.29.3
func (m *Manager) EXPECT() *ManagerRecorder
EXPECT returns the recorder so tests can program expectations.
func (*Manager) RegisterCodec ¶ added in v1.29.3
RegisterCodec mocks the corresponding MultiManager method.
type ManagerRecorder ¶ added in v1.29.3
type ManagerRecorder struct {
// contains filtered or unexported fields
}
ManagerRecorder is the gomock recorder for Manager. Tests program expectations via mock.EXPECT().<Method>(...).Return(...).
func (*ManagerRecorder) Marshal ¶ added in v1.29.3
func (mr *ManagerRecorder) Marshal(version, source any) *gomock.Call
Marshal expectation.
func (*ManagerRecorder) RegisterCodec ¶ added in v1.29.3
func (mr *ManagerRecorder) RegisterCodec(version, codec any) *gomock.Call
RegisterCodec expectation.