goworld: github.com/xiaonanln/goworld/engine/storage Index | Files | Directories

package storage

import "github.com/xiaonanln/goworld/engine/storage"

Index

Package Files

storage.go

func Exists Uses

func Exists(typeName string, entityID common.EntityID, callback ExistsCallbackFunc)

Exists checks if entity of specified ID exists in storage

func Initialize Uses

func Initialize()

Initialize is called by engine to initialize storage module

func ListEntityIDs Uses

func ListEntityIDs(typeName string, callback ListCallbackFunc)

ListEntityIDs returns all entity IDs in storage

Return values can be large for common entity types

func Load Uses

func Load(typeName string, entityID common.EntityID, callback LoadCallbackFunc)

Load loads entity data from storage

func Save Uses

func Save(typeName string, entityID common.EntityID, data interface{}, callback SaveCallbackFunc)

Save saves entity data to storage

func Shutdown Uses

func Shutdown()

Shutdown storage module

type ExistsCallbackFunc Uses

type ExistsCallbackFunc func(exists bool, err error)

ExistsCallbackFunc is the callback type of storage Exists

type ListCallbackFunc Uses

type ListCallbackFunc func([]common.EntityID, error)

ListCallbackFunc is the callback type of storage List

type LoadCallbackFunc Uses

type LoadCallbackFunc func(data interface{}, err error)

LoadCallbackFunc is the callback type of storage Load

type SaveCallbackFunc Uses

type SaveCallbackFunc func()

SaveCallbackFunc is the callback type of storage Save

Directories

PathSynopsis
backend/filesystem
backend/mongodb
backend/mysql
backend/redis
storage_common

Package storage imports 15 packages (graph) and is imported by 3 packages. Updated 2017-11-06. Refresh now. Tools for package owners.