config

package
v0.0.0-...-3b8f57b Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2015 License: GPL-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StartConfigPort = 9000

Functions

func ConstructTree

func ConstructTree(
	n *Node,
	hc *HostConfig,
	parent string,
	suite abstract.Suite,
	rand cipher.Stream,
	hosts map[string]coconet.Host,
	nameToAddr map[string]string,
	opts ConfigOptions) (int, error)

ConstructTree does a depth-first construction of the tree specified in the config file. ConstructTree must be called AFTER populating the HostConfig with ALL the possible hosts.

func GetAddress

func GetAddress() (string, error)

getAddress gets the localhosts IPv4 address.

func GetSuite

func GetSuite(suite string) abstract.Suite

Helper functions that will return the suite used during the process from a string name

Types

type AppConfig

type AppConfig struct {
	Hostname    string // Hostname like server-0.cs-dissent ?
	Logger      string // ip addr of the logger to connect to
	PhysAddr    string // physical IP addr of the host
	AmRoot      bool   // is the host root (i.e. special operations)
	TestConnect bool   // Dylan-code to only test the connection and exit afterwards
	App         string // which app are we running on this host ["coll_sign","coll_stamp","schnorr_sign"]
	Mode        string // ["server", "client"]
	Name        string // Comes from deter.go:187 - "Name of the node"
	Server      string // Timestamping servers to contact
}

type ConfigFile

type ConfigFile struct {
	Hosts []string     `json:"hosts"`
	Tree  *graphs.Tree `json:"tree"`
}

func ConfigFromTree

func ConfigFromTree(t *graphs.Tree, hosts []string) *ConfigFile

type ConfigFileOld

type ConfigFileOld struct {
	Conn  string   `json:"conn,omitempty"`
	Hosts []string `json:"hosts"`
	Tree  *Node    `json:"tree"`
}

type ConfigOptions

type ConfigOptions struct {
	ConnType  string         // "go", tcp"
	Hostnames []string       // if not nil replace hostnames with these
	GenHosts  bool           // if true generate random hostnames (all tcp)
	Host      string         // hostname to load into memory: "" for all
	Port      string         // if specified rewrites all ports to be this
	Faulty    bool           // if true, use FaultyHost wrapper around Hosts
	Suite     abstract.Suite // suite to use for Hosts
	NoTree    bool           // bool flag to tell wether we want to construct

}

type ConnType

type ConnType int
const (
	GoC ConnType = iota
	TcpC
)

type HostConfig

type HostConfig struct {
	SNodes []*sign.Node          // an array of signing nodes
	Hosts  map[string]*sign.Node // maps hostname to host
	Dir    *coconet.GoDirectory  // the directory mapping hostnames to goPeers
}

HostConfig stores all of the relevant information of the configuration file.

func LoadConfig

func LoadConfig(fname string, opts ...ConfigOptions) (*HostConfig, error)

TODO: if in tcp mode associate each hostname in the file with a different port. Get the remote address of this computer to combine with those for the complete hostnames to be used by the hosts. LoadConfig loads a configuration file in the format specified above. It populates a HostConfig with HostNode Hosts and goPeer Peers.

func LoadJSON

func LoadJSON(file []byte, optsSlice ...ConfigOptions) (*HostConfig, error)

func NewHostConfig

func NewHostConfig() *HostConfig

NewHostConfig creates a new host configuration that can be populated with hosts.

func (*HostConfig) Run

func (hc *HostConfig) Run(stamper bool, signType sign.Type, hostnameSlice ...string) error

run the given hostnames

func (*HostConfig) String

func (hc *HostConfig) String() string

func (*HostConfig) Verify

func (hc *HostConfig) Verify() error

type HostsConfig

type HostsConfig struct {
	Conn  string   `json:"conn,omitempty"`
	Hosts []string `json:"hosts"`
}

Simplest config representig the type of connection we want to do (tcp / goroutines ?) and the list of hostnames like "10.0.4.10:2000

type JSONPoint

type JSONPoint json.RawMessage

type Node

type Node struct {
	Name     string  `json:"name"`
	PriKey   string  `json:"prikey,omitempty"`
	PubKey   string  `json:"pubkey,omitempty"`
	Children []*Node `json:"children,omitempty"`
}

Jump to

Keyboard shortcuts

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