graphjson

package
v0.0.0-...-51c55f7 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2015 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package graphjson saves and loads architectures to and from graph json files

Index

Constants

This section is empty.

Variables

View Source
var Enabled bool

Enabled is set via command line flags to turn on json logging

Functions

func Close

func Close()

Close completes the json file format and closes the file

func Setup

func Setup(arch string)

Setup by opening the "arch".json file and writing a header, noting the generated architecture type, version and args for the run

func Write

func Write(str string)

Write a string to the file

func WriteEdge

func WriteEdge(fromTo string)

WriteEdge writes the edge to a file given a space separated from and to node name

func WriteNode

func WriteNode(nameService string)

WriteNode writes the node to a file given a space separated name and service type

Types

type EdgeV0r3

type EdgeV0r3 struct {
	Edge   string `json:"edge"`
	Source string `json:"source"`
	Target string `json:"target"`
}

EdgeV0r3 defines an edge for version 0.3, used to make json edges for writing

type ElementV0r3

type ElementV0r3 struct {
	Node    string `json:"node,omitempty"`
	Service string `json:"service,omitempty"`
	Edge    string `json:"edge,omitempty"`
	Source  string `json:"source,omitempty"`
	Target  string `json:"target,omitempty"`
}

ElementV0r3 defines a way to read either a node or an edge in the graph for version 0.3

type GraphV0r3

type GraphV0r3 struct {
	Arch    string        `json:"arch"`
	Version string        `json:"version"`
	Args    string        `json:"args"`
	Graph   []ElementV0r3 `json:"graph"`
}

GraphV0r3 defines version 0.3 of the graphjson file format with an array of elements

func ReadArch

func ReadArch(arch string) *GraphV0r3

ReadArch parses graphjson

type GraphVersion

type GraphVersion struct {
	Version string `json:"version"`
}

GraphVersion extracts the version so it can be checked

type NodeV0r3

type NodeV0r3 struct {
	Node    string `json:"node"`
	Service string `json:"service"`
}

NodeV0r3 defines a node for version 0.3, used to make json nodes for writing

Jump to

Keyboard shortcuts

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