Commit 15f1e05f authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent bad63742
...@@ -47,9 +47,6 @@ import ( ...@@ -47,9 +47,6 @@ import (
// NEOSrv represents running NEO server. // NEOSrv represents running NEO server.
type NEOSrv interface { type NEOSrv interface {
// XXX kill or restore?
//ClusterName() string // name of the cluster
//MasterAddr() string // address of the master
URL() string // zurl to access this NEO server URL() string // zurl to access this NEO server
Bugs() []string // list of known server bugs Bugs() []string // list of known server bugs
...@@ -169,16 +166,12 @@ func StartNEOPySrv(opt NEOSrvOptions) (_ *NEOPySrv, err error) { ...@@ -169,16 +166,12 @@ func StartNEOPySrv(opt NEOSrvOptions) (_ *NEOPySrv, err error) {
return n, nil return n, nil
} }
func (n *NEOPySrv) ClusterName() string { func (n *NEOPySrv) clusterName() string {
return n.opt.name return n.opt.name
} }
func (n *NEOPySrv) MasterAddr() string {
return n.masterAddr
}
func (n *NEOPySrv) URL() string { func (n *NEOPySrv) URL() string {
return fmt.Sprintf("%s%s/%s", n.opt.URLPrefix(), n.MasterAddr(), n.ClusterName()) return fmt.Sprintf("%s%s/%s", n.opt.URLPrefix(), n.masterAddr, n.clusterName())
} }
func (n *NEOPySrv) Close() (err error) { func (n *NEOPySrv) Close() (err error) {
...@@ -261,7 +254,7 @@ func StartNEOGoSrv(opt NEOSrvOptions) (_ *NEOGoSrv, err error) { ...@@ -261,7 +254,7 @@ func StartNEOGoSrv(opt NEOSrvOptions) (_ *NEOGoSrv, err error) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
n.S = NewStorage(opt.name, n.MasterAddr(), net, n.Sback) n.S = NewStorage(opt.name, n.masterAddr(), net, n.Sback)
serveWG.Go(func(ctx context.Context) error { serveWG.Go(func(ctx context.Context) error {
return n.S.Run(ctx, n.Sl) return n.S.Run(ctx, n.Sl)
}) })
...@@ -320,12 +313,12 @@ func (n *NEOGoSrv) Close() (err error) { ...@@ -320,12 +313,12 @@ func (n *NEOGoSrv) Close() (err error) {
return err return err
} }
func (n *NEOGoSrv) MasterAddr() string { func (n *NEOGoSrv) masterAddr() string {
return n.Ml.Addr().String() return n.Ml.Addr().String()
} }
func (n *NEOGoSrv) URL() string { func (n *NEOGoSrv) URL() string {
return fmt.Sprintf("%s%s/%s", n.opt.URLPrefix(), n.MasterAddr(), n.opt.name) return fmt.Sprintf("%s%s/%s", n.opt.URLPrefix(), n.masterAddr(), n.opt.name)
} }
...@@ -419,7 +412,7 @@ func withNEOSrv(t *testing.T, f func(t *testing.T, nsrv NEOSrv), optv ...tOption ...@@ -419,7 +412,7 @@ func withNEOSrv(t *testing.T, f func(t *testing.T, nsrv NEOSrv), optv ...tOption
cmd := exec.Command("python", "-c", cmd := exec.Command("python", "-c",
"from neo.scripts.neomigrate import main; main()", "from neo.scripts.neomigrate import main; main()",
"-q", "-q",
"-c", npy.ClusterName(), "-c", npy.clusterName(),
) )
if ssl { if ssl {
cmd.Args = append(cmd.Args, "--ca", neoOpt.CA()) cmd.Args = append(cmd.Args, "--ca", neoOpt.CA())
...@@ -428,7 +421,7 @@ func withNEOSrv(t *testing.T, f func(t *testing.T, nsrv NEOSrv), optv ...tOption ...@@ -428,7 +421,7 @@ func withNEOSrv(t *testing.T, f func(t *testing.T, nsrv NEOSrv), optv ...tOption
} }
cmd.Args = append(cmd.Args, cmd.Args = append(cmd.Args,
opt.Preload, opt.Preload,
npy.MasterAddr(), npy.masterAddr,
) )
cmd.Stdin = nil cmd.Stdin = nil
cmd.Stdout = os.Stdout cmd.Stdout = os.Stdout
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment