space

package
v0.50.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const SpaceBodyType = "space"

SpaceBodyType is the space shared object body type id.

Variables

View Source
var (
	// ErrEmptySpaceID is returned if the space id was empty.
	ErrEmptySpaceID = errors.New("space id cannot be empty")
	// ErrSpaceExists is returned if the space already exists.
	ErrSpaceExists = errors.New("space with that id already exists")
)

Functions

func FixupSpaceName

func FixupSpaceName(name string) string

FixupSpaceName fixes up a space name by trimming spaces and collapsing consecutive spaces into single spaces.

func NewSharedObjectMeta

func NewSharedObjectMeta(spaceName string) (*sobject.SharedObjectMeta, error)

NewSharedObjectMeta constructs a new SharedObjectMeta for a space.

func SpaceEngineId

func SpaceEngineId(ref *sobject.SharedObjectRef) string

SpaceEngineId returns the space world engine id.

func ValidateSpaceName

func ValidateSpaceName(name string) error

ValidateSpaceName validates a space name.

- Must be 1-64 characters - Must start with a letter - Can only contain letters, numbers, dash, underscore, and spaces - Must not end with dash, underscore, or space - No consecutive dashes, underscores, or spaces - No special characters - Spaces allowed only in the middle

Types

type MountSharedObjectBodyValue

type MountSharedObjectBodyValue = sobject.MountSharedObjectBodyValue[SpaceSharedObjectBody]

MountSharedObjectBodyValue is the value of the MountSharedObjectBody directive for a space.

func ExMountSpaceSoBody

func ExMountSpaceSoBody(
	ctx context.Context,
	b bus.Bus,
	ref *sobject.SharedObjectRef,
	returnIfIdle bool,
	valDisposeCb func(),
) (MountSharedObjectBodyValue, directive.Reference, error)

ExMountSpaceSoBody executes a mount directive for a space shared object body. Returns the mounted space engine, a directive reference, and any error.

type SpaceSharedObjectBody

type SpaceSharedObjectBody interface {
	// GetWorldEngine returns the world engine for this space.
	GetWorldEngine() world.Engine
	// GetWorldEngineID returns the world engine identifier for this space.
	GetWorldEngineID() string
	// GetWorldEngineBucketID returns the bucket ID for the world engine.
	GetWorldEngineBucketID() string
	// GetSharedObjectRef returns the shared object reference for this space.
	GetSharedObjectRef() *sobject.SharedObjectRef
	// GetSharedObject returns the shared object handle.
	GetSharedObject() sobject.SharedObject
}

SpaceSharedObjectBody is the interface for the space shared object body. It provides access to the world engine and metadata about the space.

type SpaceSoListEntry

type SpaceSoListEntry struct {

	// Entry is the shared object list entry.
	Entry *sobject.SharedObjectListEntry `protobuf:"bytes,1,opt,name=entry,proto3" json:"entry,omitempty"`
	// SpaceMeta is the space shared object meta.
	SpaceMeta *SpaceSoMeta `protobuf:"bytes,2,opt,name=space_meta,json=spaceMeta,proto3" json:"spaceMeta,omitempty"`
	// contains filtered or unexported fields
}

SpaceSoListEntry is a SharedObjectListEntry with parsed metadata.

func FilterSharedObjectList

func FilterSharedObjectList(
	list []*sobject.SharedObjectListEntry,
	invalidMeta func(ent *sobject.SharedObjectListEntry, err error) error,
) ([]*SpaceSoListEntry, error)

FilterSharedObjectList filters a SharedObjectList to a list of SpaceSoListEntry. invalidMeta is optional and is called if an invalid metadata is found. if invalidMeta is nil we will return the error directly when encountering an invalid metadata.

func (*SpaceSoListEntry) CloneMessageVT

func (m *SpaceSoListEntry) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*SpaceSoListEntry) CloneVT

func (m *SpaceSoListEntry) CloneVT() *SpaceSoListEntry

func (*SpaceSoListEntry) EqualMessageVT

func (this *SpaceSoListEntry) EqualMessageVT(thatMsg any) bool

func (*SpaceSoListEntry) EqualVT

func (this *SpaceSoListEntry) EqualVT(that *SpaceSoListEntry) bool

func (*SpaceSoListEntry) GetEntry

func (*SpaceSoListEntry) GetSpaceMeta

func (x *SpaceSoListEntry) GetSpaceMeta() *SpaceSoMeta

func (*SpaceSoListEntry) MarshalJSON

func (x *SpaceSoListEntry) MarshalJSON() ([]byte, error)

MarshalJSON marshals the SpaceSoListEntry to JSON.

func (*SpaceSoListEntry) MarshalProtoJSON

func (x *SpaceSoListEntry) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the SpaceSoListEntry message to JSON.

func (*SpaceSoListEntry) MarshalProtoText

func (x *SpaceSoListEntry) MarshalProtoText() string

func (*SpaceSoListEntry) MarshalToSizedBufferVT

func (m *SpaceSoListEntry) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SpaceSoListEntry) MarshalToVT

func (m *SpaceSoListEntry) MarshalToVT(dAtA []byte) (int, error)

func (*SpaceSoListEntry) MarshalVT

func (m *SpaceSoListEntry) MarshalVT() (dAtA []byte, err error)

func (*SpaceSoListEntry) ProtoMessage

func (*SpaceSoListEntry) ProtoMessage()

func (*SpaceSoListEntry) Reset

func (x *SpaceSoListEntry) Reset()

func (*SpaceSoListEntry) SizeVT

func (m *SpaceSoListEntry) SizeVT() (n int)

func (*SpaceSoListEntry) String

func (x *SpaceSoListEntry) String() string

func (*SpaceSoListEntry) UnmarshalJSON

func (x *SpaceSoListEntry) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SpaceSoListEntry from JSON.

func (*SpaceSoListEntry) UnmarshalProtoJSON

func (x *SpaceSoListEntry) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the SpaceSoListEntry message from JSON.

func (*SpaceSoListEntry) UnmarshalVT

func (m *SpaceSoListEntry) UnmarshalVT(dAtA []byte) error

type SpaceSoMeta

type SpaceSoMeta struct {

	// Name is the user-defined space name.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

SpaceSoMeta is metadata about a space stored in SharedObjectMeta.

func NewSpaceSoMeta

func NewSpaceSoMeta(name string) *SpaceSoMeta

NewSpaceSoMeta constructs a new SpaceSoMeta.

func (*SpaceSoMeta) CloneMessageVT

func (m *SpaceSoMeta) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*SpaceSoMeta) CloneVT

func (m *SpaceSoMeta) CloneVT() *SpaceSoMeta

func (*SpaceSoMeta) EqualMessageVT

func (this *SpaceSoMeta) EqualMessageVT(thatMsg any) bool

func (*SpaceSoMeta) EqualVT

func (this *SpaceSoMeta) EqualVT(that *SpaceSoMeta) bool

func (*SpaceSoMeta) GetName

func (x *SpaceSoMeta) GetName() string

func (*SpaceSoMeta) MarshalJSON

func (x *SpaceSoMeta) MarshalJSON() ([]byte, error)

MarshalJSON marshals the SpaceSoMeta to JSON.

func (*SpaceSoMeta) MarshalProtoJSON

func (x *SpaceSoMeta) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the SpaceSoMeta message to JSON.

func (*SpaceSoMeta) MarshalProtoText

func (x *SpaceSoMeta) MarshalProtoText() string

func (*SpaceSoMeta) MarshalToSizedBufferVT

func (m *SpaceSoMeta) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SpaceSoMeta) MarshalToVT

func (m *SpaceSoMeta) MarshalToVT(dAtA []byte) (int, error)

func (*SpaceSoMeta) MarshalVT

func (m *SpaceSoMeta) MarshalVT() (dAtA []byte, err error)

func (*SpaceSoMeta) ProtoMessage

func (*SpaceSoMeta) ProtoMessage()

func (*SpaceSoMeta) Reset

func (x *SpaceSoMeta) Reset()

func (*SpaceSoMeta) SizeVT

func (m *SpaceSoMeta) SizeVT() (n int)

func (*SpaceSoMeta) String

func (x *SpaceSoMeta) String() string

func (*SpaceSoMeta) UnmarshalJSON

func (x *SpaceSoMeta) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SpaceSoMeta from JSON.

func (*SpaceSoMeta) UnmarshalProtoJSON

func (x *SpaceSoMeta) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the SpaceSoMeta message from JSON.

func (*SpaceSoMeta) UnmarshalVT

func (m *SpaceSoMeta) UnmarshalVT(dAtA []byte) error

func (*SpaceSoMeta) Validate

func (m *SpaceSoMeta) Validate() error

Validate validates the SpaceSoMeta.

Directories

Path Synopsis
http
download
Package download serves projected space file content via HTTP.
Package download serves projected space file content via HTTP.
export
Package export serves projected space data via HTTP zip routes.
Package export serves projected space data via HTTP zip routes.
header
Package header provides shared HTTP header helpers for space HTTP handlers.
Package header provides shared HTTP header helpers for space HTTP handlers.
Package resolve provides utilities for resolving resource paths to world engines.
Package resolve provides utilities for resolving resource paths to world engines.
ops

Jump to

Keyboard shortcuts

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