loader

package
v1.19.2 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2016 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrConfigIDKeyNotFound = errors.New("Config ID key is not found.")
	ErrConfigIDExists      = errors.New("Config ID already exists.")
	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{}, error)
	LoadWithID([]byte, string) (interface{}, error)
}

Jump to

Keyboard shortcuts

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