Documentation ¶
Index ¶
- type Intertemplate
- type Intertuple
- type Mode
- type SpaceURI
- func (su *SpaceURI) Hostname() (hostname string)
- func (su *SpaceURI) Mode() (mode string)
- func (su *SpaceURI) Path() (path string)
- func (su *SpaceURI) Port() (port string)
- func (su *SpaceURI) Scheme() (hostname string)
- func (su *SpaceURI) Space() (hostname string)
- func (su SpaceURI) String() (str string)
- type Template
- type Tuple
- func (t Tuple) GetDelimiter() string
- func (t *Tuple) GetFieldAt(i int) interface{}
- func (t Tuple) GetParenthesisType() (string, string)
- func (t *Tuple) Length() int
- func (t *Tuple) Match(tp Template) bool
- func (t *Tuple) SetFieldAt(i int, val interface{})
- func (t Tuple) String() string
- func (t *Tuple) WriteToVariables(params ...interface{})
- type TypeField
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Intertemplate ¶
Intertemplate an interface for manipulating templates.
type Intertuple ¶
type Intertuple interface { Length() int GetFieldAt(i int) interface{} SetFieldAt(i int, val interface{}) }
Intertuple defines an interface for manipulating tuples.
type SpaceURI ¶
type SpaceURI struct {
// contains filtered or unexported fields
}
SpaceURI is a structure for containing information about a resource location.
func NewSpaceURI ¶
NewSpaceURI creates a new URI location to a resource. NewSpaceURI follows a restricted URI scheme defined by pSpace specification.
type Template ¶
type Template struct {
Fields []interface{}
}
Template structure used for matching against tuples. Templates is, in princple, a tuple with additional attributes used for pattern matching.
func CreateTemplate ¶
func CreateTemplate(fields ...interface{}) Template
CreateTemplate creates a template from the variadic fields provided. CreateTemplate encapsulates the types of pointer values and are used to provide variable binding. Variable binding is used in Pattern matched values such that they can be writen back through the pointers.
func (Template) GetDelimiter ¶
GetDelimiter returns the delimiter used to seperated the template fields. GetParenthesisType is used in the String() method.
func (*Template) GetFieldAt ¶
GetFieldAt returns the i'th field of the template.
func (Template) GetParenthesisType ¶
GetParenthesisType returns a pair of strings that encapsulates the template. GetParenthesisType is used in the String() method.
type Tuple ¶
type Tuple struct {
Fields []interface{} // Field of the tuple.
}
Tuple contains a set of fields, where fields can be any primitive or type. A tuple is used to store information which is placed in a tuple space.
func CreateTuple ¶
func CreateTuple(fields ...interface{}) Tuple
CreateTuple create a tuple according to the values in the fields.
func CreateTupleFromTemplate ¶
func CreateTupleFromTemplate(t ...interface{}) (tp Tuple)
CreateTupleFromTemplate reads a template and returns a new tuple tp. CreateTupleFromTemplate extracts values from any pointers it finds in template t.
func (Tuple) GetDelimiter ¶
GetDelimiter returns the delimiter used to seperated the tuple fields. GetParenthesisType is used in the String() method.
func (*Tuple) GetFieldAt ¶
GetFieldAt returns the i'th field of the tuple.
func (Tuple) GetParenthesisType ¶
GetParenthesisType returns a pair of strings that encapsulates the tuple. GetParenthesisType is used in the String() method.
func (*Tuple) Match ¶
Match pattern matches the tuple against the template tp. Match discriminates between encapsulated formal fields and actual fields. Match returns true if the template matches the tuple, and false otherwise.
func (*Tuple) SetFieldAt ¶
SetFieldAt sets the i'th field of the tuple to the value of val.
func (*Tuple) WriteToVariables ¶
func (t *Tuple) WriteToVariables(params ...interface{})
WriteToVariables will overwrite the values pointed to by pointers with the values contained in the tuple. WriteToVariables will ignore unaddressable pointers. TODO: There should be placed a lock around the variables that are being changed, to ensure that mix of two tuple are written to the variables.