datamodel

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: Apache-2.0, MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewReceiptModelFromTypes

func NewReceiptModelFromTypes(successType schema.Type, errType schema.Type) (schema.Type, error)

func NewReceiptModelType

func NewReceiptModelType(resultschema []byte) (schema.Type, error)

NewReceiptModelType creates a new schema.Type for a Receipt. You must provide the schema containing a Result type, which is a keyed union. e.g.

type Result union {
  | Ok "ok"
  | Err "error"
} representation keyed

type Ok struct {
  status String (rename "Status")
}

type Err struct {
  message String (rename "Message")
}

func TypeSystem

func TypeSystem() *schema.TypeSystem

Types

type EffectsModel

type EffectsModel struct {
	Fork []ipld.Link
	Join ipld.Link
}

type MetaModel

type MetaModel struct {
	Keys   []string
	Values map[string]datamodel.Node
}

type OutcomeModel

type OutcomeModel[O any, X any] struct {
	Ran  ipld.Link
	Out  ResultModel[O, X]
	Fx   EffectsModel
	Meta MetaModel
	Iss  *string
	Prf  []ipld.Link
}

type ReceiptModel

type ReceiptModel[O any, X any] struct {
	Ocm OutcomeModel[O, X]
	Sig []byte
}

type ResultModel

type ResultModel[O any, X any] struct {
	Ok  *O
	Err *X
}

Jump to

Keyboard shortcuts

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