Documentation ¶
Overview ¶
Package object provides basic interfaces and default implementations of them. Provides reference interface and types of reference scope.
Usage:
package main func main() { domain := "1" record := "1" ref, err := NewReference(domain, record, GlobalScope) }
Index ¶
Constants ¶
View Source
const ( ChildScope = ScopeType(iota + 1) ContextScope GlobalScope )
ChildScope, ContextScope and GlobalScope represents types of scope for references.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseObject ¶
type BaseObject struct { }
BaseObject is a base implementation of Object interface.
func (*BaseObject) GetClassID ¶
func (bo *BaseObject) GetClassID() string
GetClassID return string representation of object's class.
type Callable ¶
type Callable interface { Object }
Callable is a marker interface that shows that object is able to be called.
type Object ¶
type Object interface {
GetClassID() string
}
Object marks that instance has ClassID (string representation of class).
type Parent ¶
type Parent interface { Callable GetChildStorage() storage.Storage // Storage for child references AddChild(child Child) (string, error) // return key for GetChild func GetChild(key string) (Child, error) // child type reference GetContext() []string // Parent give information about context references to its children GetContextStorage() storage.Storage // Storage for context references }
Parent allows to create objects (smart contracts) inside itself as children.
Click to show internal directories.
Click to hide internal directories.