cs

package
v0.0.2-dev Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2016 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package cs defines types to work with Chainscripts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Link struct {
	State map[string]interface{} `json:"state"`
	Meta  map[string]interface{} `json:"meta"`
}

Link contains a state and meta data about the state.

func (*Link) GetMapID

func (l *Link) GetMapID() string

GetMapID returns the map ID as a string. It assumes the link is valid.

func (*Link) GetPrevLinkHash

func (l *Link) GetPrevLinkHash() *types.Bytes32

GetPrevLinkHash returns the previous link hash as a bytes. It assumes the link is valid. It will return nilif the previous link hash is null.

func (*Link) GetPrevLinkHashString

func (l *Link) GetPrevLinkHashString() string

GetPrevLinkHashString returns the previous link hash as a string. It assumes the link is valid. It will return an empty string if the previous link hash is null.

func (*Link) GetPriority

func (l *Link) GetPriority() float64

GetPriority returns the priority as a float64 It assumes the link is valid. If priority is nil, it will return -Infinity.

func (*Link) GetTags

func (l *Link) GetTags() []string

GetTags returns the tags as an array of string. It assumes the link is valid. It will return nil if there are no tags.

type Segment

type Segment struct {
	Link Link                   `json:"link"`
	Meta map[string]interface{} `json:"meta"`
}

Segment contains a link and meta data about the link.

func (*Segment) GetLinkHash

func (s *Segment) GetLinkHash() *types.Bytes32

GetLinkHash returns the link ID as bytes. It assumes the segment is valid.

func (*Segment) GetLinkHashString

func (s *Segment) GetLinkHashString() string

GetLinkHashString returns the link ID as a string. It assumes the segment is valid.

func (*Segment) Validate

func (s *Segment) Validate() error

Validate checks for errors in a segment.

type SegmentSlice

type SegmentSlice []*Segment

SegmentSlice is a slice of segment pointers.

func (SegmentSlice) Len

func (s SegmentSlice) Len() int

Len implements sort.Interface.Len.

func (SegmentSlice) Less

func (s SegmentSlice) Less(i, j int) bool

Less implements sort.Interface.Less.

func (SegmentSlice) Swap

func (s SegmentSlice) Swap(i, j int)

Swap implements sort.Interface.Swap.

Directories

Path Synopsis
Package cstesting defines helpers to test Chainscripts.
Package cstesting defines helpers to test Chainscripts.

Jump to

Keyboard shortcuts

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