Documentation ¶
Overview ¶
Package core allows to create Genesis Domain
ReferenceDomain - system domain that allow global reference resolving.
Usage:
factory := NewReferenceDomainFactory(parent) refDomain, error := factory.Create(nil) record, err := refDomain.RegisterReference(someReference) resolved, err := refDomain.ResolveReference(record)
ClassDomain - system domain that stores base system types named Classes.
Usage:
factory := NewClassDomainFactory(parent) clsDomain := factory.Create(parentDomain) record, err := clsDomain.RegisterClass(someFactory) someFactory, err = clsDomain.GetClass(record)
InstanceDomain - system domain that stores instances of other domains ¶
Usage:
factory := NewInstanceDomainFactory(parent) instDom, error := factory.Create(parent) record, err := instDom.CreateInstance(someDomainFactory) domainProxy, err := instDom.GetInstance(record)
Index ¶
Constants ¶
const ClassDomainName = "ClassDomain"
ClassDomainName is a name for class domain.
const InstanceDomainName = "InstanceDomain"
InstanceDomainName is a name for instance domain.
const ReferenceDomainName = "ReferenceDomain"
ReferenceDomainName is a name for reference domain.
Variables ¶
This section is empty.
Functions ¶
func NewClassDomainFactory ¶ added in v0.0.2
NewClassDomainFactory creates new factory for ClassDomain.
func NewInstanceDomainFactory ¶ added in v0.0.2
NewInstanceDomainFactory creates new factory for InstanceDomain.
Types ¶
type ClassDomain ¶ added in v0.0.2
type ClassDomain interface { // Base domain implementation. domain.Domain // RegisterClass is used to publish new Class. RegisterClass(object.Factory) (string, error) // GetClass provides factory instance from record. GetStoredClass(string) (object.Factory, error) }
ClassDomain is a contract that allows to publish new classes (e.g. new contract types).
type InstanceDomain ¶ added in v0.0.2
type InstanceDomain interface { // Base domain implementation. domain.Domain // CreateInstance is used to create new instance as a child to domain storage. CreateInstance(object.Factory) (string, error) // GetInstance returns instance from its record in domain storage. GetInstance(string) (object.Proxy, error) }
InstanceDomain is a contract that stores instances of other domains
type ReferenceDomain ¶
type ReferenceDomain interface { // Base domain implementation. domain.Domain // RegisterReference is used to publish new global references. RegisterReference(object.Reference, object.Proxy) (string, error) // ResolveReference provides reference instance from record. ResolveReference(string) (object.Reference, error) // InitGlobalMap sets globalResolverMap for references register/resolving. InitGlobalMap(globalInstanceMap *map[string]object.Proxy) }
ReferenceDomain is a contract that allows to publish and resolve global references.