Documentation
¶
Index ¶
- func Connect() (*pgx.Conn, error)
- func Pool() (*pgxpool.Pool, error)
- func Reset(opts ResetOpts) error
- type DB
- func (db *DB) ContainerFor(o Object) (oo *Object, err error)
- func (db *DB) Derez(uid uint32) (err error)
- func (db *DB) Ensure() error
- func (db *DB) Erase() (err error)
- func (db *DB) GetAvatarForUid(uid uint32) (av *Object, err error)
- func (db *DB) GetObject(owneruid uint32, name string) (obj *Object, err error)
- func (db *DB) GetObjectByID(ID int) (*Object, error)
- func (db *DB) GhostBust() error
- func (db *DB) GreateAvatar(uid uint32, name string) (av *Object, err error)
- func (db *DB) ObjectByID(id int) (*Object, error)
- func (db *DB) ObjectByOwnerName(ownerid uint32, name string) (*Object, error)
- func (db *DB) Resolve(vantage Object, term string) ([]Object, error)
- func (db *DB) SearchObjectsByName(term string) ([]Object, error)
- type Object
- func (o *Object) AppendScript(code string)
- func (o *Object) Can(perm string, other Object) bool
- func (o *Object) Container(db *DB) (*Object, error)
- func (o *Object) Contents(db *DB) ([]*Object, error)
- func (o *Object) Create(db *DB) error
- func (o *Object) Earshot(db *DB) ([]*Object, error)
- func (o *Object) GetDataString(key string) string
- func (o *Object) GetScript() string
- func (o *Object) HasSameOwner(other Object) bool
- func (o *Object) MoveInto(db *DB, container Object) error
- func (o *Object) Refresh(db *DB) error
- func (o *Object) SetData(key string, value string)
- func (o *Object) SetScript(code string) error
- func (o *Object) String() string
- func (o *Object) Update(db *DB) error
- type Perm
- type Permissions
- type ResetOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (*DB) Ensure ¶
Ensure checks for and then creates default resources if they do not exist (like the Foyer)
func (*DB) GreateAvatar ¶
func (*DB) ObjectByOwnerName ¶
type Object ¶
type Object struct { // TODO eventually I want uint64 for ids ID int Avatar bool Bedroom bool OwnerID int Perms *Permissions Data map[string]interface{} // contains filtered or unexported fields }
func NewBedroom ¶
func NewObject ¶
types. i had parallel thoughts: all map data is strings and objects can have numbers, too. those are incompatible. i don't remember what i did in tildemush for this.
the ideal user experience is that types "just work." so something like this:
--[[WITCH data:
foo: 1 bar: "hi"
--[[HCTIW
hears(".*", function()
set("foo", get("foo") + 1) say(my("bar"))
end)
i've hacked things such that this could work if i dynamically figure out types stored in data at run time.
the more i play with editing scripts the less happy i ham with the comment approach and, indeed, the approach of having the data right there in the code.
i might feel better about it if it looked like tildemush again -- (has) etc. s expression parsing just makes me feel less nervous even if conceptually it's just as brittle.
but something to consider is that i'm locking people into editing in the application -- so why not have object editing have UI elements for data and permissions?
i'm using the browser as inspiration and remembering how in the dev console you get code and also a javascript object explorer.
i'm going to ruminate on that.