Documentation
¶
Overview ¶
Package datapack allows users to extend Gophercraft with ease. It describes a simple format for loading data into Gophercraft and compatible clients Planned formats include:
3d objects/textures Map geometry Sound files files for patching the server and client databases
Index ¶
- Variables
- func RegisterDriver(key string, value func() Driver)
- func Timestamp() string
- type Driver
- type File
- type List
- type Loader
- type Opts
- type Pack
- func (p *Pack) Delete() error
- func (p *Pack) Exists(path string) bool
- func (p *Pack) FolderExists(path string) bool
- func (p *Pack) FolderList(path string) []string
- func (p *Pack) ReadBytes(path string) ([]byte, error)
- func (p *Pack) WriteBytes(path string, data []byte) error
- func (p *Pack) ZipToFile(filename string) error
- type PackConfig
- type TextLoader
- type WriteFile
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrFileNotFound = fmt.Errorf("datapack: file not found")
)
Functions ¶
func RegisterDriver ¶
Types ¶
type Driver ¶
type Driver interface { Init(at string) (Opts, error) ReadFile(at string) (File, error) WriteFile(at string) (WriteFile, error) List() []string Close() error }
Driver describes a mechanism for loading a datapack.
type File ¶
type File io.ReadCloser
type Loader ¶
type Loader struct {
Volumes []*Pack
}
func (*Loader) NewTextLoader ¶
func (ld *Loader) NewTextLoader(prefix, name string) (*TextLoader, error)
NewTextLoader returns a TextLoader of all text files in all datapacks matching the supplied parameters
type Pack ¶
type Pack struct { PackConfig Opts Driver }
func Author ¶
func Author(cfg PackConfig) (*Pack, error)
func (*Pack) FolderExists ¶
func (*Pack) FolderList ¶
type PackConfig ¶
type TextLoader ¶
func (*TextLoader) Scan ¶
func (tl *TextLoader) Scan(out interface{}) error
type WriteFile ¶
type WriteFile io.WriteCloser
Click to show internal directories.
Click to hide internal directories.