descriptor

package
v0.0.0-...-05bc493 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	ByClassRef(ctx context.Context, classRef reference.Global) (Class, Code, error)
	RegisterCallback(cb CacheCallbackType)
}

Cache provides convenient way to get class and code descriptors of objects without fetching them twice

type CacheCallbackType

type CacheCallbackType func(reference reference.Global) (interface{}, error)

type CacheMock

type CacheMock struct {
	ByClassRefMock mCacheMockByClassRef

	RegisterCallbackMock mCacheMockRegisterCallback
	// contains filtered or unexported fields
}

CacheMock implements Cache

func NewCacheMock

func NewCacheMock(t minimock.Tester) *CacheMock

NewCacheMock returns a mock for Cache

func (*CacheMock) ByClassRef

func (mmByClassRef *CacheMock) ByClassRef(ctx context.Context, classRef reference.Global) (c2 Class, c3 Code, err error)

ByClassRef implements Cache

func (*CacheMock) ByClassRefAfterCounter

func (mmByClassRef *CacheMock) ByClassRefAfterCounter() uint64

ByClassRefAfterCounter returns a count of finished CacheMock.ByClassRef invocations

func (*CacheMock) ByClassRefBeforeCounter

func (mmByClassRef *CacheMock) ByClassRefBeforeCounter() uint64

ByClassRefBeforeCounter returns a count of CacheMock.ByClassRef invocations

func (*CacheMock) MinimockByClassRefDone

func (m *CacheMock) MinimockByClassRefDone() bool

MinimockByClassRefDone returns true if the count of the ByClassRef invocations corresponds the number of defined expectations

func (*CacheMock) MinimockByClassRefInspect

func (m *CacheMock) MinimockByClassRefInspect()

MinimockByClassRefInspect logs each unmet expectation

func (*CacheMock) MinimockFinish

func (m *CacheMock) MinimockFinish()

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

func (*CacheMock) MinimockRegisterCallbackDone

func (m *CacheMock) MinimockRegisterCallbackDone() bool

MinimockRegisterCallbackDone returns true if the count of the RegisterCallback invocations corresponds the number of defined expectations

func (*CacheMock) MinimockRegisterCallbackInspect

func (m *CacheMock) MinimockRegisterCallbackInspect()

MinimockRegisterCallbackInspect logs each unmet expectation

func (*CacheMock) MinimockWait

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

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

func (*CacheMock) RegisterCallback

func (mmRegisterCallback *CacheMock) RegisterCallback(cb CacheCallbackType)

RegisterCallback implements Cache

func (*CacheMock) RegisterCallbackAfterCounter

func (mmRegisterCallback *CacheMock) RegisterCallbackAfterCounter() uint64

RegisterCallbackAfterCounter returns a count of finished CacheMock.RegisterCallback invocations

func (*CacheMock) RegisterCallbackBeforeCounter

func (mmRegisterCallback *CacheMock) RegisterCallbackBeforeCounter() uint64

RegisterCallbackBeforeCounter returns a count of CacheMock.RegisterCallback invocations

type CacheMockByClassRefExpectation

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

CacheMockByClassRefExpectation specifies expectation struct of the Cache.ByClassRef

func (*CacheMockByClassRefExpectation) Then

Then sets up Cache.ByClassRef return parameters for the expectation previously defined by the When method

type CacheMockByClassRefParams

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

CacheMockByClassRefParams contains parameters of the Cache.ByClassRef

type CacheMockByClassRefResults

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

CacheMockByClassRefResults contains results of the Cache.ByClassRef

type CacheMockRegisterCallbackExpectation

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

CacheMockRegisterCallbackExpectation specifies expectation struct of the Cache.RegisterCallback

type CacheMockRegisterCallbackParams

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

CacheMockRegisterCallbackParams contains parameters of the Cache.RegisterCallback

type Class

type Class interface {
	// HeadRef returns head reference to represented object record.
	HeadRef() reference.Global

	// StateID returns reference to object state record.
	StateID() reference.Local

	// Code returns code reference.
	Code() reference.Global
}

Class represents meta info required to fetch all class data.

func NewClass

func NewClass(
	head reference.Global, state reference.Local, code reference.Global,
) Class

type Code

type Code interface {
	// Ref returns reference to represented code record.
	Ref() reference.Global

	// Type returns code machine type for represented code.
	MachineType() machinetype.Type

	// Code returns code data.
	Code() ([]byte, error)
}

Code represents meta info required to fetch all code data.

func NewCode

func NewCode(content []byte, machineType machinetype.Type, ref reference.Global) Code

type Object

type Object interface {
	// IsEmpty returns true if descriptor is empty
	IsEmpty() bool

	// HeadRef returns head reference to represented object record.
	HeadRef() reference.Global

	// State returns reference to object state record.
	State() reference.Global

	// Memory fetches object memory from storage.
	Memory() []byte

	// Class returns class reference.
	Class() reference.Global

	// Deactivated return true after SelfDestruct was called
	Deactivated() bool
}

Object represents meta info about object's particular state.

func NewObject

func NewObject(
	head reference.Global,
	state reference.Local,
	class reference.Global,
	memory []byte,
	deactivated bool,
) Object

Jump to

Keyboard shortcuts

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