cim

package module
v0.0.0-...-2dce2e9 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2016 License: GPL-3.0 Imports: 6 Imported by: 0

README

cim

Cim golang package is a generic tcp client/server that can provide arbitrary CLI services

To install do

  1. $ go get -u github.com/LDCS/cim
  2. Create a cfg file in the format specified in example_ports.cfg based on yout needs.
  3. Edit the following line in cim.go with the path to ports cfg file.

var cfgFile = "/path/to/ports.cfg"

Documentation

Overview

cim is a command line interface manager package Using this package one can create a cim server as well as a client

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CBfunc

type CBfunc func(interface{}, string, ...string) string

Callback accepts the shared data command, and arguments, returns a string

type CimConnection

type CimConnection struct {
	// contains filtered or unexported fields
}

func NewCimConnection

func NewCimConnection(host, simInst, connId string) (*CimConnection, error)

func (*CimConnection) Close

func (cc *CimConnection) Close() error

func (*CimConnection) RunCommand

func (cc *CimConnection) RunCommand(cmd string) (string, error)

type CimNode

type CimNode struct {
	IsLeaf    bool
	Name      string
	Path      string
	Children  []*CimNode
	Callbacks map[string]CBfunc
	Parent    *CimNode
}

type CimServer

type CimServer struct {
	// contains filtered or unexported fields
}

func NewCimServer

func NewCimServer(host, simInst string, root *CimNode, data interface{}) (*CimServer, error)

func (*CimServer) Start

func (cs *CimServer) Start() error

type ExecData

type ExecData struct {
	Callback CBfunc
	Cmd      string
	Args     []string
	Data     interface{}
	RetChan  chan string
}

Jump to

Keyboard shortcuts

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