state

package
v0.0.0-...-0136f3d Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DesignStateValueHint  = hint.MustNewHint("mitum-storage-design-state-value-v0.0.1")
	StorageStateKeyPrefix = "storage"
	DesignStateKeySuffix  = "design"
)
View Source
var (
	DataStateValueHint = hint.MustNewHint("mitum-storage-data-state-value-v0.0.1")
	DataStateKeySuffix = "data"
)

Functions

func DataStateKey

func DataStateKey(addr mitumbase.Address, key string) string

func DesignStateKey

func DesignStateKey(addr mitumbase.Address) string

func GetDataFromState

func GetDataFromState(st mitumbase.State) (types.Data, error)

func GetDesignFromState

func GetDesignFromState(st mitumbase.State) (types.Design, error)

func IsDataStateKey

func IsDataStateKey(key string) bool

func IsDesignStateKey

func IsDesignStateKey(key string) bool

func StorageStateKey

func StorageStateKey(addr mitumbase.Address) string

Types

type DataStateValue

type DataStateValue struct {
	hint.BaseHinter
	Data types.Data
}

func NewDataStateValue

func NewDataStateValue(data types.Data) DataStateValue

func (*DataStateValue) DecodeBSON

func (sv *DataStateValue) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*DataStateValue) DecodeJSON

func (sv *DataStateValue) DecodeJSON(b []byte, enc encoder.Encoder) error

func (DataStateValue) HashBytes

func (sv DataStateValue) HashBytes() []byte

func (DataStateValue) Hint

func (sv DataStateValue) Hint() hint.Hint

func (DataStateValue) IsValid

func (sv DataStateValue) IsValid([]byte) error

func (DataStateValue) MarshalBSON

func (sv DataStateValue) MarshalBSON() ([]byte, error)

func (DataStateValue) MarshalJSON

func (sv DataStateValue) MarshalJSON() ([]byte, error)

type DataStateValueBSONUnmarshaler

type DataStateValueBSONUnmarshaler struct {
	Hint        string   `bson:"_hint"`
	StorageData bson.Raw `bson:"storage_data"`
}

type DataStateValueJSONUnmarshaler

type DataStateValueJSONUnmarshaler struct {
	Hint        hint.Hint       `json:"_hint"`
	StorageData json.RawMessage `json:"storage_data"`
}

type DesignStateValue

type DesignStateValue struct {
	hint.BaseHinter
	Design types.Design
}

func NewDesignStateValue

func NewDesignStateValue(design types.Design) DesignStateValue

func (*DesignStateValue) DecodeBSON

func (sv *DesignStateValue) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*DesignStateValue) DecodeJSON

func (sv *DesignStateValue) DecodeJSON(b []byte, enc encoder.Encoder) error

func (DesignStateValue) HashBytes

func (sv DesignStateValue) HashBytes() []byte

func (DesignStateValue) Hint

func (sv DesignStateValue) Hint() hint.Hint

func (DesignStateValue) IsValid

func (sv DesignStateValue) IsValid([]byte) error

func (DesignStateValue) MarshalBSON

func (sv DesignStateValue) MarshalBSON() ([]byte, error)

func (DesignStateValue) MarshalJSON

func (sv DesignStateValue) MarshalJSON() ([]byte, error)

type DesignStateValueBSONUnmarshaler

type DesignStateValueBSONUnmarshaler struct {
	Hint   string   `bson:"_hint"`
	Design bson.Raw `bson:"design"`
}

type DesignStateValueJSONMarshaler

type DesignStateValueJSONMarshaler struct {
	hint.BaseHinter
	Design types.Design `json:"design"`
}

type DesignStateValueJSONUnmarshaler

type DesignStateValueJSONUnmarshaler struct {
	Hint   hint.Hint       `json:"_hint"`
	Design json.RawMessage `json:"design"`
}

type StorageDataStateValueJSONMarshaler

type StorageDataStateValueJSONMarshaler struct {
	hint.BaseHinter
	Data types.Data `json:"storage_data"`
}

Jump to

Keyboard shortcuts

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