resource

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2020 License: BSD-3-Clause Imports: 5 Imported by: 19 modules, 27 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const UriScheme = "res://"

Variables

This section is empty.

Functions

func GetTypeFromID

func GetTypeFromID(id string) (string, error)

func RegisterLoader

func RegisterLoader(resourceType string, loader Loader) error

RegisterManager registers a resource manager for the specified type

Types

type Config

type Config struct {
	ID   string          `json:"id"`
	Data json.RawMessage `json:"data"`
}

type Loader

type Loader interface {
	LoadResource(config *Config) (*Resource, error)
}

func GetLoader

func GetLoader(resourceType string) Loader

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func NewManager

func NewManager(resources map[string]*Resource) *Manager

func (*Manager) CleanupResources

func (m *Manager) CleanupResources()

func (*Manager) GetResource

func (m *Manager) GetResource(id string) *Resource

type Resource

type Resource struct {
	// contains filtered or unexported fields
}

func New

func New(resType string, resObj interface{}) *Resource

func (*Resource) Object

func (r *Resource) Object() interface{}

func (*Resource) Type

func (r *Resource) Type() string

type ResourcesConfig

type ResourcesConfig struct {
	Resources []*Config `json:"resources"`
}

Jump to

Keyboard shortcuts

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