schema

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2025 License: MPL-2.0 Imports: 5 Imported by: 3

Documentation

Index

Constants

View Source
const NodeVersion = "v0.1.3"

Variables

View Source
var (
	GenesisAccId = "0x18b4bA4c118279b3eB60a2DB1E794Bc41AFC1D37"
	// GenesisAccId = "0x972AeD684D6f817e1b58AF70933dF1b4a75bfA51"
	GenesisNode = schema.Node{
		AccId: GenesisAccId,
		Name:  "TestGenesisNode",
		Role:  schema.RoleMain,
		Desc:  "Test network genesis node",
		URL:   "https://hymatrix.ai",
	}

	NonExtractableTags = map[string]string{
		"Data-Protocol": "Data-Protocol",
		"Variant":       "Variant",
		"From-Process":  "From-Process",
		"From-Module":   "From-Module",
		"Type":          "Type",
		"From":          "From",
		"Owner":         "Owner",
		"Anchor":        "Anchor",
		"Target":        "Target",
		"Data":          "Data",
		"Tags":          "Tags",
		"Read-Only":     "Read-Only",
	}
)
View Source
var (
	ErrInvalidType               = errors.New("err_invalid_type")
	ErrProcessIsRecovering       = errors.New("err_process_is_recovering")
	ErrProcessAlreadyExists      = errors.New("err_process_already_exist")
	ErrProcessNotFound           = errors.New("err_process_not_found")
	ErrRedirect                  = errors.New("err_redirect")
	ErrDuplicateItem             = errors.New("err_duplicate_item")
	ErrNotFoundNodes             = errors.New("err_not_found_nodes")
	ErrNotFoundCkp               = errors.New("err_not_found_ckp")
	ErrNotFoundMod               = errors.New("err_not_found_mod")
	ErrUnrecognizedSignatureType = errors.New("err_unrecognized_signature_type")
	ErrUnauthorizedNode          = errors.New("err_unauthorized_node")
)

Functions

This section is empty.

Types

type AssignMessage

type AssignMessage struct {
	Pid     string
	AccId   string
	Message schema.Message
	Item    goarSchema.BundleItem
}

type AssignProcess

type AssignProcess struct {
	Pid     string
	AccId   string
	Process schema.Process
	Item    goarSchema.BundleItem
}

type AssignmentHandler added in v0.1.1

type AssignmentHandler func(AssignmentResult)

type AssignmentResult added in v0.1.1

type AssignmentResult struct {
	Pid        string
	Item       goarSchema.BundleItem
	Assign     hymxSchema.Assignment
	AssignItem goarSchema.BundleItem
	Error      error
}

type IDB

type IDB interface {
	// result
	SaveResult(result schema.Result) error
	GetResult(msgid string) (result *schema.Result, err error)
	GetResults(pid string, limit int64) (results []schema.Result, err error)

	// assignment
	IsExist(pid string) (ok bool, err error)
	GetNonce(pid string) (nonce int64, err error)
	Commit(pid string, nonce int64, msg, assign goarSchema.BundleItem) (err error)

	// get
	GetAllProcess() (pids []string, curNonces []int64, err error)
	GetMessage(msgid string) (msg *goarSchema.BundleItem, err error)
	GetMessageByNonce(pid string, nonce int64) (msg *goarSchema.BundleItem, err error)
	GetAssignByNonce(pid string, nonce int64) (assign *goarSchema.BundleItem, err error)

	// checkpoint
	GetCheckpointIndex(pid string) (id string, err error)
	SaveCheckpointIndex(pid, id string) (err error)

	// cache
	GetCache(pid, key string) (value string, err error)
	SaveCache(pid, key, value string) (err error)
}

type IDBOutbox

type IDBOutbox interface {
	Push(pid, target string, message goarSchema.BundleItem) error
	Peek(pid, target string) (int, *goarSchema.BundleItem, error)
	Commit(pid, target string, assign goarSchema.BundleItem) error

	Checkpoint(pid string) (string, error)
	Restore(data string) error
}

type Info

type Info struct {
	Protocol    string              `json:"Protocol"`
	Variant     string              `json:"Variant"`
	NodeVersion string              `json:"Node-Version"`
	JoinNetwork bool                `json:"Join-Network"`
	Token       string              `json:"Token"`
	Registry    string              `json:"Registry"`
	Node        registrySchema.Node `json:"Node"`
	VmCount     int64               `json:"Vm-Count"`
}

type RedirectError added in v0.1.3

type RedirectError struct {
	Nodes []registrySchema.Node `json:"nodes"`
}

RedirectError contains nodes information for 308 redirect

func NewRedirectError added in v0.1.3

func NewRedirectError(nodes []registrySchema.Node) *RedirectError

NewRedirectError creates a new redirect error with nodes information

func (*RedirectError) Error added in v0.1.3

func (e *RedirectError) Error() string

type ResultHandler

type ResultHandler func(vmmSchema.Result)

Jump to

Keyboard shortcuts

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