Documentation ¶
Overview ¶
Package ser provides serialization support for implementing save games.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register(obj Serializable)
Register records a type, identified by a value for that type, under its internal type name.
func RegisterName ¶
func RegisterName(name string, value Serializable)
RegisterName is like Register but uses the provided name rather than the type's default.
Types ¶
type Archive ¶
type Archive interface { // Visit tells the archive to serialize or deserialize, depending on // archive type, the given pointer values. Visit(value ...interface{}) // Input returns the io.Reader for a deserializing archive and nil for a // serializing one. Input() io.Reader // Output returns the io.Writer for a serializing archive and nil for a // deserializing one. Output() io.Writer // TagPointer explicitly marks a pointer to a pointer value for the // archive. The target of the pointer will need to be serialized // separately (once), and on deserialization the pointed pointer will need // to be rewritten to whatever the new address of the thing ends up being. // This method may be deprecated in favor of just using Visit once Visit // becomes sufficiently smart to deal with pointers. TagPointer(ptr interface{}) // StoreGob uses the gob facility to store simple structured data. The // data mustn't contain pointers that are used anywhere else, since gob // will flatten everything. May be deprecated once the visit method gets // smarter. StoreGob(value interface{}) }
type Serializable ¶
Click to show internal directories.
Click to hide internal directories.