example

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package example. Just data types for testing in here.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StructDecode

func StructDecode(s *Struct, src []byte) (err error)

StructEncode decodes content of Struct.

func StructEncode

func StructEncode(dst []byte, s *Struct) []byte

func StructLen added in v0.3.0

func StructLen(s *Struct) int

func TypeRecorderDispatch

func TypeRecorderDispatch(disp Source, rec []byte) error

TypeRecorderDispatch dispatches encoded data made with TypeRecorder

Types

type EncDec

type EncDec bool

EncDec auto-apply type.

func (*EncDec) Decode

func (x *EncDec) Decode(rec []byte) ([]byte, error)

Decode to auto-apply decoding.

func (EncDec) Encode

func (x EncDec) Encode(buf []byte) []byte

Encode to auto-apply encoding.

func (EncDec) Len

func (x EncDec) Len() int

Len to auto-apply encoding.

type Index

type Index struct {
	Term  uint64
	Index uint64
}

Index to be handled by custom type handler.

type Source

type Source interface {
	Fixeds(a bool, b int32, c uint16, d float64, e [12]byte) error
	Vars(a string, b []byte, c intypes.VI16, d intypes.VU32, e EncDec, id Index) error
}

Source interface to generate testing stuff.

type SourceMock

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

SourceMock interface github.com/sirkon/fenneg/example/internal/example.Source mock

func NewSourceMock

func NewSourceMock(ctrl *gomock.Controller) *SourceMock

NewSourceMock creates SourceMock instance

func (*SourceMock) EXPECT

func (m *SourceMock) EXPECT() *SourceMockRecorder

EXPECT returns expected calls recorder

func (*SourceMock) Fixeds

func (m *SourceMock) Fixeds(a bool, b int32, c uint16, d float64, e [12]byte) (err error)

Fixeds method to implement github.com/sirkon/fenneg/example/internal/example.Source

func (*SourceMock) Vars

func (m *SourceMock) Vars(a string, b []byte, c int16, d uint32, e EncDec, id Index) (err error)

Vars method to implement github.com/sirkon/fenneg/example/internal/example.Source

type SourceMockRecorder

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

SourceMockRecorder records expected calls of github.com/sirkon/fenneg/example/internal/example.Source

func (*SourceMockRecorder) Fixeds

func (mr *SourceMockRecorder) Fixeds(a, b, c, d, e any) *gomock.Call

Fixeds register expected call of method github.com/sirkon/fenneg/example/internal/example.Source.Fixeds

func (*SourceMockRecorder) FixedsWhatever

func (mr *SourceMockRecorder) FixedsWhatever() *gomock.Call

FixedsWhatever records a call with arbitrary arguments.

func (*SourceMockRecorder) Vars

func (mr *SourceMockRecorder) Vars(a, b, c, d, e, id any) *gomock.Call

Vars register expected call of method github.com/sirkon/fenneg/example/internal/example.Source.Vars

func (*SourceMockRecorder) VarsWhatever

func (mr *SourceMockRecorder) VarsWhatever() *gomock.Call

VarsWhatever records a call with arbitrary arguments.

type Struct

type Struct struct {
	ID       Index
	ChangeID Index
	Repeat   uint32
	Theme    uint32
	Data     []byte
	Field    string
}

type TypeRecorder

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

TypeRecorder implement

func (*TypeRecorder) Fixeds

func (t *TypeRecorder) Fixeds(a bool, b int32, c uint16, d float64, e [12]byte) error

Fixeds encodes arguments tuple of this method.

func (*TypeRecorder) Vars

func (t *TypeRecorder) Vars(a string, b []byte, c int16, d uint32, e EncDec, id Index) error

Vars encodes arguments tuple of this method.

Jump to

Keyboard shortcuts

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