Documentation ¶
Index ¶
- func New() *registry
- func Register(reg Registry, v Registrable, s Serializer, d Deserializer, os []BuildOption) error
- func RegisterFactory(reg Registry, key string, fn func() interface{}, s Serializer, d Deserializer, ...) error
- func RegisterKey(reg Registry, key string, v interface{}, s Serializer, d Deserializer, ...) error
- type AlreadyRegisteredKey
- type BuildOption
- type Deserializer
- type Registrable
- type Registry
- type Serde
- type Serializer
- type UnregisteredKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register(reg Registry, v Registrable, s Serializer, d Deserializer, os []BuildOption) error
func RegisterFactory ¶
func RegisterFactory(reg Registry, key string, fn func() interface{}, s Serializer, d Deserializer, os []BuildOption, ) error
func RegisterKey ¶
func RegisterKey(reg Registry, key string, v interface{}, s Serializer, d Deserializer, os []BuildOption) error
Types ¶
type AlreadyRegisteredKey ¶
type AlreadyRegisteredKey string
func (AlreadyRegisteredKey) Error ¶
func (key AlreadyRegisteredKey) Error() string
type BuildOption ¶
type BuildOption func(v interface{}) error
func ValidateImplements ¶
func ValidateImplements(checkV interface{}) BuildOption
type Deserializer ¶
type Registrable ¶
type Registrable interface {
Key() string
}
type Registry ¶
type Registry interface { Serialize(string, interface{}) ([]byte, error) MustSerialize(string, interface{}) []byte Build(string, ...BuildOption) (interface{}, error) MustBuild(string, ...BuildOption) interface{} Deserialize(string, []byte, ...BuildOption) (interface{}, error) MustDeserialize(string, []byte, ...BuildOption) interface{} // contains filtered or unexported methods }
type Serde ¶
type Serde interface { Register(v Registrable, options ...BuildOption) error RegisterKey(key string, v interface{}, options ...BuildOption) error RegisterFactory(key string, fn func() interface{}, options ...BuildOption) error }
type Serializer ¶
type UnregisteredKey ¶
type UnregisteredKey string
func (UnregisteredKey) Error ¶
func (key UnregisteredKey) Error() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.