node

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2023 License: AGPL-3.0 Imports: 48 Imported by: 0

Documentation

Index

Constants

View Source
const StatusDone = "done"
View Source
const StatusFailed = "failed"
View Source
const StatusInProgress = "in progress"

Variables

This section is empty.

Functions

This section is empty.

Types

type NFTMeta

type NFTMeta struct {
	Name  string `json:"name" binding:"required"`
	Image string `json:"image" binding:"required"`
}

type Node

type Node struct {
	*space.Space
	// contains filtered or unexported fields
}

func NewNode

func NewNode(
	id uuid.UUID,
	db database.DB,
	worlds universe.Worlds,
	assets2D universe.Assets2d,
	assets3D universe.Assets3d,
	plugins universe.Plugins,
	spaceTypes universe.SpaceTypes,
	userTypes universe.UserTypes,
	attributeTypes universe.AttributeTypes,
) *Node

func (*Node) AddAPIRegister

func (n *Node) AddAPIRegister(register universe.APIRegister)

func (*Node) AddSpaceToAllSpaces

func (n *Node) AddSpaceToAllSpaces(space universe.Space) error

func (*Node) CreateSpace

func (n *Node) CreateSpace(spaceID uuid.UUID) (universe.Space, error)

func (*Node) FilterAllSpaces

func (n *Node) FilterAllSpaces(predicateFn universe.SpacesFilterPredicateFn) map[uuid.UUID]universe.Space

func (*Node) GetAllSpaces

func (n *Node) GetAllSpaces() map[uuid.UUID]universe.Space

func (*Node) GetAssets2d

func (n *Node) GetAssets2d() universe.Assets2d

func (*Node) GetAssets3d

func (n *Node) GetAssets3d() universe.Assets3d

func (*Node) GetAttributeTypes

func (n *Node) GetAttributeTypes() universe.AttributeTypes

func (*Node) GetNodeAttributes

func (n *Node) GetNodeAttributes() universe.NodeAttributes

func (*Node) GetPlugins

func (n *Node) GetPlugins() universe.Plugins

func (*Node) GetSpaceFromAllSpaces

func (n *Node) GetSpaceFromAllSpaces(spaceID uuid.UUID) (universe.Space, bool)

func (*Node) GetSpaceTypes

func (n *Node) GetSpaceTypes() universe.SpaceTypes

func (*Node) GetSpaceUserAttributes

func (n *Node) GetSpaceUserAttributes() universe.SpaceUserAttributes

func (*Node) GetUserAttributes

func (n *Node) GetUserAttributes() universe.UserAttributes

func (*Node) GetUserSpaceValue

func (n *Node) GetUserSpaceValue(userSpaceID entry.UserSpaceID) (*entry.UserSpaceValue, bool)

func (*Node) GetUserTypes

func (n *Node) GetUserTypes() universe.UserTypes

func (*Node) GetUserUserAttributes

func (n *Node) GetUserUserAttributes() universe.UserUserAttributes

func (*Node) GetWorlds

func (n *Node) GetWorlds() universe.Worlds

func (*Node) Initialize

func (n *Node) Initialize(ctx context.Context) error

func (*Node) Load

func (n *Node) Load() error

TODO: investigate how to load with limited database connection pool

func (*Node) LoadUser

func (n *Node) LoadUser(userID uuid.UUID) (universe.User, error)

func (*Node) RegisterAPI

func (n *Node) RegisterAPI(r *gin.Engine)

func (*Node) RemoveSpaceFromAllSpaces

func (n *Node) RemoveSpaceFromAllSpaces(space universe.Space) (bool, error)

func (*Node) Run

func (n *Node) Run() error

func (*Node) Save

func (n *Node) Save() error

func (*Node) SetParent

func (n *Node) SetParent(parent universe.Space, updateDB bool) error

func (*Node) Stop

func (n *Node) Stop() error

func (*Node) ToSpace

func (n *Node) ToSpace() universe.Space

func (*Node) UpdateUserSpaceValue

func (n *Node) UpdateUserSpaceValue(
	userSpaceID entry.UserSpaceID, modifyFn modify.Fn[entry.UserSpaceValue],
) (*entry.UserSpaceValue, error)

func (*Node) WriteInfluxPoint

func (n *Node) WriteInfluxPoint(point *influxWrite.Point) error

type NodeJSOut

type NodeJSOut struct {
	Data  any      `json:"data"`
	Logs  []string `json:"logs"`
	Error *string  `json:"error"`
}

type NodeJSOutData

type NodeJSOutData struct {
	UserID uuid.UUID `json:"userID"`
	Name   string    `json:"name"`
	Image  string    `json:"image"`
}

type StoreItem

type StoreItem struct {
	Status    string
	NodeJSOut *NodeJSOut
	Error     error
}

type WalletMeta

type WalletMeta struct {
	Wallet   string
	UserID   uuid.UUID
	Username string
	Avatar   string
}

Jump to

Keyboard shortcuts

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