loader

package
v2.1.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2016 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnknownConfigID = errors.New("Unknown config ID.")
)

Functions

This section is empty.

Types

type BaseConfigLoader

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

func NewBaseConfigLoader

func NewBaseConfigLoader() *BaseConfigLoader

func (*BaseConfigLoader) CreateConfig

func (this *BaseConfigLoader) CreateConfig(id string) (interface{}, error)

func (*BaseConfigLoader) RegisterCreator

func (this *BaseConfigLoader) RegisterCreator(id string, creator ConfigCreator) error

type ConfigCreator

type ConfigCreator func() interface{}

type ConfigLoader

type ConfigLoader interface {
	RegisterCreator(string, ConfigCreator) error
	CreateConfig(string) (interface{}, error)
	Load([]byte) (interface{}, string, error)
	LoadWithID([]byte, string) (interface{}, error)
}

Jump to

Keyboard shortcuts

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