longbits

package
v0.0.0-...-cdc42b6 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const BitsStringPrefix = "0x"
View Source
const EmptyByteString = ByteString("")

Variables

This section is empty.

Functions

func AsBytes

func AsBytes(v FixedReader) []byte

func BitPos

func BitPos(index int) (bytePos int, bitPos uint8)

func BytesToDigestString

func BytesToDigestString(s FoldableReader, prefix string) string

func BytesToGroupedString

func BytesToGroupedString(s []byte, prefix string, separator string, everyN int) string

func Copy

func Copy(to []byte, from FixedReader) error

func CutOutUint64

func CutOutUint64(v []byte) uint64

func Equal

func Equal(t, o FixedReader) bool

func EqualToBytes

func EqualToBytes(t FixedReader, o []byte) bool

func FillBitsWithStaticNoise

func FillBitsWithStaticNoise(base uint32, v []byte)

This implementation DOES NOT provide secure random! This function has a fixed implementation and MUST remain unchanged as some elements of Consensus rely on identical behavior of this functions. Array size must be aligned to 8 bytes.

func FoldToUint64

func FoldToUint64(v []byte) uint64

func FoldUint64

func FoldUint64(v uint64) uint32

func VerifyReadAt

func VerifyReadAt(b []byte, off int64, max int) (n int, err error)

Types

type BitArrayReader

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

func NewBitArrayReader

func NewBitArrayReader(direction BitBuilderOrder, bytes []byte) *BitArrayReader

func (*BitArrayReader) AlignOffset

func (p *BitArrayReader) AlignOffset() uint8

func (*BitArrayReader) IsArrayDepleted

func (p *BitArrayReader) IsArrayDepleted() bool

func (*BitArrayReader) ReadBit

func (p *BitArrayReader) ReadBit() (int, error)

func (*BitArrayReader) ReadBool

func (p *BitArrayReader) ReadBool() (bool, error)

func (*BitArrayReader) ReadByte

func (p *BitArrayReader) ReadByte() (byte, error)

func (*BitArrayReader) ReadNext

func (p *BitArrayReader) ReadNext() (int, error)

func (*BitArrayReader) ReadSubByte

func (p *BitArrayReader) ReadSubByte(bitLen uint8) (byte, error)

type BitBuilder

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

supports to be created as BitBuilder{} - it equals NewBitBuilder(LSB, 0)

func AppendBitBuilder

func AppendBitBuilder(appendTo []byte, direction BitBuilderOrder) BitBuilder

func NewBitBuilder

func NewBitBuilder(direction BitBuilderOrder, expectedByteLen int) BitBuilder

func (*BitBuilder) AlignOffset

func (p *BitBuilder) AlignOffset() uint8

func (*BitBuilder) Append

func (p *BitBuilder) Append(bit bool)

func (*BitBuilder) AppendAlignedByte

func (p *BitBuilder) AppendAlignedByte(b byte)

func (*BitBuilder) AppendBit

func (p *BitBuilder) AppendBit(bit int)

func (*BitBuilder) AppendByte

func (p *BitBuilder) AppendByte(b byte)

func (*BitBuilder) AppendN

func (p *BitBuilder) AppendN(bitCount int, bit bool)

func (*BitBuilder) AppendNBit

func (p *BitBuilder) AppendNBit(bitCount int, bit int)

func (*BitBuilder) AppendSubByte

func (p *BitBuilder) AppendSubByte(value byte, bitLen uint8)

func (*BitBuilder) BitLen

func (p *BitBuilder) BitLen() int

func (*BitBuilder) CompletedByteCount

func (p *BitBuilder) CompletedByteCount() int

func (*BitBuilder) Copy

func (p *BitBuilder) Copy() *BitBuilder

func (*BitBuilder) Done

func (p *BitBuilder) Done() (b []byte, bitLen int)

func (*BitBuilder) DoneToBits

func (p *BitBuilder) DoneToBits() BitSlice

func (*BitBuilder) DoneToByteString

func (p *BitBuilder) DoneToByteString() (ByteString, int)

func (*BitBuilder) DoneToBytes

func (p *BitBuilder) DoneToBytes() []byte

func (*BitBuilder) IsZero

func (p *BitBuilder) IsZero() bool

func (*BitBuilder) PadWith

func (p *BitBuilder) PadWith(bit bool)

func (*BitBuilder) PadWithBit

func (p *BitBuilder) PadWithBit(bit int)

func (*BitBuilder) Set

func (p *BitBuilder) Set(index int, bit, padding bool)

func (*BitBuilder) SetBit

func (p *BitBuilder) SetBit(index, bit int)

func (*BitBuilder) ToggleBit

func (p *BitBuilder) ToggleBit(index int) bool

func (*BitBuilder) TrimZeros

func (p *BitBuilder) TrimZeros() (skippedPrefix int, b []byte)

type BitBuilderOrder

type BitBuilderOrder byte
const (
	// Least significant bit is first - first AppendBit() appends the least significant bit
	LSB BitBuilderOrder = 0
	// Most significant bit is first - first AppendBit() appends the most significant bit
	MSB BitBuilderOrder = 1
)

type BitIoReader

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

func NewBitIoReader

func NewBitIoReader(order BitBuilderOrder, byteReader io.ByteReader) *BitIoReader

func (*BitIoReader) AlignOffset

func (p *BitIoReader) AlignOffset() uint8

func (*BitIoReader) ReadBit

func (p *BitIoReader) ReadBit() (int, error)

func (*BitIoReader) ReadBool

func (p *BitIoReader) ReadBool() (bool, error)

func (*BitIoReader) ReadByte

func (p *BitIoReader) ReadByte() (byte, error)

func (*BitIoReader) ReadNext

func (p *BitIoReader) ReadNext() (int, error)

func (*BitIoReader) ReadSubByte

func (p *BitIoReader) ReadSubByte(bitLen uint8) (byte, error)

type BitSlice

type BitSlice = BitSliceLSB

type BitSliceLSB

type BitSliceLSB []byte

func (BitSliceLSB) BitBool

func (v BitSliceLSB) BitBool(index int) bool

func (BitSliceLSB) BitLen

func (v BitSliceLSB) BitLen() int

func (BitSliceLSB) BitMasked

func (v BitSliceLSB) BitMasked(index int) (value byte, mask uint8)

func (BitSliceLSB) BitValue

func (v BitSliceLSB) BitValue(index int) byte

func (BitSliceLSB) Byte

func (v BitSliceLSB) Byte(index int) byte

func (BitSliceLSB) SearchBit

func (v BitSliceLSB) SearchBit(startAt int, bit bool) int

type BitSliceMSB

type BitSliceMSB []byte

func (BitSliceMSB) BitBool

func (v BitSliceMSB) BitBool(index int) bool

func (BitSliceMSB) BitLen

func (v BitSliceMSB) BitLen() int

func (BitSliceMSB) BitMasked

func (v BitSliceMSB) BitMasked(index int) (value byte, mask uint8)

func (BitSliceMSB) BitValue

func (v BitSliceMSB) BitValue(index int) byte

func (BitSliceMSB) Byte

func (v BitSliceMSB) Byte(index int) byte

func (BitSliceMSB) SearchBit

func (v BitSliceMSB) SearchBit(startAt int, bit bool) int

type BitStrReader

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

func NewBitStrReader

func NewBitStrReader(direction BitBuilderOrder, bytes ByteString) *BitStrReader

func (*BitStrReader) AlignOffset

func (p *BitStrReader) AlignOffset() uint8

func (*BitStrReader) IsArrayDepleted

func (p *BitStrReader) IsArrayDepleted() bool

func (*BitStrReader) ReadBit

func (p *BitStrReader) ReadBit() (int, error)

func (*BitStrReader) ReadBool

func (p *BitStrReader) ReadBool() (bool, error)

func (*BitStrReader) ReadByte

func (p *BitStrReader) ReadByte() (byte, error)

func (*BitStrReader) ReadNext

func (p *BitStrReader) ReadNext() (int, error)

func (*BitStrReader) ReadSubByte

func (p *BitStrReader) ReadSubByte(bitLen uint8) (byte, error)

type Bits128

type Bits128 [16]byte

func NewBits128

func NewBits128(lo, hi uint64) Bits128

func NewBits128FromBytes

func NewBits128FromBytes(bytes []byte) Bits128

func (Bits128) AsByteString

func (v Bits128) AsByteString() ByteString

func (Bits128) AsBytes

func (v Bits128) AsBytes() []byte

deprecated // use longbits.AsBytes()

func (Bits128) Compare

func (v Bits128) Compare(other Bits128) int

func (Bits128) CopyTo

func (v Bits128) CopyTo(p []byte) int

func (Bits128) CutOutUint64

func (v Bits128) CutOutUint64() uint64

func (Bits128) FixedByteSize

func (v Bits128) FixedByteSize() int

func (Bits128) FoldToUint64

func (v Bits128) FoldToUint64() uint64

func (Bits128) ReadAt

func (v Bits128) ReadAt(b []byte, off int64) (n int, err error)

func (Bits128) String

func (v Bits128) String() string

func (Bits128) WriteTo

func (v Bits128) WriteTo(w io.Writer) (int64, error)

type Bits224

type Bits224 [28]byte

func NewBits224FromBytes

func NewBits224FromBytes(bytes []byte) Bits224

func (Bits224) AsByteString

func (v Bits224) AsByteString() ByteString

func (Bits224) AsBytes

func (v Bits224) AsBytes() []byte

deprecated // use longbits.AsBytes()

func (Bits224) Compare

func (v Bits224) Compare(other Bits224) int

func (Bits224) CopyTo

func (v Bits224) CopyTo(p []byte) int

func (Bits224) CutOutUint64

func (v Bits224) CutOutUint64() uint64

func (Bits224) FixedByteSize

func (v Bits224) FixedByteSize() int

func (Bits224) FoldToUint64

func (v Bits224) FoldToUint64() uint64

func (Bits224) ReadAt

func (v Bits224) ReadAt(b []byte, off int64) (n int, err error)

func (Bits224) String

func (v Bits224) String() string

func (Bits224) WriteTo

func (v Bits224) WriteTo(w io.Writer) (int64, error)

type Bits256

type Bits256 [32]byte

func NewBits256FromBytes

func NewBits256FromBytes(bytes []byte) Bits256

func (Bits256) AsByteString

func (v Bits256) AsByteString() ByteString

func (Bits256) AsBytes

func (v Bits256) AsBytes() []byte

deprecated // use longbits.AsBytes()

func (Bits256) Compare

func (v Bits256) Compare(other Bits256) int

func (Bits256) CopyTo

func (v Bits256) CopyTo(p []byte) int

func (Bits256) CutOutUint64

func (v Bits256) CutOutUint64() uint64

func (Bits256) FixedByteSize

func (v Bits256) FixedByteSize() int

func (Bits256) FoldToBits128

func (v Bits256) FoldToBits128() (r Bits128)

func (Bits256) FoldToBits224

func (v Bits256) FoldToBits224() Bits224

func (Bits256) FoldToUint64

func (v Bits256) FoldToUint64() uint64

func (Bits256) ReadAt

func (v Bits256) ReadAt(b []byte, off int64) (n int, err error)

func (Bits256) String

func (v Bits256) String() string

func (Bits256) TruncateToBits224

func (v Bits256) TruncateToBits224() (r Bits224)

TruncateToBits224 returns leftmost bits, and it is compliant with cryptography standards, e.g. FIPS 180‑4 and SP 800-107

func (Bits256) WriteTo

func (v Bits256) WriteTo(w io.Writer) (int64, error)

type Bits512

type Bits512 [64]byte

func NewBits512FromBytes

func NewBits512FromBytes(bytes []byte) Bits512

func (Bits512) AsByteString

func (v Bits512) AsByteString() ByteString

func (Bits512) AsBytes

func (v Bits512) AsBytes() []byte

deprecated // use longbits.AsBytes()

func (Bits512) Compare

func (v Bits512) Compare(other Bits512) int

func (Bits512) CopyTo

func (v Bits512) CopyTo(p []byte) int

func (Bits512) CutOutUint64

func (v Bits512) CutOutUint64() uint64

func (Bits512) FixedByteSize

func (v Bits512) FixedByteSize() int

func (Bits512) FoldToBits224

func (v Bits512) FoldToBits224() (r Bits224)

func (Bits512) FoldToBits256

func (v Bits512) FoldToBits256() (r Bits256)

func (Bits512) FoldToUint64

func (v Bits512) FoldToUint64() uint64

func (Bits512) ReadAt

func (v Bits512) ReadAt(b []byte, off int64) (n int, err error)

func (Bits512) String

func (v Bits512) String() string

func (Bits512) WriteTo

func (v Bits512) WriteTo(w io.Writer) (int64, error)

type Bits64

type Bits64 [8]byte

func CutOutBits64

func CutOutBits64(v []byte) (folded Bits64)

CutOutBits64 either copies all bytes or picks evenly bytes from (v). Sizes do not need to be aligned. WARNING! This is NOT compliant with cryptography standards, e.g. FIPS 180‑4 and SP 800-107

func FoldToBits64

func FoldToBits64(v []byte) (folded Bits64)

Array size doesnt need to be aligned

func NewBits64

func NewBits64(v uint64) Bits64

func NewBits64FromBytes

func NewBits64FromBytes(bytes []byte) Bits64

func (Bits64) AsByteString

func (v Bits64) AsByteString() ByteString

func (Bits64) AsBytes

func (v Bits64) AsBytes() []byte

deprecated // use longbits.AsBytes()

func (Bits64) Compare

func (v Bits64) Compare(other Bits64) int

func (Bits64) CopyTo

func (v Bits64) CopyTo(p []byte) int

func (Bits64) CutOutUint64

func (v Bits64) CutOutUint64() uint64

func (Bits64) FixedByteSize

func (v Bits64) FixedByteSize() int

func (Bits64) FoldToUint64

func (v Bits64) FoldToUint64() uint64

func (Bits64) ReadAt

func (v Bits64) ReadAt(b []byte, off int64) (n int, err error)

TODO test for all ReadAt

func (Bits64) String

func (v Bits64) String() string

func (Bits64) WriteTo

func (v Bits64) WriteTo(w io.Writer) (int64, error)

type ByteString

type ByteString string

func CopyBytes

func CopyBytes(v []byte) ByteString

func Fill

func Fill(len int, fill byte) ByteString

func WrapStr

func WrapStr(s string) ByteString

func Zero

func Zero(len int) ByteString

func (ByteString) AsByteString

func (v ByteString) AsByteString() ByteString

func (ByteString) BitBool

func (v ByteString) BitBool(index int) bool

func (ByteString) BitLen

func (v ByteString) BitLen() int

func (ByteString) BitMasked

func (v ByteString) BitMasked(index int) (value byte, mask uint8)

func (ByteString) BitPos

func (v ByteString) BitPos(index int) (bytePos int, bitPos uint8)

func (ByteString) BitValue

func (v ByteString) BitValue(index int) byte

func (ByteString) Byte

func (v ByteString) Byte(index int) byte

func (ByteString) CopyTo

func (v ByteString) CopyTo(b []byte) int

func (ByteString) CutOutBits64

func (v ByteString) CutOutBits64() (folded Bits64)

func (ByteString) CutOutUint64

func (v ByteString) CutOutUint64() uint64

func (ByteString) Equal

func (v ByteString) Equal(other FixedReader) bool

func (ByteString) FixedByteSize

func (v ByteString) FixedByteSize() int

func (ByteString) FoldToBits64

func (v ByteString) FoldToBits64() (folded Bits64)

func (ByteString) FoldToUint64

func (v ByteString) FoldToUint64() uint64

func (ByteString) Hex

func (v ByteString) Hex() string

func (ByteString) IsEmpty

func (v ByteString) IsEmpty() bool

func (ByteString) NewIoReader

func (v ByteString) NewIoReader() io.Reader

func (ByteString) ReadAt

func (v ByteString) ReadAt(b []byte, off int64) (n int, err error)

func (ByteString) SearchBit

func (v ByteString) SearchBit(startAt int, bit bool) int

func (ByteString) String

func (v ByteString) String() string

func (ByteString) WriteTo

func (v ByteString) WriteTo(w io.Writer) (int64, error)

type FixedReader

type FixedReader interface {
	io.WriterTo
	CopyTo(p []byte) int
	AsByteString() ByteString

	FixedByteSize() int
}

type FixedReaderMock

type FixedReaderMock struct {
	AsByteStringMock mFixedReaderMockAsByteString

	CopyToMock mFixedReaderMockCopyTo

	FixedByteSizeMock mFixedReaderMockFixedByteSize

	WriteToMock mFixedReaderMockWriteTo
	// contains filtered or unexported fields
}

FixedReaderMock implements FixedReader

func NewFixedReaderMock

func NewFixedReaderMock(t minimock.Tester) *FixedReaderMock

NewFixedReaderMock returns a mock for FixedReader

func (*FixedReaderMock) AsByteString

func (mmAsByteString *FixedReaderMock) AsByteString() (b1 ByteString)

AsByteString implements FixedReader

func (*FixedReaderMock) AsByteStringAfterCounter

func (mmAsByteString *FixedReaderMock) AsByteStringAfterCounter() uint64

AsByteStringAfterCounter returns a count of finished FixedReaderMock.AsByteString invocations

func (*FixedReaderMock) AsByteStringBeforeCounter

func (mmAsByteString *FixedReaderMock) AsByteStringBeforeCounter() uint64

AsByteStringBeforeCounter returns a count of FixedReaderMock.AsByteString invocations

func (*FixedReaderMock) CopyTo

func (mmCopyTo *FixedReaderMock) CopyTo(p []byte) (i1 int)

CopyTo implements FixedReader

func (*FixedReaderMock) CopyToAfterCounter

func (mmCopyTo *FixedReaderMock) CopyToAfterCounter() uint64

CopyToAfterCounter returns a count of finished FixedReaderMock.CopyTo invocations

func (*FixedReaderMock) CopyToBeforeCounter

func (mmCopyTo *FixedReaderMock) CopyToBeforeCounter() uint64

CopyToBeforeCounter returns a count of FixedReaderMock.CopyTo invocations

func (*FixedReaderMock) FixedByteSize

func (mmFixedByteSize *FixedReaderMock) FixedByteSize() (i1 int)

FixedByteSize implements FixedReader

func (*FixedReaderMock) FixedByteSizeAfterCounter

func (mmFixedByteSize *FixedReaderMock) FixedByteSizeAfterCounter() uint64

FixedByteSizeAfterCounter returns a count of finished FixedReaderMock.FixedByteSize invocations

func (*FixedReaderMock) FixedByteSizeBeforeCounter

func (mmFixedByteSize *FixedReaderMock) FixedByteSizeBeforeCounter() uint64

FixedByteSizeBeforeCounter returns a count of FixedReaderMock.FixedByteSize invocations

func (*FixedReaderMock) MinimockAsByteStringDone

func (m *FixedReaderMock) MinimockAsByteStringDone() bool

MinimockAsByteStringDone returns true if the count of the AsByteString invocations corresponds the number of defined expectations

func (*FixedReaderMock) MinimockAsByteStringInspect

func (m *FixedReaderMock) MinimockAsByteStringInspect()

MinimockAsByteStringInspect logs each unmet expectation

func (*FixedReaderMock) MinimockCopyToDone

func (m *FixedReaderMock) MinimockCopyToDone() bool

MinimockCopyToDone returns true if the count of the CopyTo invocations corresponds the number of defined expectations

func (*FixedReaderMock) MinimockCopyToInspect

func (m *FixedReaderMock) MinimockCopyToInspect()

MinimockCopyToInspect logs each unmet expectation

func (*FixedReaderMock) MinimockFinish

func (m *FixedReaderMock) MinimockFinish()

MinimockFinish checks that all mocked methods have been called the expected number of times

func (*FixedReaderMock) MinimockFixedByteSizeDone

func (m *FixedReaderMock) MinimockFixedByteSizeDone() bool

MinimockFixedByteSizeDone returns true if the count of the FixedByteSize invocations corresponds the number of defined expectations

func (*FixedReaderMock) MinimockFixedByteSizeInspect

func (m *FixedReaderMock) MinimockFixedByteSizeInspect()

MinimockFixedByteSizeInspect logs each unmet expectation

func (*FixedReaderMock) MinimockWait

func (m *FixedReaderMock) MinimockWait(timeout mm_time.Duration)

MinimockWait waits for all mocked methods to be called the expected number of times

func (*FixedReaderMock) MinimockWriteToDone

func (m *FixedReaderMock) MinimockWriteToDone() bool

MinimockWriteToDone returns true if the count of the WriteTo invocations corresponds the number of defined expectations

func (*FixedReaderMock) MinimockWriteToInspect

func (m *FixedReaderMock) MinimockWriteToInspect()

MinimockWriteToInspect logs each unmet expectation

func (*FixedReaderMock) WriteTo

func (mmWriteTo *FixedReaderMock) WriteTo(w io.Writer) (n int64, err error)

WriteTo implements FixedReader

func (*FixedReaderMock) WriteToAfterCounter

func (mmWriteTo *FixedReaderMock) WriteToAfterCounter() uint64

WriteToAfterCounter returns a count of finished FixedReaderMock.WriteTo invocations

func (*FixedReaderMock) WriteToBeforeCounter

func (mmWriteTo *FixedReaderMock) WriteToBeforeCounter() uint64

WriteToBeforeCounter returns a count of FixedReaderMock.WriteTo invocations

type FixedReaderMockAsByteStringExpectation

type FixedReaderMockAsByteStringExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

FixedReaderMockAsByteStringExpectation specifies expectation struct of the FixedReader.AsByteString

type FixedReaderMockAsByteStringResults

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

FixedReaderMockAsByteStringResults contains results of the FixedReader.AsByteString

type FixedReaderMockCopyToExpectation

type FixedReaderMockCopyToExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

FixedReaderMockCopyToExpectation specifies expectation struct of the FixedReader.CopyTo

func (*FixedReaderMockCopyToExpectation) Then

Then sets up FixedReader.CopyTo return parameters for the expectation previously defined by the When method

type FixedReaderMockCopyToParams

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

FixedReaderMockCopyToParams contains parameters of the FixedReader.CopyTo

type FixedReaderMockCopyToResults

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

FixedReaderMockCopyToResults contains results of the FixedReader.CopyTo

type FixedReaderMockFixedByteSizeExpectation

type FixedReaderMockFixedByteSizeExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

FixedReaderMockFixedByteSizeExpectation specifies expectation struct of the FixedReader.FixedByteSize

type FixedReaderMockFixedByteSizeResults

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

FixedReaderMockFixedByteSizeResults contains results of the FixedReader.FixedByteSize

type FixedReaderMockWriteToExpectation

type FixedReaderMockWriteToExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

FixedReaderMockWriteToExpectation specifies expectation struct of the FixedReader.WriteTo

func (*FixedReaderMockWriteToExpectation) Then

Then sets up FixedReader.WriteTo return parameters for the expectation previously defined by the When method

type FixedReaderMockWriteToParams

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

FixedReaderMockWriteToParams contains parameters of the FixedReader.WriteTo

type FixedReaderMockWriteToResults

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

FixedReaderMockWriteToResults contains results of the FixedReader.WriteTo

type Foldable

type Foldable interface {
	FoldToUint64() uint64
}

type FoldableReader

type FoldableReader interface {
	FixedReader
	Foldable
}

func CopyFixed

func CopyFixed(v FixedReader) FoldableReader

func WrapBytes

func WrapBytes(data []byte) FoldableReader

type FoldableReaderMock

type FoldableReaderMock struct {
	AsByteStringMock mFoldableReaderMockAsByteString

	CopyToMock mFoldableReaderMockCopyTo

	FixedByteSizeMock mFoldableReaderMockFixedByteSize

	FoldToUint64Mock mFoldableReaderMockFoldToUint64

	WriteToMock mFoldableReaderMockWriteTo
	// contains filtered or unexported fields
}

FoldableReaderMock implements FoldableReader

func NewFoldableReaderMock

func NewFoldableReaderMock(t minimock.Tester) *FoldableReaderMock

NewFoldableReaderMock returns a mock for FoldableReader

func (*FoldableReaderMock) AsByteString

func (mmAsByteString *FoldableReaderMock) AsByteString() (b1 ByteString)

AsByteString implements FoldableReader

func (*FoldableReaderMock) AsByteStringAfterCounter

func (mmAsByteString *FoldableReaderMock) AsByteStringAfterCounter() uint64

AsByteStringAfterCounter returns a count of finished FoldableReaderMock.AsByteString invocations

func (*FoldableReaderMock) AsByteStringBeforeCounter

func (mmAsByteString *FoldableReaderMock) AsByteStringBeforeCounter() uint64

AsByteStringBeforeCounter returns a count of FoldableReaderMock.AsByteString invocations

func (*FoldableReaderMock) CopyTo

func (mmCopyTo *FoldableReaderMock) CopyTo(p []byte) (i1 int)

CopyTo implements FoldableReader

func (*FoldableReaderMock) CopyToAfterCounter

func (mmCopyTo *FoldableReaderMock) CopyToAfterCounter() uint64

CopyToAfterCounter returns a count of finished FoldableReaderMock.CopyTo invocations

func (*FoldableReaderMock) CopyToBeforeCounter

func (mmCopyTo *FoldableReaderMock) CopyToBeforeCounter() uint64

CopyToBeforeCounter returns a count of FoldableReaderMock.CopyTo invocations

func (*FoldableReaderMock) FixedByteSize

func (mmFixedByteSize *FoldableReaderMock) FixedByteSize() (i1 int)

FixedByteSize implements FoldableReader

func (*FoldableReaderMock) FixedByteSizeAfterCounter

func (mmFixedByteSize *FoldableReaderMock) FixedByteSizeAfterCounter() uint64

FixedByteSizeAfterCounter returns a count of finished FoldableReaderMock.FixedByteSize invocations

func (*FoldableReaderMock) FixedByteSizeBeforeCounter

func (mmFixedByteSize *FoldableReaderMock) FixedByteSizeBeforeCounter() uint64

FixedByteSizeBeforeCounter returns a count of FoldableReaderMock.FixedByteSize invocations

func (*FoldableReaderMock) FoldToUint64

func (mmFoldToUint64 *FoldableReaderMock) FoldToUint64() (u1 uint64)

FoldToUint64 implements FoldableReader

func (*FoldableReaderMock) FoldToUint64AfterCounter

func (mmFoldToUint64 *FoldableReaderMock) FoldToUint64AfterCounter() uint64

FoldToUint64AfterCounter returns a count of finished FoldableReaderMock.FoldToUint64 invocations

func (*FoldableReaderMock) FoldToUint64BeforeCounter

func (mmFoldToUint64 *FoldableReaderMock) FoldToUint64BeforeCounter() uint64

FoldToUint64BeforeCounter returns a count of FoldableReaderMock.FoldToUint64 invocations

func (*FoldableReaderMock) MinimockAsByteStringDone

func (m *FoldableReaderMock) MinimockAsByteStringDone() bool

MinimockAsByteStringDone returns true if the count of the AsByteString invocations corresponds the number of defined expectations

func (*FoldableReaderMock) MinimockAsByteStringInspect

func (m *FoldableReaderMock) MinimockAsByteStringInspect()

MinimockAsByteStringInspect logs each unmet expectation

func (*FoldableReaderMock) MinimockCopyToDone

func (m *FoldableReaderMock) MinimockCopyToDone() bool

MinimockCopyToDone returns true if the count of the CopyTo invocations corresponds the number of defined expectations

func (*FoldableReaderMock) MinimockCopyToInspect

func (m *FoldableReaderMock) MinimockCopyToInspect()

MinimockCopyToInspect logs each unmet expectation

func (*FoldableReaderMock) MinimockFinish

func (m *FoldableReaderMock) MinimockFinish()

MinimockFinish checks that all mocked methods have been called the expected number of times

func (*FoldableReaderMock) MinimockFixedByteSizeDone

func (m *FoldableReaderMock) MinimockFixedByteSizeDone() bool

MinimockFixedByteSizeDone returns true if the count of the FixedByteSize invocations corresponds the number of defined expectations

func (*FoldableReaderMock) MinimockFixedByteSizeInspect

func (m *FoldableReaderMock) MinimockFixedByteSizeInspect()

MinimockFixedByteSizeInspect logs each unmet expectation

func (*FoldableReaderMock) MinimockFoldToUint64Done

func (m *FoldableReaderMock) MinimockFoldToUint64Done() bool

MinimockFoldToUint64Done returns true if the count of the FoldToUint64 invocations corresponds the number of defined expectations

func (*FoldableReaderMock) MinimockFoldToUint64Inspect

func (m *FoldableReaderMock) MinimockFoldToUint64Inspect()

MinimockFoldToUint64Inspect logs each unmet expectation

func (*FoldableReaderMock) MinimockWait

func (m *FoldableReaderMock) MinimockWait(timeout mm_time.Duration)

MinimockWait waits for all mocked methods to be called the expected number of times

func (*FoldableReaderMock) MinimockWriteToDone

func (m *FoldableReaderMock) MinimockWriteToDone() bool

MinimockWriteToDone returns true if the count of the WriteTo invocations corresponds the number of defined expectations

func (*FoldableReaderMock) MinimockWriteToInspect

func (m *FoldableReaderMock) MinimockWriteToInspect()

MinimockWriteToInspect logs each unmet expectation

func (*FoldableReaderMock) WriteTo

func (mmWriteTo *FoldableReaderMock) WriteTo(w io.Writer) (n int64, err error)

WriteTo implements FoldableReader

func (*FoldableReaderMock) WriteToAfterCounter

func (mmWriteTo *FoldableReaderMock) WriteToAfterCounter() uint64

WriteToAfterCounter returns a count of finished FoldableReaderMock.WriteTo invocations

func (*FoldableReaderMock) WriteToBeforeCounter

func (mmWriteTo *FoldableReaderMock) WriteToBeforeCounter() uint64

WriteToBeforeCounter returns a count of FoldableReaderMock.WriteTo invocations

type FoldableReaderMockAsByteStringExpectation

type FoldableReaderMockAsByteStringExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

FoldableReaderMockAsByteStringExpectation specifies expectation struct of the FoldableReader.AsByteString

type FoldableReaderMockAsByteStringResults

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

FoldableReaderMockAsByteStringResults contains results of the FoldableReader.AsByteString

type FoldableReaderMockCopyToExpectation

type FoldableReaderMockCopyToExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

FoldableReaderMockCopyToExpectation specifies expectation struct of the FoldableReader.CopyTo

func (*FoldableReaderMockCopyToExpectation) Then

Then sets up FoldableReader.CopyTo return parameters for the expectation previously defined by the When method

type FoldableReaderMockCopyToParams

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

FoldableReaderMockCopyToParams contains parameters of the FoldableReader.CopyTo

type FoldableReaderMockCopyToResults

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

FoldableReaderMockCopyToResults contains results of the FoldableReader.CopyTo

type FoldableReaderMockFixedByteSizeExpectation

type FoldableReaderMockFixedByteSizeExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

FoldableReaderMockFixedByteSizeExpectation specifies expectation struct of the FoldableReader.FixedByteSize

type FoldableReaderMockFixedByteSizeResults

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

FoldableReaderMockFixedByteSizeResults contains results of the FoldableReader.FixedByteSize

type FoldableReaderMockFoldToUint64Expectation

type FoldableReaderMockFoldToUint64Expectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

FoldableReaderMockFoldToUint64Expectation specifies expectation struct of the FoldableReader.FoldToUint64

type FoldableReaderMockFoldToUint64Results

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

FoldableReaderMockFoldToUint64Results contains results of the FoldableReader.FoldToUint64

type FoldableReaderMockWriteToExpectation

type FoldableReaderMockWriteToExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

FoldableReaderMockWriteToExpectation specifies expectation struct of the FoldableReader.WriteTo

func (*FoldableReaderMockWriteToExpectation) Then

Then sets up FoldableReader.WriteTo return parameters for the expectation previously defined by the When method

type FoldableReaderMockWriteToParams

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

FoldableReaderMockWriteToParams contains parameters of the FoldableReader.WriteTo

type FoldableReaderMockWriteToResults

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

FoldableReaderMockWriteToResults contains results of the FoldableReader.WriteTo

type IndexedBits

type IndexedBits interface {
	BitBool(index int) bool
	BitValue(index int) byte
	Byte(index int) byte
	BitLen() int
	SearchBit(startAt int, bit bool) int
}

Jump to

Keyboard shortcuts

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