metis

package module
v0.0.0-...-8766288 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2016 License: Apache-2.0 Imports: 15 Imported by: 0

README

metis-pkg

This is the core Go codebase of Metis, imported by the Metis Go code as well local, client-side metis-cli CLI tool.

metis-pkg is specifically designed to be usable by both first-party and third-party applications in the same way you'd be able to use any other Go package.

The Metis server is developed in the primary Metis repository. If you are looking for Metis releases, please consult that repository. metis-pkg goes through its own versioning system separate from the client-side TypeScript and server-side Go code of Metis.

No external packages are currently needed for metis-pkg.

Note: This package has currently only been tested on Linux-based operating systems and may not work yet on others. The plan is testing on Windows and applying appropriate patches where necessary.

Contributing

This project leverages CodeUtils for development and adopts the CodeUtils Usage Spec. To learn how to contribute to this project and set up CodeUtils, read here.

You have two supported options for obtaining this package:

  1. You can get the latest codebase by using go get github.com/StroblIndustries/metis-pkg
  2. You can download our latest 0.4.1 stable version

Compiling is done via CodeUtils' Compiler. More information linked in the Spec above.

Usage

Usage information is currently not available however will be documented and published on Strobl Industries' Developer Center around the time of the Metis 2.0 release.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NodeList map[string]interface{}

NodeList is a List of Nodes or Node Grtoups

Functions

func Configure

func Configure(providedConfig ConfigOptions)

Configure is used to configure the metis-pkg

func Decode

func Decode(bytes []byte) (map[string]interface{}, error)

Decode is responsible for taking []byte, decoding, and returning a map[string]interface{} and/or decode error

func Delete

func Delete(nodes []string, files []string) map[string]interface{}

Delete is a meta-function for deleting file(s) on nodes

func Initialize

func Initialize(nodeListFileContent []byte) bool

Initialize will initialize the metis with the contents of a NodeList

func IoLogic

func IoLogic(fileInputChan chan map[string]interface{}, action string, node Node, file string, content interface{})

IoLogic is responsible for handling local file IO, triggered via Manage()

func IsClusterReachable

func IsClusterReachable(clusterLocation string) bool

IsClusterReachable will ping the Cluster to confirm if we can connect

func IsDir

func IsDir(path string, createDir bool) bool

IsDir checks if path provided is dir, automatically attempts creation if not

func IsLocalNode

func IsLocalNode(node Node) bool

IsLocalNode checks if the provided Node is local or remote

func Manage

func Manage(action string, nodes []string, providedFiles interface{}, content interface{}) map[string]interface{}

Manage handles channeling, local / remote IO differentiation, etc.

func MessageLogger

func MessageLogger(syslogType syslog.Priority, message string)

MessageLogger log a message to system log

func ObjectMerger

func ObjectMerger(currentContent, newContent map[string]interface{}) map[string]interface{}

ObjectMerger will merge two objects

func Read

func Read(nodes []string, files []string) map[string]interface{}

Read is a meta-function for reading the contents of files

func Request

func Request(fileInputChan chan map[string]interface{}, action string, node Node, files []string, content interface{})

Request handles API requests to another remote Metis cluster.

func Update

func Update(nodes []string, files []string, content interface{}) map[string]interface{}

Update is a meta-function for updating the file contents of file(s) on nodes

func Write

func Write(nodes []string, files []string, content interface{}) map[string]interface{}

Write is a meta-function for writing file contents to file(s) on nodes

Types

type ConfigOptions

type ConfigOptions struct {
	DataRootDirectory string // Directory where data is stored
}

ConfigOptions is a struct of available configuration options for metis

var Config ConfigOptions

Config is the configuration of metis

type Node

type Node struct {
	Folder, Address, ExternalNodes string
}

Node is a struct with information on a Metis Node

func ConvertToNode

func ConvertToNode(object interface{}) (Node, error)

ConvertToNode will attempt to convert interface{} to Node

func GetNode

func GetNode(nodeName string) (Node, error)

GetNode will get the Node based on the string Node's name provided, or return err

type NodeGroup

type NodeGroup []Node

NodeGroup is an array of Nodes

Jump to

Keyboard shortcuts

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