state

package
v0.0.0-...-dbcf2a3 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DesignStateValueHint    = hint.MustNewHint("mitum-timestamp-design-state-value-v0.0.1")
	TimeStampStateKeyPrefix = "timestamp"
	DesignStateKeySuffix    = "design"
)
View Source
var (
	LastIdxStateValueHint = hint.MustNewHint("mitum-timestamp-last-idx-state-value-v0.0.1")
	LastIdxStateKeySuffix = "timestampIdx"
)
View Source
var (
	ItemStateValueHint = hint.MustNewHint("mitum-timestamp-item-state-value-v0.0.1")
	ItemStateKeySuffix = "item"
)

Functions

func DesignStateKey

func DesignStateKey(addr mitumbase.Address) string

func GetDesignFromState

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

func GetItemFromState

func GetItemFromState(st mitumbase.State) (types.Item, error)

func GetLastIdxFromState

func GetLastIdxFromState(st mitumbase.State) (uint64, error)

func IsDesignStateKey

func IsDesignStateKey(key string) bool

func IsItemStateKey

func IsItemStateKey(key string) bool

func IsLastIdxStateKey

func IsLastIdxStateKey(key string) bool

func ItemStateKey

func ItemStateKey(addr mitumbase.Address, pid string, index uint64) string

func LastIdxStateKey

func LastIdxStateKey(addr mitumbase.Address, pid string) string

func TimeStampStateKey

func TimeStampStateKey(addr mitumbase.Address) string

Types

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 ItemStateValue

type ItemStateValue struct {
	hint.BaseHinter
	Item types.Item
}

func NewItemStateValue

func NewItemStateValue(item types.Item) ItemStateValue

func (*ItemStateValue) DecodeBSON

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

func (*ItemStateValue) DecodeJSON

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

func (ItemStateValue) HashBytes

func (sv ItemStateValue) HashBytes() []byte

func (ItemStateValue) Hint

func (sv ItemStateValue) Hint() hint.Hint

func (ItemStateValue) IsValid

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

func (ItemStateValue) MarshalBSON

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

func (ItemStateValue) MarshalJSON

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

type ItemStateValueBSONUnmarshaler

type ItemStateValueBSONUnmarshaler struct {
	Hint          string   `bson:"_hint"`
	TimeStampItem bson.Raw `bson:"timestamp_item"`
}

type ItemStateValueJSONUnmarshaler

type ItemStateValueJSONUnmarshaler struct {
	Hint          hint.Hint       `json:"_hint"`
	TimeStampItem json.RawMessage `json:"timestamp_item"`
}

type LastIdxStateValue

type LastIdxStateValue struct {
	hint.BaseHinter
	ProjectID string
	Index     uint64
}

func NewLastIdxStateValue

func NewLastIdxStateValue(pid string, idx uint64) LastIdxStateValue

func (*LastIdxStateValue) DecodeBSON

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

func (*LastIdxStateValue) DecodeJSON

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

func (LastIdxStateValue) HashBytes

func (sv LastIdxStateValue) HashBytes() []byte

func (LastIdxStateValue) Hint

func (sv LastIdxStateValue) Hint() hint.Hint

func (LastIdxStateValue) IsValid

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

func (LastIdxStateValue) MarshalBSON

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

func (LastIdxStateValue) MarshalJSON

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

type LastIdxStateValueBSONUnmarshaler

type LastIdxStateValueBSONUnmarshaler struct {
	Hint      string `bson:"_hint"`
	ProjectID string `bson:"project_id"`
	Index     uint64 `bson:"last_idx"`
}

type LastIdxStateValueJSONMarshaler

type LastIdxStateValueJSONMarshaler struct {
	hint.BaseHinter
	ProjectID string `json:"project_id"`
	Index     uint64 `json:"last_idx"`
}

type LastIdxStateValueJSONUnmarshaler

type LastIdxStateValueJSONUnmarshaler struct {
	Hint      hint.Hint `json:"_hint"`
	ProjectID string    `json:"project_id"`
	Index     uint64    `json:"last_idx"`
}

type TimeStampItemStateValueJSONMarshaler

type TimeStampItemStateValueJSONMarshaler struct {
	hint.BaseHinter
	Item types.Item `json:"timestamp_item"`
}

Jump to

Keyboard shortcuts

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