clout

package
v0.22.4 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2024 License: Apache-2.0 Imports: 12 Imported by: 14

Documentation

Index

Constants

View Source
const Version = "1.0"

Variables

This section is empty.

Functions

func NewKey

func NewKey() string

Types

type Clout

type Clout struct {
	Version    string        `json:"version" yaml:"version" ard:"version"`
	Metadata   ard.StringMap `json:"metadata" yaml:"metadata" ard:"metadata"`
	Properties ard.StringMap `json:"properties" yaml:"properties" ard:"properties"`
	Vertexes   Vertexes      `json:"vertexes" yaml:"vertexes" ard:"vertexes"`
}

func Load added in v0.18.0

func Load(context contextpkg.Context, url exturl.URL, forceFormat string) (*Clout, error)

func NewClout

func NewClout() *Clout

func Read

func Read(reader io.Reader, format string) (*Clout, error)

func Unpack added in v0.22.4

func Unpack(map_ ard.Map) (*Clout, error)

func (*Clout) Copy added in v0.21.0

func (self *Clout) Copy() (*Clout, error)

Creates a copy of the Clout in which ARD is used for all data.

func (*Clout) CopyAsIs added in v0.22.4

func (self *Clout) CopyAsIs() *Clout

Creates a copy of the Clout in which non-ARD data is left as is.

func (*Clout) MarshalJSON

func (self *Clout) MarshalJSON() ([]byte, error)

(json.Marshaler interface)

func (*Clout) MarshalableStringMaps

func (self *Clout) MarshalableStringMaps() any

func (*Clout) NewVertex

func (self *Clout) NewVertex(id string) *Vertex

func (*Clout) Resolve

func (self *Clout) Resolve() error

func (*Clout) ResolveEdges added in v0.22.4

func (self *Clout) ResolveEdges() error

type Edge

type Edge struct {
	Metadata   ard.StringMap
	Properties ard.StringMap
	Source     *Vertex
	TargetID   string
	Target     *Vertex
}

func (*Edge) GetMetadata

func (self *Edge) GetMetadata() ard.StringMap

Entity interface

func (*Edge) GetProperties

func (self *Edge) GetProperties() ard.StringMap

Entity interface

func (*Edge) MarshalCBOR added in v0.18.0

func (self *Edge) MarshalCBOR() ([]byte, error)

(cbor.Marshaler interface)

func (*Edge) MarshalJSON

func (self *Edge) MarshalJSON() ([]byte, error)

(json.Marshaler interface)

func (*Edge) MarshalMsgpack added in v0.21.0

func (self *Edge) MarshalMsgpack() ([]byte, error)

(msgpack.Marshaler interface)

func (*Edge) MarshalYAML

func (self *Edge) MarshalYAML() (any, error)

([yaml.Marshaler] interface)

func (*Edge) Marshalable

func (self *Edge) Marshalable(stringMaps bool) any

func (*Edge) Remove

func (self *Edge) Remove()

func (*Edge) ToARD added in v0.21.0

func (self *Edge) ToARD(reflector *ard.Reflector) (any, error)

(ard.ToARD interface)

func (*Edge) Unmarshal

func (self *Edge) Unmarshal(f func(m *MarshalableEdge) error) error

func (*Edge) UnmarshalCBOR added in v0.18.0

func (self *Edge) UnmarshalCBOR(data []byte) error

cbor.Unmarshaler interface

func (*Edge) UnmarshalJSON

func (self *Edge) UnmarshalJSON(data []byte) error

json.Unmarshaler interface

func (*Edge) UnmarshalMsgpack added in v0.21.0

func (self *Edge) UnmarshalMsgpack(data []byte) error

msgpack.Unmarshaler interface

func (*Edge) UnmarshalYAML

func (self *Edge) UnmarshalYAML(unmarshal func(any) error) error

yaml.Unmarshaler interface

type Edges

type Edges []*Edge

func (Edges) Size added in v0.21.0

func (self Edges) Size() int

Note: ".length" will not work reliably in JavaScript because once the value is bound it will not reflect changes to the struct's field

type Entity

type Entity interface {
	GetMetadata() ard.StringMap
	GetProperties() ard.StringMap
}

type MarshalableCloutStringMaps

type MarshalableCloutStringMaps Clout

type MarshalableEdge

type MarshalableEdge struct {
	Metadata   ard.StringMap `json:"metadata" yaml:"metadata" ard:"metadata"`
	Properties ard.StringMap `json:"properties" yaml:"properties" ard:"properties"`
	TargetID   string        `json:"targetID" yaml:"targetID" ard:"targetID"`
}

type MarshalableEdgeStringMaps

type MarshalableEdgeStringMaps struct {
	Metadata   ard.StringMap `json:"metadata"`
	Properties ard.StringMap `json:"properties"`
	TargetID   string        `json:"targetID"`
}

type MarshalableVertexStringMaps

type MarshalableVertexStringMaps struct {
	Metadata   ard.StringMap `json:"metadata"`
	Properties ard.StringMap `json:"properties"`
	EdgesOut   Edges         `json:"edgesOut"`
}

type Vertex

type Vertex struct {
	Clout      *Clout        `json:"-" yaml:"-"`
	ID         string        `json:"-" yaml:"-"`
	Metadata   ard.StringMap `json:"metadata" yaml:"metadata"`
	Properties ard.StringMap `json:"properties" yaml:"properties"`
	EdgesOut   Edges         `json:"edgesOut" yaml:"edgesOut"`
	EdgesIn    Edges         `json:"-" yaml:"-"`
}

func (*Vertex) GetMetadata

func (self *Vertex) GetMetadata() ard.StringMap

Entity interface

func (*Vertex) GetProperties

func (self *Vertex) GetProperties() ard.StringMap

Entity interface

func (*Vertex) MarshalJSON

func (self *Vertex) MarshalJSON() ([]byte, error)

(json.Marshaler interface)

func (*Vertex) MarshalableStringMaps

func (self *Vertex) MarshalableStringMaps() any

func (*Vertex) NewEdgeTo

func (self *Vertex) NewEdgeTo(target *Vertex) *Edge

func (*Vertex) NewEdgeToID

func (self *Vertex) NewEdgeToID(targetId string) *Edge

func (*Vertex) Remove

func (self *Vertex) Remove()

type Vertexes

type Vertexes map[string]*Vertex

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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