netAgent

package module
v0.0.0-...-29a4dac Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2015 License: Apache-2.0 Imports: 21 Imported by: 1

README

Deprecated!. Move to cxy-sdn for univeral management now

netAgent

Travis

Embedded network agent for using consul to communicate and do failure detection and store net config. Bring the consul major functionality into this one binary without installing consul binary onto the nodes

Documentation

Index

Constants

View Source
const (
	OK = iota
	OUTDATED
	ERROR
)
View Source
const (
	NOTIFY_UPDATE_ADD = iota
	NOTIFY_UPDATE_MODIFY
	NOTIFY_UPDATE_DELETE
)
View Source
const (
	WATCH_TYPE_NODE = iota
	WATCH_TYPE_KEY
	WATCH_TYPE_STORE
	WATCH_TYPE_EVENT
)
View Source
const CONSUL_CATALOG_BASE_URL = "http://localhost:8500/v1/catalog/"
View Source
const CONSUL_KV_BASE_URL = "http://localhost:8500/v1/kv/"
View Source
const Version = "0.5.2"

the consul version use here

View Source
const VersionPrerelease = "dev"

Variables

Commands is the mapping of all the available Consul commands.

View Source
var GitCommit string
View Source
var GitDescribe string

Functions

func Delete

func Delete(store string, key string) int

return val indicate the error type

func Execute

func Execute(args ...string) int

Execute function is borrowed from Consul's main.go

func Get

func Get(store string, key string) ([]byte, int, bool)

1st return value as []byte 2nd return its ModifyIndex 3rd return ok or not

func GetAll

func GetAll(store string) ([][]byte, []int, bool)

get all key-value pairs in one store from backend

func Join

func Join(addr string) error

func Leave

func Leave() error

func Put

func Put(store string, key string, value []byte, oldVal []byte) int

return val indicate the error type need old val as 4-th param

func RegisterForKeyUpdates

func RegisterForKeyUpdates(store string, key string, listener Listener)

func RegisterForNodeUpdates

func RegisterForNodeUpdates(listener Listener)

func RegisterForStoreUpdates

func RegisterForStoreUpdates(store string, listener Listener)

func StartAgent

func StartAgent(serverMode bool, bootstrap bool, bindInterface string, dataDir string) error

Types

type KVRespBody

type KVRespBody struct {
	CreateIndex int    `json:"CreateIndex,omitempty"`
	ModifyIndex int    `json:"ModifyIndex,omitempty"`
	Key         string `json:"Key,omitempty"`
	Flags       int    `json:Flags,omitempty"`
	Value       string `json:Value,omitempty"`
}

type Listener

type Listener interface {
	NotifyNodeUpdate(NotifyUpdateType, string)
	NotifyKeyUpdate(NotifyUpdateType, string, []byte)
	NotifyStoreUpdate(NotifyUpdateType, string, map[string][]byte)
}

type Node

type Node struct {
	Name    string `json:"Name,omitempty"`
	Address string `json:"Addr,ommitempty"`
}

type NotifyUpdateType

type NotifyUpdateType int

type WatchType

type WatchType int

Directories

Path Synopsis
Godeps
+build go1.3
_workspace/src/github.com/boltdb/bolt
Package bolt implements a low-level key/value store in pure Go.
Package bolt implements a low-level key/value store in pure Go.
_workspace/src/github.com/golang/glog
Package glog implements logging analogous to the Google-internal C++ INFO/ERROR/V setup.
Package glog implements logging analogous to the Google-internal C++ INFO/ERROR/V setup.
_workspace/src/github.com/hashicorp/go-checkpoint
checkpoint is a package for checking version information and alerts for a HashiCorp product.
checkpoint is a package for checking version information and alerts for a HashiCorp product.
_workspace/src/github.com/hashicorp/go-msgpack/codec
High Performance, Feature-Rich Idiomatic Go encoding library for msgpack and binc .
High Performance, Feature-Rich Idiomatic Go encoding library for msgpack and binc .
_workspace/src/github.com/hashicorp/golang-lru
This package provides a simple LRU cache.
This package provides a simple LRU cache.
_workspace/src/github.com/hashicorp/hcl
hcl is a package for decoding HCL into usable Go structures.
hcl is a package for decoding HCL into usable Go structures.
_workspace/src/github.com/hashicorp/logutils
Package logutils augments the standard log package with levels.
Package logutils augments the standard log package with levels.
_workspace/src/github.com/hashicorp/memberlist
memberlist is a library that manages cluster membership and member failure detection using a gossip based protocol.
memberlist is a library that manages cluster membership and member failure detection using a gossip based protocol.
_workspace/src/github.com/hashicorp/net-rpc-msgpackrpc
Package msgpackrpc implements a MessagePack-RPC ClientCodec and ServerCodec for the rpc package, using the same API as the Go standard library for jsonrpc.
Package msgpackrpc implements a MessagePack-RPC ClientCodec and ServerCodec for the rpc package, using the same API as the Go standard library for jsonrpc.
_workspace/src/github.com/inconshreveable/muxado
muxado is an implementation of a general-purpose stream-multiplexing protocol.
muxado is an implementation of a general-purpose stream-multiplexing protocol.
_workspace/src/github.com/miekg/dns
Package dns implements a full featured interface to the Domain Name System.
Package dns implements a full featured interface to the Domain Name System.
_workspace/src/github.com/miekg/dns/idn
Package idn implements encoding from and to punycode as speficied by RFC 3492.
Package idn implements encoding from and to punycode as speficied by RFC 3492.
_workspace/src/github.com/mitchellh/mapstructure
The mapstructure package exposes functionality to convert an abitrary map[string]interface{} into a native Go structure.
The mapstructure package exposes functionality to convert an abitrary map[string]interface{} into a native Go structure.
_workspace/src/golang.org/x/crypto/ssh/terminal
Package terminal provides support functions for dealing with terminals, as commonly found on UNIX systems.
Package terminal provides support functions for dealing with terminals, as commonly found on UNIX systems.

Jump to

Keyboard shortcuts

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