Skip to content

package asset_importer

import "kaiju/assets/asset_importer"

Variables

ErrNoImporter

errors.New("no importer found for file")

Types

HTMLImporter

struct

type HTMLImporter struct{}

HTMLImporter.Handles

func (m HTMLImporter) Handles(path string) bool

HTMLImporter.Import

func (m HTMLImporter) Import(path string) error

ImportRegistry

struct

type ImportRegistry struct {
    // Has unexported fields.
}

NewImportRegistry

func NewImportRegistry() ImportRegistry

ImportRegistry.Import

func (r *ImportRegistry) Import(path string) error

ImportRegistry.ImportIfNew

func (r *ImportRegistry) ImportIfNew(path string) error

ImportRegistry.ImportUsingDefault

func (r *ImportRegistry) ImportUsingDefault(path string) error

ImportRegistry.Register

func (r *ImportRegistry) Register(importer Importer)

ImportType

string

type ImportType = string

Importer

interface

type Importer interface {
    Handles(path string) bool
    Import(path string) error
}

Importer is an interface for importing assets into the asset database. It is used to allow for custom importers to be added to the system to handle new asset types. Handles should return true if the importer can handle the given path. Import should import the asset into the asset database.

OBJImporter

struct

type OBJImporter struct{}

OBJImporter.Handles

func (m OBJImporter) Handles(path string) bool

OBJImporter.Import

func (m OBJImporter) Import(path string) error

PNGImporter

struct

type PNGImporter struct{}

PNGImporter.Handles

func (m PNGImporter) Handles(path string) bool

PNGImporter.Import

func (m PNGImporter) Import(path string) error

StageImporter

struct

type StageImporter struct{}

StageImporter.Handles

func (m StageImporter) Handles(path string) bool

StageImporter.Import

func (m StageImporter) Import(path string) error