api

package
v0.0.0-...-25cadc1 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2018 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(user, password, host string, port int) (*ssh.Session, error)

Connect about SSH

func GetAccountInfo

func GetAccountInfo(url, username string) (*util.AccountInfo, error)

GetAccountInfo GetAccountInfo

func MonitorConfigFile

func MonitorConfigFile(configFile string) error

MonitorConfigFile MonitorConfigFile

func PathExist

func PathExist(_path string) bool

PathExist PathExist

func SaveIpPonixToBlockchain

func SaveIpPonixToBlockchain(myNodeIpaddr string) map[string]CityInfo

SaveIpPonixToBlockchain SaveIpPonixToBlockchain

func SshCommand

func SshCommand(user, password, host string, port int, command string) (string, error)

SshCommand SshCommand

func WriteFile

func WriteFile(filename string, nodeInfos NodeInfos) error

WriteFile WriteFile

Types

type CityInfo

type CityInfo struct {
	Pointx string
	Pointy string
}

CityInfo struct

type Country

type Country struct {
	Country   string
	Province  string
	City      string
	Latitude  float32
	Longitude float32
}

Country struct

type CountryDetails

type CountryDetails struct {
	City CityInfo
}

CountryDetails struct

type Ippointxy

type Ippointxy struct {
	ID        bson.ObjectId `bson:"_id"`
	Ip        string        `bson:"ip"`
	Pointx    string        `bson:"pointx"`
	Pointy    string        `bson:"pointy"`
	CreatedAt time.Time     `bson:"createdAt"`
}

Ippointxy struct

type MongoContext

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

MongoContext struct

func GetSession

func GetSession(url string) (*MongoContext, error)

GetSession GetSession

func (*MongoContext) GetCollection

func (c *MongoContext) GetCollection(db string, collection string) *mgo.Collection

GetCollection GetCollection

func (*MongoContext) SetCollectionByDB

func (c *MongoContext) SetCollectionByDB(db string, collection string, s func(*mgo.Collection) error) error

SetCollectionByDB SetCollectionByDB

type MongoRepository

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

MongoRepository struct

func NewMongoRepository

func NewMongoRepository(endpoint string) *MongoRepository

NewMongoRepository NewMongoRepository

func (*MongoRepository) CallInsertPointxy

func (r *MongoRepository) CallInsertPointxy(ip string, pointx string, pointy string) (uint32, error)

CallInsertPointxy CallInsertPointxy

func (*MongoRepository) InsertRecord

func (r *MongoRepository) InsertRecord(tablename string, keyname string, key string, valueName string, value interface{}) (uint32, error)

InsertRecord InsertRecord

type NodeCapacityInfo

type NodeCapacityInfo struct {
	NodeUUID        string `json:nodeuuid`
	NodeIP          string `json:nodeip`
	StorageCapacity string `json:storagecapacity`
}

NodeCapacityInfo struct

type NodeInfo

type NodeInfo struct {
	NodeName        string
	IpAddr          string
	UserName        string
	PassWord        string
	BtoPort         string
	BtoUser         string
	BtoPath         string
	WalletIP        string
	KeyPath         string
	ProdUser        string
	DbUser          string
	DbPass          string
	StorageSize     string
	StoragePath     string
	ServPath        string
	ServLst         []string
	SeedIp          string
	SlaveIpLst      []string
	StorageCapacity string
}

NodeInfo struct

type NodeInfos

type NodeInfos struct {
	Node []NodeInfo
}

NodeInfos struct

func ReadFile

func ReadFile(filename string) NodeInfos

ReadFile ReadFile

type StorageDBClusterInfo

type StorageDBClusterInfo struct {
	SeedIP   string `json:"nodeIP"` //This is node's self ip, in future, seedip should be added here.
	SlaveIP  string `json:"clusterIP"`
	NodeUUID string `json:"uuid"`

	StorageCapacity string `json:"capacity"`
}

StorageDBClusterInfo struct

Jump to

Keyboard shortcuts

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