models

package
v1.0.10-0...-7349ede Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JetDrop

type JetDrop struct {
	PulseNumber    int64  `gorm:"primary_key;auto_increment:false"`
	JetID          string `gorm:"primary_key;auto_increment:false;default:''"`
	FirstPrevHash  []byte
	SecondPrevHash []byte
	Hash           []byte
	RawData        []byte
	Timestamp      int64
	RecordAmount   int
}

func (*JetDrop) Siblings

func (j *JetDrop) Siblings() []string

type JetDropID

type JetDropID struct {
	JetID       string
	PulseNumber int64
}

func NewJetDropID

func NewJetDropID(jetID string, pulseNumber int64) *JetDropID

func NewJetDropIDFromString

func NewJetDropIDFromString(jetDropID string) (*JetDropID, error)

NewJetDropIDFromString create JetDropID from provided string representation. Jet with empty prefix returned with empty jetID.

func (*JetDropID) JetIDToString

func (j *JetDropID) JetIDToString() string

func (*JetDropID) ToString

func (j *JetDropID) ToString() string

type Pulse

type Pulse struct {
	PulseNumber     int64 `gorm:"primary_key;auto_increment:false"`
	PrevPulseNumber int64
	NextPulseNumber int64
	IsComplete      bool
	IsSequential    bool
	Timestamp       int64
	JetDropAmount   int64
	RecordAmount    int64
}

type Record

type Record struct {
	Reference           Reference `gorm:"primary_key;auto_increment:false"`
	Type                RecordType
	ObjectReference     Reference
	PrototypeReference  Reference
	Payload             []byte
	PrevRecordReference Reference
	Hash                []byte
	RawData             []byte
	JetID               string
	PulseNumber         int64
	Order               int
	Timestamp           int64
}

type RecordType

type RecordType string
const (
	State   RecordType = "state"
	Request RecordType = "request"
	Result  RecordType = "result"
)

func RecordTypeFromTypes

func RecordTypeFromTypes(rt types.RecordType) RecordType

type Reference

type Reference []byte

func ReferenceFromTypes

func ReferenceFromTypes(r types.Reference) Reference

Jump to

Keyboard shortcuts

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