gospace

package module
v0.0.0-...-59fb8d1 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2021 License: MIT Imports: 2 Imported by: 1

README

goSpace

Synopsis

goSpace, a pSpace implementation in Go.

Importing goSpace

To get goSpace, do:

go get -u github.com/pspaces/gospace

To import goSpace into your project, add:

import (
      . "github.com/pspaces/gospace"
)

goSpace API

The goSpace API follows the Space API Specification. It contains the following operations:

Put(x_1, x_2, ..., x_n)
PutP(x_1, x_2, ..., x_n)
Get(x_1, x_2, ..., x_n)
GetP(x_1, x_2, ..., x_n)
GetAll(x_1, x_2, ..., x_n)
Query(x_1, x_2, ..., x_n)
QueryP(x_1, x_2, ..., x_n)
QueryAll(x_1, x_2, ..., x_n)

A space can be created by using NewSpace for creating a local space, or NewRemoteSpace for connecting to a remote space.

To create a space on the localhost, one can do:

spc := NewSpace("space")

To connect to a remote space with name space, one can do:

spc := NewRemoteSpace("tcp://example.com/space")

All operations act on a Space structures and x_1, x_2, ..., x_n are terms in a tuple.

Operations such as Put, Get, and so forth are blocking operations.

Operations postfixed by a P such as PutP, GetP, and so forth are non-blocking operations.

For Put and PutP operations, the terms are values and for the remaining operations terms are either values or binding variables.

Pattern matching can be achieved by passing a binding variable, that is, passing a pointer to a variabe by adding an & infront of the variable.

Binding variables can only be passed to Get* and Query* operations.

Space API Specification

The specification for the pSpace Space API can be found here.

Limitations

There are currently some limitations to the implementation:

  • Only TCP over IPv4 is supported.
  • Gates and space repositories are not supported yet.
  • Multiplexing of multiple spaces over a single gate is not supported yet.

Examples

Examples and cases for goSpace can be found here.

Contributing

Want to contribute? See CONTRIBUTING.md.

Authors

See AUTHORS.md.

License

MIT License. See LICENSE.md.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Space

type Space = spc.Space

func NewRemoteSpace

func NewRemoteSpace(name string) Space

NewSpace creates a structure that represents a remote space.

func NewSpace

func NewSpace(name string) Space

NewSpace creates a structure that represents a space.

type SpaceInterface

type SpaceInterface interface {
	spc.Interspace
}

SpaceInterface contains all interfaces that can operate on a space.

type Template

type Template = shr.Template

func CreateTemplate

func CreateTemplate(fields ...interface{}) Template

CreateTemplate creates a structure that represents a template.

type TemplateInterface

type TemplateInterface interface {
	shr.Intertemplate
}

TemplateInterface contains all interfaces that can operate on a template.

type Tuple

type Tuple = shr.Tuple

func CreateTuple

func CreateTuple(fields ...interface{}) Tuple

CreateTuple creates a structure that represents a tuple.

type TupleInterface

type TupleInterface interface {
	shr.Intertuple
}

TupleInterface contains all interfaces that can operate on a tuple.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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