Documentation
¶
Index ¶
- Variables
- func LookupMockObjectOp(ctx context.Context, opTypeID string) (world.Operation, error)
- func LookupMockWorldOp(ctx context.Context, opTypeID string) (world.Operation, error)
- func NewMockObjectOpBlock() block.Block
- func NewMockWorldOpBlock() block.Block
- func TestWorldEngine(ctx context.Context, le *logrus.Entry, eng world.Engine) error
- func TestWorldEngine_Basic(ctx context.Context, le *logrus.Entry, eng world.Engine) error
- type MockObjectOp
- func (m *MockObjectOp) ApplyWorldObjectOp(ctx context.Context, le *logrus.Entry, objectHandle world.ObjectState, ...) (sysErr bool, err error)
- func (m *MockObjectOp) ApplyWorldOp(ctx context.Context, le *logrus.Entry, worldHandle world.WorldState, ...) (sysErr bool, err error)
- func (m *MockObjectOp) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *MockObjectOp) CloneVT() *MockObjectOp
- func (this *MockObjectOp) EqualMessageVT(thatMsg any) bool
- func (this *MockObjectOp) EqualVT(that *MockObjectOp) bool
- func (x *MockObjectOp) GetNextMsg() string
- func (m *MockObjectOp) GetOperationTypeId() string
- func (m *MockObjectOp) MarshalBlock() ([]byte, error)
- func (x *MockObjectOp) MarshalJSON() ([]byte, error)
- func (x *MockObjectOp) MarshalProtoJSON(s *json.MarshalState)
- func (x *MockObjectOp) MarshalProtoText() string
- func (m *MockObjectOp) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *MockObjectOp) MarshalToVT(dAtA []byte) (int, error)
- func (m *MockObjectOp) MarshalVT() (dAtA []byte, err error)
- func (*MockObjectOp) ProtoMessage()
- func (x *MockObjectOp) Reset()
- func (m *MockObjectOp) SizeVT() (n int)
- func (x *MockObjectOp) String() string
- func (m *MockObjectOp) UnmarshalBlock(data []byte) error
- func (x *MockObjectOp) UnmarshalJSON(b []byte) error
- func (x *MockObjectOp) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *MockObjectOp) UnmarshalVT(dAtA []byte) error
- func (m *MockObjectOp) Validate() error
- type MockWorldOp
- func (m *MockWorldOp) ApplyWorldObjectOp(ctx context.Context, le *logrus.Entry, objectHandle world.ObjectState, ...) (sysErr bool, err error)
- func (m *MockWorldOp) ApplyWorldOp(ctx context.Context, le *logrus.Entry, worldHandle world.WorldState, ...) (sysErr bool, err error)
- func (m *MockWorldOp) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *MockWorldOp) CloneVT() *MockWorldOp
- func (this *MockWorldOp) EqualMessageVT(thatMsg any) bool
- func (this *MockWorldOp) EqualVT(that *MockWorldOp) bool
- func (x *MockWorldOp) GetNextMsg() string
- func (x *MockWorldOp) GetObjectKey() string
- func (m *MockWorldOp) GetOperationTypeId() string
- func (m *MockWorldOp) MarshalBlock() ([]byte, error)
- func (x *MockWorldOp) MarshalJSON() ([]byte, error)
- func (x *MockWorldOp) MarshalProtoJSON(s *json.MarshalState)
- func (x *MockWorldOp) MarshalProtoText() string
- func (m *MockWorldOp) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *MockWorldOp) MarshalToVT(dAtA []byte) (int, error)
- func (m *MockWorldOp) MarshalVT() (dAtA []byte, err error)
- func (*MockWorldOp) ProtoMessage()
- func (x *MockWorldOp) Reset()
- func (m *MockWorldOp) SizeVT() (n int)
- func (x *MockWorldOp) String() string
- func (m *MockWorldOp) UnmarshalBlock(data []byte) error
- func (x *MockWorldOp) UnmarshalJSON(b []byte) error
- func (x *MockWorldOp) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *MockWorldOp) UnmarshalVT(dAtA []byte) error
- func (m *MockWorldOp) Validate() error
Constants ¶
This section is empty.
Variables ¶
var ErrEmptyNextMsg = errors.New("next_msg field cannot be empty")
ErrEmptyNextMsg is returned if the nextmsg field is empty.
var LookupMockOp = world.NewLookupOpFromSlice([]world.LookupOp{ LookupMockObjectOp, LookupMockWorldOp, })
LookupMockOp looks up an operation type for a op type id. returns nil, nil if not found.
var MockObjectOpId = "hydra/world/mock/mock-object-op"
MockObjectOpId is the mock object operation identifier.
var MockWorldOpId = "hydra/world/mock/mock-world-op"
MockWorldOpId is the mock object operation identifier.
Functions ¶
func LookupMockObjectOp ¶
LookupMockObjectOp performs the lookup operation for the mock object op.
func LookupMockWorldOp ¶
LookupMockWorldOp performs the lookup operation for the mock object op.
func NewMockObjectOpBlock ¶
NewMockObjectOpBlock constructs a new MockObjectOp block.
func NewMockWorldOpBlock ¶
NewMockWorldOpBlock constructs a new MockWorldOp block.
func TestWorldEngine ¶
TestWorldEngine applies all tests to the world engine.
Types ¶
type MockObjectOp ¶
type MockObjectOp struct {
// NextMsg sets the next message on the mock object.
NextMsg string `protobuf:"bytes,1,opt,name=next_msg,json=nextMsg,proto3" json:"nextMsg,omitempty"`
// contains filtered or unexported fields
}
MockObjectOp is a mock object operation.
func NewMockObjectOp ¶
func NewMockObjectOp(msg string) *MockObjectOp
NewMockObjectOp constructs a new MockObjectOp block.
func (*MockObjectOp) ApplyWorldObjectOp ¶
func (m *MockObjectOp) ApplyWorldObjectOp( ctx context.Context, le *logrus.Entry, objectHandle world.ObjectState, sender peer.ID, ) (sysErr bool, err error)
ApplyWorldObjectOp applies the operation as a object operation.
func (*MockObjectOp) ApplyWorldOp ¶
func (m *MockObjectOp) ApplyWorldOp( ctx context.Context, le *logrus.Entry, worldHandle world.WorldState, sender peer.ID, ) (sysErr bool, err error)
ApplyWorldOp applies the operation as a world operation.
func (*MockObjectOp) CloneMessageVT ¶
func (m *MockObjectOp) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*MockObjectOp) CloneVT ¶
func (m *MockObjectOp) CloneVT() *MockObjectOp
func (*MockObjectOp) EqualMessageVT ¶
func (this *MockObjectOp) EqualMessageVT(thatMsg any) bool
func (*MockObjectOp) EqualVT ¶
func (this *MockObjectOp) EqualVT(that *MockObjectOp) bool
func (*MockObjectOp) GetNextMsg ¶
func (x *MockObjectOp) GetNextMsg() string
func (*MockObjectOp) GetOperationTypeId ¶
func (m *MockObjectOp) GetOperationTypeId() string
GetOperationTypeId returns the operation type identifier.
func (*MockObjectOp) MarshalBlock ¶
func (m *MockObjectOp) MarshalBlock() ([]byte, error)
MarshalBlock marshals the block to binary. This is the initial step of marshaling, before transformations.
func (*MockObjectOp) MarshalJSON ¶
func (x *MockObjectOp) MarshalJSON() ([]byte, error)
MarshalJSON marshals the MockObjectOp to JSON.
func (*MockObjectOp) MarshalProtoJSON ¶
func (x *MockObjectOp) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the MockObjectOp message to JSON.
func (*MockObjectOp) MarshalProtoText ¶
func (x *MockObjectOp) MarshalProtoText() string
func (*MockObjectOp) MarshalToSizedBufferVT ¶
func (m *MockObjectOp) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*MockObjectOp) MarshalToVT ¶
func (m *MockObjectOp) MarshalToVT(dAtA []byte) (int, error)
func (*MockObjectOp) MarshalVT ¶
func (m *MockObjectOp) MarshalVT() (dAtA []byte, err error)
func (*MockObjectOp) ProtoMessage ¶
func (*MockObjectOp) ProtoMessage()
func (*MockObjectOp) Reset ¶
func (x *MockObjectOp) Reset()
func (*MockObjectOp) SizeVT ¶
func (m *MockObjectOp) SizeVT() (n int)
func (*MockObjectOp) String ¶
func (x *MockObjectOp) String() string
func (*MockObjectOp) UnmarshalBlock ¶
func (m *MockObjectOp) UnmarshalBlock(data []byte) error
UnmarshalBlock unmarshals the block to the object. This is the final step of decoding, after transformations.
func (*MockObjectOp) UnmarshalJSON ¶
func (x *MockObjectOp) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals the MockObjectOp from JSON.
func (*MockObjectOp) UnmarshalProtoJSON ¶
func (x *MockObjectOp) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the MockObjectOp message from JSON.
func (*MockObjectOp) UnmarshalVT ¶
func (m *MockObjectOp) UnmarshalVT(dAtA []byte) error
func (*MockObjectOp) Validate ¶
func (m *MockObjectOp) Validate() error
Validate performs cursory checks on the op.
type MockWorldOp ¶
type MockWorldOp struct {
// ObjectKey is the object key to apply to.
ObjectKey string `protobuf:"bytes,1,opt,name=object_key,json=objectKey,proto3" json:"objectKey,omitempty"`
// NextMsg sets the next message on the mock object.
NextMsg string `protobuf:"bytes,2,opt,name=next_msg,json=nextMsg,proto3" json:"nextMsg,omitempty"`
// contains filtered or unexported fields
}
MockWorldOp is a mock world operation.
func NewMockWorldOp ¶
func NewMockWorldOp(objectKey, msg string) *MockWorldOp
NewMockWorldOp constructs a new MockWorldOp block.
func (*MockWorldOp) ApplyWorldObjectOp ¶
func (m *MockWorldOp) ApplyWorldObjectOp( ctx context.Context, le *logrus.Entry, objectHandle world.ObjectState, sender peer.ID, ) (sysErr bool, err error)
ApplyWorldObjectOp applies the operation as a object operation.
func (*MockWorldOp) ApplyWorldOp ¶
func (m *MockWorldOp) ApplyWorldOp( ctx context.Context, le *logrus.Entry, worldHandle world.WorldState, sender peer.ID, ) (sysErr bool, err error)
ApplyWorldOp applies the operation as a world operation.
func (*MockWorldOp) CloneMessageVT ¶
func (m *MockWorldOp) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*MockWorldOp) CloneVT ¶
func (m *MockWorldOp) CloneVT() *MockWorldOp
func (*MockWorldOp) EqualMessageVT ¶
func (this *MockWorldOp) EqualMessageVT(thatMsg any) bool
func (*MockWorldOp) EqualVT ¶
func (this *MockWorldOp) EqualVT(that *MockWorldOp) bool
func (*MockWorldOp) GetNextMsg ¶
func (x *MockWorldOp) GetNextMsg() string
func (*MockWorldOp) GetObjectKey ¶
func (x *MockWorldOp) GetObjectKey() string
func (*MockWorldOp) GetOperationTypeId ¶
func (m *MockWorldOp) GetOperationTypeId() string
GetOperationTypeId returns the operation type identifier.
func (*MockWorldOp) MarshalBlock ¶
func (m *MockWorldOp) MarshalBlock() ([]byte, error)
MarshalBlock marshals the block to binary. This is the initial step of marshaling, before transformations.
func (*MockWorldOp) MarshalJSON ¶
func (x *MockWorldOp) MarshalJSON() ([]byte, error)
MarshalJSON marshals the MockWorldOp to JSON.
func (*MockWorldOp) MarshalProtoJSON ¶
func (x *MockWorldOp) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the MockWorldOp message to JSON.
func (*MockWorldOp) MarshalProtoText ¶
func (x *MockWorldOp) MarshalProtoText() string
func (*MockWorldOp) MarshalToSizedBufferVT ¶
func (m *MockWorldOp) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*MockWorldOp) MarshalToVT ¶
func (m *MockWorldOp) MarshalToVT(dAtA []byte) (int, error)
func (*MockWorldOp) MarshalVT ¶
func (m *MockWorldOp) MarshalVT() (dAtA []byte, err error)
func (*MockWorldOp) ProtoMessage ¶
func (*MockWorldOp) ProtoMessage()
func (*MockWorldOp) Reset ¶
func (x *MockWorldOp) Reset()
func (*MockWorldOp) SizeVT ¶
func (m *MockWorldOp) SizeVT() (n int)
func (*MockWorldOp) String ¶
func (x *MockWorldOp) String() string
func (*MockWorldOp) UnmarshalBlock ¶
func (m *MockWorldOp) UnmarshalBlock(data []byte) error
UnmarshalBlock unmarshals the block to the object. This is the final step of decoding, after transformations.
func (*MockWorldOp) UnmarshalJSON ¶
func (x *MockWorldOp) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals the MockWorldOp from JSON.
func (*MockWorldOp) UnmarshalProtoJSON ¶
func (x *MockWorldOp) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the MockWorldOp message from JSON.
func (*MockWorldOp) UnmarshalVT ¶
func (m *MockWorldOp) UnmarshalVT(dAtA []byte) error
func (*MockWorldOp) Validate ¶
func (m *MockWorldOp) Validate() error
Validate performs cursory checks on the op.