event

package
v0.0.0-...-4701ab3 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2019 License: LGPL-3.0 Imports: 4 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarshalID

func MarshalID(coord *common.Coordinate, index uint16) uint64

MarshalID returns the packed id

func UnmarshalID

func UnmarshalID(id uint64) (*common.Coordinate, uint16)

UnmarshalID returns the block height, the transaction index in the block, the output index in the transaction

Types

type Base

type Base struct {
	Coord_ *common.Coordinate
	Index_ uint16
	Type_  Type
}

Base is the parts of event functions that are not changed by derived one

func (*Base) Coord

func (e *Base) Coord() *common.Coordinate

Coord returns the coord of the event

func (*Base) Index

func (e *Base) Index() uint16

Index returns the index of the event

func (*Base) ReadFrom

func (e *Base) ReadFrom(r io.Reader) (int64, error)

ReadFrom is a deserialization function

func (*Base) SetIndex

func (e *Base) SetIndex(index uint16)

SetIndex changes the index of the event

func (*Base) Type

func (e *Base) Type() Type

Type returns the type of the event

func (*Base) WriteTo

func (e *Base) WriteTo(w io.Writer) (int64, error)

WriteTo is a serialization function

type Event

type Event interface {
	io.WriterTo
	io.ReaderFrom
	json.Marshaler
	Coord() *common.Coordinate
	Index() uint16
	Type() Type
	SetIndex(index uint16)
}

Event is a interface that defines common event functions

type Type

type Type uint8

Type is event type

Jump to

Keyboard shortcuts

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