entry

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: AGPL-3.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

View Source
const RenderAutoHashFieldName = "auto_render_hash"

Variables

This section is empty.

Functions

This section is empty.

Types

type Activity added in v0.4.0

type Activity struct {
	ActivityID umid.UMID     `db:"activity_id" json:"activity_id"`
	UserID     umid.UMID     `db:"user_id" json:"user_id"`
	ObjectID   umid.UMID     `db:"object_id" json:"object_id"`
	Type       *ActivityType `db:"type" json:"type"`
	Data       *ActivityData `db:"data" json:"data"`
	CreatedAt  time.Time     `db:"created_at" json:"created_at"`
}

type ActivityData added in v0.4.0

type ActivityData struct {
	Position    *cmath.Vec3 `db:"position" json:"position"`
	Description *string     `db:"description" json:"description"`
	Hash        *string     `db:"hash" json:"hash"`
	TokenSymbol *string     `db:"token_symbol" json:"token_symbol"`
	TokenAmount *string     `db:"token_amount" json:"token_amount"`
	BCTxHash    *string     `db:"bc_tx_hash" json:"bc_tx_hash"`
	BCLogIndex  *string     `db:"bc_log_index" json:"bc_log_index"`
}

func (ActivityData) MarshalMUS added in v0.4.0

func (v ActivityData) MarshalMUS(buf []byte) int

MarshalMUS fills buf with the MUS encoding of v.

func (ActivityData) SizeMUS added in v0.4.0

func (v ActivityData) SizeMUS() int

SizeMUS returns the size of the MUS-encoded v.

func (*ActivityData) UnmarshalMUS added in v0.4.0

func (v *ActivityData) UnmarshalMUS(buf []byte) (int, error)

UnmarshalMUS parses the MUS-encoded buf, and sets the result to *v.

type ActivityType added in v0.4.0

type ActivityType string
const (
	ActivityTypeVideo        ActivityType = "video"
	ActivityTypeScreenshot   ActivityType = "screenshot"
	ActivityTypeWorldCreated ActivityType = "world_created"
	ActivityTypeStake        ActivityType = "stake"
	ActivityTypeUnstake      ActivityType = "unstake"
)

func (ActivityType) MarshalMUS added in v0.4.0

func (v ActivityType) MarshalMUS(buf []byte) int

MarshalMUS fills buf with the MUS encoding of v.

func (ActivityType) SizeMUS added in v0.4.0

func (v ActivityType) SizeMUS() int

SizeMUS returns the size of the MUS-encoded v.

func (*ActivityType) UnmarshalMUS added in v0.4.0

func (v *ActivityType) UnmarshalMUS(buf []byte) (int, error)

UnmarshalMUS parses the MUS-encoded buf, and sets the result to *v.

type Asset2d

type Asset2d struct {
	Asset2dID umid.UMID       `db:"asset_2d_id" json:"asset_2d_id"`
	Meta      Asset2dMeta     `db:"meta" json:"meta"`
	Options   *Asset2dOptions `db:"options" json:"options"`
	CreatedAt time.Time       `db:"created_at" json:"created_at"`
	UpdatedAt time.Time       `db:"updated_at" json:"updated_at"`
}

type Asset2dMeta

type Asset2dMeta map[string]any

type Asset2dOptions

type Asset2dOptions map[string]any

type Asset3d

type Asset3d struct {
	Asset3dID umid.UMID       `db:"asset_3d_id" json:"asset_3d_id"`
	Meta      *Asset3dMeta    `db:"meta" json:"meta"`
	Options   *Asset3dOptions `db:"options" json:"options"`
	CreatedAt time.Time       `db:"created_at" json:"created_at"`
	UpdatedAt time.Time       `db:"updated_at" json:"updated_at"`
}

type Asset3dMeta

type Asset3dMeta map[string]any

type Asset3dOptions

type Asset3dOptions map[string]any

type Attribute

type Attribute struct {
	AttributeID
	*AttributePayload
}

func NewAttribute

func NewAttribute(attributeID AttributeID, payload *AttributePayload) *Attribute

type AttributeID

type AttributeID AttributeTypeID

func NewAttributeID

func NewAttributeID(pluginID umid.UMID, name string) AttributeID

type AttributeOptions

type AttributeOptions map[string]any

func NewAttributeOptions

func NewAttributeOptions() *AttributeOptions

type AttributePayload

type AttributePayload struct {
	Value   *AttributeValue   `db:"value" json:"value"`
	Options *AttributeOptions `db:"options" json:"options"`
}

func NewAttributePayload

func NewAttributePayload(value *AttributeValue, options *AttributeOptions) *AttributePayload

type AttributeType

type AttributeType struct {
	AttributeTypeID
	Description *string           `db:"description" json:"description"`
	Options     *AttributeOptions `db:"options" json:"options"`
}

type AttributeTypeID

type AttributeTypeID struct {
	PluginID umid.UMID `db:"plugin_id" json:"plugin_id"`
	Name     string    `db:"attribute_name" json:"attribute_name"`
}

func NewAttributeTypeID added in v0.4.0

func NewAttributeTypeID(pluginID umid.UMID, name string) AttributeTypeID

type AttributeValue

type AttributeValue map[string]any

func NewAttributeValue

func NewAttributeValue() *AttributeValue

type Balance added in v0.4.0

type Balance struct {
	WalletID                 []byte    `db:"wallet_id"`
	ContractID               []byte    `db:"contract_id"`
	BlockchainID             umid.UMID `db:"blockchain_id"`
	LastProcessedBlockNumber uint64    `db:"last_processed_block_number"`
	Balance                  *BigInt   `db:"balance"` //TODO should be big.Int
}

type BigInt added in v0.4.0

type BigInt big.Int

func (*BigInt) Scan added in v0.4.0

func (b *BigInt) Scan(value interface{}) error

func (*BigInt) Value added in v0.4.0

func (b *BigInt) Value() (driver.Value, error)

type Blockchain added in v0.4.0

type Blockchain struct {
	BlockchainID             umid.UMID `db:"blockchain_id"`
	LastProcessedBlockNumber uint64    `db:"last_processed_block_number"`
	BlockchainName           string    `db:"blockchain_name"`
	RPCURL                   string    `db:"rpc_url"`
	UpdatedAt                time.Time `db:"updated_at"`
}

type Contract added in v0.4.0

type Contract struct {
	ContractID []byte `db:"contract_id"`
	Name       string `db:"name"`
}

type NFT added in v0.4.0

type NFT struct {
	WalletID     []byte    `db:"wallet_id"`
	BlockchainID umid.UMID `db:"blockchain_id"`
	ObjectID     umid.UMID `db:"object_id"`
	ContractID   []byte    `db:"contract_id"`
	CreatedAt    time.Time `db:"created_at" json:"created_at"`
	UpdatedAt    time.Time `db:"updated_at" json:"updated_at"`
}

type Node

type Node struct {
	*Object
}

type NodeAttribute

type NodeAttribute struct {
	NodeAttributeID
	*AttributePayload
	CreatedAt time.Time `db:"created_at" json:"created_at"`
	UpdatedAt time.Time `db:"updated_at" json:"updated_at"`
}

func NewNodeAttribute

func NewNodeAttribute(nodeAttributeID NodeAttributeID, payload *AttributePayload) *NodeAttribute

type NodeAttributeID

type NodeAttributeID struct {
	AttributeID
}

func NewNodeAttributeID

func NewNodeAttributeID(attributeID AttributeID) NodeAttributeID

type Object added in v0.4.0

type Object struct {
	ObjectID     umid.UMID        `db:"object_id" json:"object_id"`
	ObjectTypeID umid.UMID        `db:"object_type_id" json:"object_type_id"`
	OwnerID      umid.UMID        `db:"owner_id" json:"owner_id"`
	ParentID     umid.UMID        `db:"parent_id" json:"parent_id"`
	Asset2dID    *umid.UMID       `db:"asset_2d_id" json:"asset_2d_id"`
	Asset3dID    *umid.UMID       `db:"asset_3d_id" json:"asset_3d_id"`
	Options      *ObjectOptions   `db:"options" json:"options"`
	Transform    *cmath.Transform `db:"transform" json:"transform"`
	CreatedAt    time.Time        `db:"created_at" json:"created_at"`
	UpdatedAt    time.Time        `db:"updated_at" json:"updated_at"`
}

type ObjectActivity added in v0.4.0

type ObjectActivity struct {
	ObjectActivityID
	CreatedAt time.Time `db:"created_at" json:"created_at"`
}

func NewObjectActivity added in v0.4.0

func NewObjectActivity(objectActivityID ObjectActivityID) *ObjectActivity

type ObjectActivityID added in v0.4.0

type ObjectActivityID struct {
	ObjectID   umid.UMID `db:"object_id" json:"object_id"`
	ActivityID umid.UMID `db:"activity_id" json:"activity_id"`
}

func NewObjectActivityID added in v0.4.0

func NewObjectActivityID(objectID umid.UMID, activityID umid.UMID) ObjectActivityID

type ObjectAttribute added in v0.4.0

type ObjectAttribute struct {
	ObjectAttributeID
	*AttributePayload
	CreatedAt time.Time `db:"created_at" json:"created_at"`
	UpdatedAt time.Time `db:"updated_at" json:"updated_at"`
}

func NewObjectAttribute added in v0.4.0

func NewObjectAttribute(objectAttributeID ObjectAttributeID, payload *AttributePayload) *ObjectAttribute

type ObjectAttributeID added in v0.4.0

type ObjectAttributeID struct {
	AttributeID
	ObjectID umid.UMID `db:"object_id" json:"object_id"`
}

func NewObjectAttributeID added in v0.4.0

func NewObjectAttributeID(attributeID AttributeID, objectID umid.UMID) ObjectAttributeID

type ObjectChildPlacement added in v0.4.0

type ObjectChildPlacement struct {
	Algo    *string        `db:"algo" json:"algo,omitempty"`
	Options map[string]any `db:"options" json:"options,omitempty"`
}

type ObjectOptions added in v0.4.0

type ObjectOptions struct {
	Asset2dOptions   any                                 `db:"asset_2d_options" json:"asset_2d_options,omitempty"`
	Asset3dOptions   any                                 `db:"asset_3d_options" json:"asset_3d_options,omitempty"`
	FrameTemplates   map[string]any                      `db:"frame_templates" json:"frame_templates,omitempty"`
	SpawnPoint       *cmath.TransformNoScale             `db:"spawn_point" json:"spawn_point,omitempty"`
	ChildPlacements  map[umid.UMID]*ObjectChildPlacement `db:"child_placement" json:"child_placement,omitempty"`
	AllowedChildren  []string                            `db:"allowed_children" json:"allowed_children,omitempty"`
	ChildLimit       *uint                               `db:"child_limit" json:"child_limit,omitempty"`
	DefaultTiles     []any                               `db:"default_tiles" json:"default_tiles,omitempty"`
	InfoUIID         *umid.UMID                          `db:"infoui_id" json:"infoui_id,omitempty"`
	Minimap          *bool                               `db:"minimap" json:"minimap,omitempty"`
	Visible          *ObjectVisibleType                  `db:"visible" json:"visible,omitempty"`
	Editable         *bool                               `db:"editable" json:"editable,omitempty"`
	Private          *bool                               `db:"private" json:"private,omitempty"`
	DashboardPlugins []string                            `db:"dashboard_plugins" json:"dashboard_plugins,omitempty"`
	Subs             map[string]any                      `db:"subs" json:"subs,omitempty"`
}

type ObjectType added in v0.4.0

type ObjectType struct {
	ObjectTypeID   umid.UMID      `db:"object_type_id" json:"object_type_id"`
	Asset2dID      *umid.UMID     `db:"asset_2d_id" json:"asset_2d_id"`
	Asset3dID      *umid.UMID     `db:"asset_3d_id" json:"asset_3d_id"`
	ObjectTypeName string         `db:"object_type_name" json:"object_type_name"`
	CategoryName   string         `db:"category_name" json:"category_name"`
	Description    *string        `db:"description" json:"description"`
	Options        *ObjectOptions `db:"options" json:"options"`
	CreatedAt      time.Time      `db:"created_at" json:"created_at"`
	UpdatedAt      time.Time      `db:"updated_at" json:"updated_at"`
}

type ObjectUserAttribute added in v0.4.0

type ObjectUserAttribute struct {
	ObjectUserAttributeID
	*AttributePayload
	CreatedAt time.Time `db:"created_at" json:"created_at"`
	UpdatedAt time.Time `db:"updated_at" json:"updated_at"`
}

func NewObjectUserAttribute added in v0.4.0

func NewObjectUserAttribute(
	objectUserAttributeID ObjectUserAttributeID, payload *AttributePayload,
) *ObjectUserAttribute

type ObjectUserAttributeID added in v0.4.0

type ObjectUserAttributeID struct {
	AttributeID
	ObjectID umid.UMID `db:"object_id" json:"object_id"`
	UserID   umid.UMID `db:"user_id" json:"user_id"`
}

func NewObjectUserAttributeID added in v0.4.0

func NewObjectUserAttributeID(attributeID AttributeID, objectID, userID umid.UMID) ObjectUserAttributeID

type ObjectVisibleType added in v0.4.0

type ObjectVisibleType byte
const (
	InvisibleObjectVisibleType ObjectVisibleType = 0b00
	UI2DObjectVisibleType      ObjectVisibleType = 0b01
	UI3DObjectVisibleType      ObjectVisibleType = 0b10
	AllObjectVisibleType       ObjectVisibleType = 0b11
)

type PermissionsAttributeOption added in v0.4.0

type PermissionsAttributeOption struct {
	Read  string `json:"read" mapstructure:"read"`
	Write string `json:"write" mapstructure:"write"`
}

type PermissionsRoleType added in v0.4.0

type PermissionsRoleType string
const (
	PermissionAny        PermissionsRoleType = "any"         // Anybody can access.
	PermissionUser       PermissionsRoleType = "user"        // Only authenticated users, this includes temporary guests.
	PermissionUserOwner  PermissionsRoleType = "user_owner"  // A user who 'owns' the attribute, this depends on the type of attribute.
	PermissionAdmin      PermissionsRoleType = "admin"       // A user who has been given the admin role through the object tree (entry.UserObject).
	PermissionTargetUser PermissionsRoleType = "target_user" // The target of a UserUserAttribute
)

type Plugin

type Plugin struct {
	PluginID  umid.UMID      `db:"plugin_id" json:"plugin_id"`
	Meta      PluginMeta     `db:"meta" json:"meta"`
	Options   *PluginOptions `db:"options" json:"options"`
	CreatedAt time.Time      `db:"created_at" json:"created_at"`
	UpdatedAt time.Time      `db:"updated_at" json:"updated_at"`
}

type PluginMeta

type PluginMeta map[string]any

type PluginOptions

type PluginOptions map[string]any

type PosBusAutoAttributeOption

type PosBusAutoAttributeOption struct {
	Scope []PosBusAutoScopeAttributeOption `db:"scope" json:"scope"`
	Topic string                           `db:"topic" json:"topic"`
}

type PosBusAutoScopeAttributeOption

type PosBusAutoScopeAttributeOption string
const (
	InvalidPosBusAutoScopeAttributeOption PosBusAutoScopeAttributeOption = ""
	NodePosBusAutoScopeAttributeOption    PosBusAutoScopeAttributeOption = "node"
	WorldPosBusAutoScopeAttributeOption   PosBusAutoScopeAttributeOption = "world"
	ObjectPosBusAutoScopeAttributeOption  PosBusAutoScopeAttributeOption = "object"
	UserPosBusAutoScopeAttributeOption    PosBusAutoScopeAttributeOption = "user"
)

type RenderAutoAttributeOption added in v0.4.0

type RenderAutoAttributeOption struct {
	SlotType           SlotType        `db:"slot_type" json:"slot_type"`
	SlotName           string          `db:"slot_name" json:"slot_name"`
	ValueField         string          `db:"value_field" json:"value_field"`
	ContentType        SlotContentType `db:"content_type" json:"content_type"`
	TextRenderTemplate string          `db:"text_render_template" json:"text_render_template"`
}

type SlotContentType added in v0.4.0

type SlotContentType string
const (
	SlotContentTypeInvalid SlotContentType = ""
	SlotContentTypeString  SlotContentType = "string"
	SlotContentTypeNumber  SlotContentType = "number"
	SlotContentTypeImage   SlotContentType = "image"
	SlotContentTypeText    SlotContentType = "text"
	SlotContentTypeVideo   SlotContentType = "video"
	SlotContentTypeAudio   SlotContentType = "audio"
)

type SlotType added in v0.4.0

type SlotType string
const (
	SlotTypeInvalid SlotType = ""
	SlotTypeTexture SlotType = "texture"
	SlotTypeString  SlotType = "string"
	SlotTypeNumber  SlotType = "number"
	SlotTypeAudio   SlotType = "audio"
)

func (SlotType) MarshalMUS added in v0.4.0

func (v SlotType) MarshalMUS(buf []byte) int

MarshalMUS fills buf with the MUS encoding of v.

func (SlotType) SizeMUS added in v0.4.0

func (v SlotType) SizeMUS() int

SizeMUS returns the size of the MUS-encoded v.

func (*SlotType) UnmarshalMUS added in v0.4.0

func (v *SlotType) UnmarshalMUS(buf []byte) (int, error)

UnmarshalMUS parses the MUS-encoded buf, and sets the result to *v.

type Stake added in v0.4.0

type Stake struct {
	WalletID     []byte    `db:"wallet_id"`
	BlockchainID umid.UMID `db:"blockchain_id"`
	ObjectID     umid.UMID `db:"object_id"`
	LastComment  string    `db:"last_comment"`
	Amount       *BigInt   `db:"amount"` //TODO should be big.Int
	CreatedAt    time.Time `db:"created_at" json:"created_at"`
	UpdatedAt    time.Time `db:"updated_at" json:"updated_at"`
	Kind         uint8     `db:"kind"`
	Count        uint8     `json:"count"`
}

type User

type User struct {
	UserID     umid.UMID      `db:"user_id" json:"user_id"`
	UserTypeID umid.UMID      `db:"user_type_id" json:"user_type_id"`
	Profile    UserProfile    `db:"profile" json:"profile"`
	Options    *UserOptions   `db:"options" json:"options"`
	CreatedAt  time.Time      `db:"created_at" json:"created_at"`
	UpdatedAt  time.Time      `db:"updated_at" json:"updated_at"`
	Auth       map[string]any `db:"auth" json:"auth"`
}

type UserActivity added in v0.4.0

type UserActivity struct {
	UserActivityID
	CreatedAt time.Time `db:"created_at" json:"created_at"`
}

func NewUserActivity added in v0.4.0

func NewUserActivity(userActivityID UserActivityID) *UserActivity

type UserActivityID added in v0.4.0

type UserActivityID struct {
	UserID     umid.UMID `db:"user_id" json:"user_id"`
	ActivityID umid.UMID `db:"activity_id" json:"activity_id"`
}

func NewUserActivityID added in v0.4.0

func NewUserActivityID(userID umid.UMID, activityID umid.UMID) UserActivityID

type UserAsset3d added in v0.4.0

type UserAsset3d struct {
	Asset3dID umid.UMID    `db:"asset_3d_id" json:"asset_3d_id"`
	UserID    umid.UMID    `db:"user_id" json:"user_id"`
	Meta      *Asset3dMeta `db:"meta" json:"meta"`
	Private   bool         `db:"is_private" json:"is_private"`
	CreatedAt time.Time    `db:"created_at" json:"created_at"`
	UpdatedAt time.Time    `db:"updated_at" json:"updated_at"`
}

type UserAttribute

type UserAttribute struct {
	UserAttributeID
	*AttributePayload
}

func NewUserAttribute

func NewUserAttribute(userAttributeID UserAttributeID, payload *AttributePayload) *UserAttribute

type UserAttributeID

type UserAttributeID struct {
	AttributeID
	UserID umid.UMID `db:"user_id" json:"user_id"`
}

func NewUserAttributeID

func NewUserAttributeID(attributeID AttributeID, userID umid.UMID) UserAttributeID

type UserObject added in v0.4.0

type UserObject struct {
	UserObjectID
	Value     *UserObjectValue `db:"value" json:"value"`
	CreatedAt time.Time        `db:"created_at" json:"created_at"`
	UpdatedAt time.Time        `db:"updated_at" json:"updated_at"`
}

func NewUserObject added in v0.4.0

func NewUserObject(userObjectID UserObjectID, value *UserObjectValue) *UserObject

type UserObjectID added in v0.4.0

type UserObjectID struct {
	UserID   umid.UMID `db:"user_id" json:"user_id"`
	ObjectID umid.UMID `db:"object_id" json:"object_id"`
}

func NewUserObjectID added in v0.4.0

func NewUserObjectID(userID umid.UMID, objectID umid.UMID) UserObjectID

type UserObjectValue added in v0.4.0

type UserObjectValue map[string]any

func NewUserObjectValue added in v0.4.0

func NewUserObjectValue() *UserObjectValue

type UserOptions

type UserOptions struct {
	IsGuest *bool `db:"is_guest" json:"is_guest"`
}

type UserProfile

type UserProfile struct {
	Name        *string `db:"name" json:"name"`
	Bio         *string `db:"bio" json:"bio"`
	Location    *string `db:"location" json:"location"`
	AvatarHash  *string `db:"avatar_hash" json:"avatar_hash"`
	ProfileLink *string `db:"profile_link" json:"profile_link"`
	OnBoarded   *bool   `db:"onboarded" json:"onboarded"`
}

type UserType

type UserType struct {
	UserTypeID   umid.UMID    `db:"user_type_id" json:"user_type_id"`
	UserTypeName string       `db:"user_type_name" json:"user_type_name"`
	Description  string       `db:"description" json:"description"`
	Options      *UserOptions `db:"options" json:"options"`
}

type UserUserAttribute

type UserUserAttribute struct {
	UserUserAttributeID
	*AttributePayload
}

func NewUserUserAttribute

func NewUserUserAttribute(userUserAttributeID UserUserAttributeID, payload *AttributePayload) *UserUserAttribute

type UserUserAttributeID

type UserUserAttributeID struct {
	AttributeID
	SourceUserID umid.UMID `db:"source_user_id" json:"source_user_id"`
	TargetUserID umid.UMID `db:"target_user_id" json:"target_user_id"`
}

func NewUserUserAttributeID

func NewUserUserAttributeID(attributeID AttributeID, sourceUserID, targetUserID umid.UMID) UserUserAttributeID

type Wallet added in v0.4.0

type Wallet struct {
	WalletID     []byte    `db:"wallet_id"`
	BlockchainID umid.UMID `db:"blockchain_id"`
}

Jump to

Keyboard shortcuts

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