value

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2021 License: MIT Imports: 4 Imported by: 2

Documentation

Overview

Package value provides types and functions for the representation of generic values with flexible types created at runtime

Index

Constants

This section is empty.

Variables

View Source
var Nothing *nothing = &nothing{}

Functions

func Base64

func Base64(i uint64) string

func Checksum

func Checksum(s string) uint64

func Hash

func Hash(s string) string

Types

type Identifier

type Identifier = uint64

type Number

type Number int64

func (Number) AsNumber

func (v Number) AsNumber() (Number, bool)

func (Number) AsStep

func (v Number) AsStep() (Step, bool)

func (Number) AsText

func (v Number) AsText() (Text, bool)

func (Number) GoString

func (v Number) GoString() string

func (Number) IsEmpty

func (v Number) IsEmpty() bool

func (Number) IsTerminal

func (v Number) IsTerminal() bool

func (Number) String

func (v Number) String() string

func (Number) Type

func (v Number) Type() TypeCode

type Step

type Step interface {
	StepCore
	Value
}

interface Step, type step: a semantic (RDF-like) triple, representing a statment of the form <subject>, <predicate>, <object>. Implementations of Step are in packages schema/graph and storage/graph

type StepCore

type StepCore interface {
	Item() Step
	Property() Step
	Value() Value
	Id() Identifier
}

type Text

type Text string

func (Text) AsNumber

func (v Text) AsNumber() (Number, bool)

func (Text) AsStep

func (v Text) AsStep() (Step, bool)

func (Text) AsText

func (v Text) AsText() (Text, bool)

func (Text) GoString

func (v Text) GoString() string

func (Text) IsEmpty

func (v Text) IsEmpty() bool

func (Text) IsTerminal

func (v Text) IsTerminal() bool

func (Text) String

func (v Text) String() string

func (Text) Type

func (v Text) Type() TypeCode

type TypeCode

type TypeCode byte
const (
	TC_nothing TypeCode = iota
	TC_text
	TC_number
	TC_step
)

type Value

type Value interface {
	IsEmpty() bool
	IsTerminal() bool
	Type() TypeCode
	AsNumber() (Number, bool)
	AsText() (Text, bool)
	AsStep() (Step, bool)
	String() string
	GoString() string
}

Jump to

Keyboard shortcuts

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