resolver

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2018 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package resolver provides interface and default implementation of resolvers for getting objects from references.

Usage:

package main

import (
	"github.com/insolar/insolar/genesis/model/class"
	"github.com/insolar/insolar/genesis/model/object"
}

func main() {
	resolver := NewChildResolver(parent)
	obj, err := resolver.GetObject(ref, class.ObjectID)
	res := obj.(object.Object)
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChildResolver

type ChildResolver struct {
	// contains filtered or unexported fields
}

ChildResolver is resolver for ChildScope references.

func NewChildResolver

func NewChildResolver(parent object.Parent) *ChildResolver

NewChildResolver creates new ChildResolver instance.

func (*ChildResolver) GetObject

func (r *ChildResolver) GetObject(ref *object.Reference, classID string) (Proxy, error)

GetObject reserve object by its reference and return its proxy.

type ContextResolver

type ContextResolver struct {
	// contains filtered or unexported fields
}

ContextResolver is resolver for ContextScope references.

func NewContextResolver

func NewContextResolver(parent object.Parent) *ContextResolver

NewContextResolver creates new ContextResolver instance.

func (*ContextResolver) GetObject

func (r *ContextResolver) GetObject(ref *object.Reference, classID string) (Proxy, error)

GetObject reserve object by its reference and return its proxy.

type GlobalResolver

type GlobalResolver struct {
	// contains filtered or unexported fields
}

GlobalResolver is resolver for GlobalScope references.

func NewGlobalResolver

func NewGlobalResolver() *GlobalResolver

NewGlobalResolver creates new GlobalResolver instance. TODO: pass map?

func (*GlobalResolver) GetObject

func (r *GlobalResolver) GetObject(ref *object.Reference, classID string) (Proxy, error)

GetObject reserve object by its reference and return its proxy.

type Proxy

type Proxy interface {
	object.Child
}

Proxy marks instance as proxy object.

type Resolver

type Resolver interface {
	GetObject(*object.Reference, string) (Proxy, error)
}

Resolver marks that instance have ability to get proxy objects by its reference.

Jump to

Keyboard shortcuts

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