core

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

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

View Source
const ClassDomainName = "ClassDomain"

ClassDomainName is a name for class domain.

View Source
const InstanceDomainName = "InstanceDomain"

InstanceDomainName is a name for instance domain.

View Source
const ReferenceDomainName = "ReferenceDomain"

ReferenceDomainName is a name for reference domain.

Variables

This section is empty.

Functions

func NewClassDomainFactory added in v0.0.2

func NewClassDomainFactory(parent object.Parent) object.Factory

NewClassDomainFactory creates new factory for ClassDomain.

func NewInstanceDomainFactory added in v0.0.2

func NewInstanceDomainFactory(parent object.Parent) object.Factory

NewInstanceDomainFactory creates new factory for InstanceDomain.

func NewReferenceDomainFactory

func NewReferenceDomainFactory(parent object.Parent) object.Factory

NewReferenceDomainFactory creates new factory for ReferenceDomain.

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.

Jump to

Keyboard shortcuts

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