Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
neoppod
Commits
5c660da3
Commit
5c660da3
authored
Jun 19, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
X . (non-local imports finish)
parent
da44885f
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
54 additions
and
34 deletions
+54
-34
go/neo/connection_test.go
go/neo/connection_test.go
+1
-1
go/neo/proto-marshal.go
go/neo/proto-marshal.go
+1
-1
go/neo/proto.go
go/neo/proto.go
+1
-1
go/neo/proto_test.go
go/neo/proto_test.go
+1
-1
go/neo/protogen.go
go/neo/protogen.go
+32
-12
go/neo/server/cluster_test.go
go/neo/server/cluster_test.go
+9
-9
go/neo/x_connection.go
go/neo/x_connection.go
+1
-1
go/xcommon/xnet/pipenet/pipenet_test.go
go/xcommon/xnet/pipenet/pipenet_test.go
+1
-1
go/zodb/storage/fs1/filestorage_test.go
go/zodb/storage/fs1/filestorage_test.go
+1
-1
go/zodb/storage/fs1/index_test.go
go/zodb/storage/fs1/index_test.go
+2
-2
go/zodb/storage/fs1/py/gen-testdata
go/zodb/storage/fs1/py/gen-testdata
+1
-1
go/zodb/storage/fs1/testdata_expect_test.go
go/zodb/storage/fs1/testdata_expect_test.go
+1
-1
go/zodb/zodbtools/dump_test.go
go/zodb/zodbtools/dump_test.go
+2
-2
No files found.
go/neo/connection_test.go
View file @
5c660da3
...
@@ -26,7 +26,7 @@ import (
...
@@ -26,7 +26,7 @@ import (
"testing"
"testing"
"time"
"time"
"
..
/xcommon/xsync"
"
lab.nexedi.com/kirr/neo/go
/xcommon/xsync"
"lab.nexedi.com/kirr/go123/exc"
"lab.nexedi.com/kirr/go123/exc"
"lab.nexedi.com/kirr/go123/xerr"
"lab.nexedi.com/kirr/go123/xerr"
...
...
go/neo/proto-marshal.go
View file @
5c660da3
...
@@ -7,7 +7,7 @@ import (
...
@@ -7,7 +7,7 @@ import (
"reflect"
"reflect"
"sort"
"sort"
"
..
/zodb"
"
lab.nexedi.com/kirr/neo/go
/zodb"
)
)
// messages marshalling
// messages marshalling
...
...
go/neo/proto.go
View file @
5c660da3
...
@@ -13,7 +13,7 @@ package neo
...
@@ -13,7 +13,7 @@ package neo
// XXX move imports out of here
// XXX move imports out of here
import
(
import
(
"
..
/zodb"
"
lab.nexedi.com/kirr/neo/go
/zodb"
"encoding/binary"
"encoding/binary"
"errors"
"errors"
...
...
go/neo/proto_test.go
View file @
5c660da3
...
@@ -28,7 +28,7 @@ import (
...
@@ -28,7 +28,7 @@ import (
"testing"
"testing"
"unsafe"
"unsafe"
"
..
/zodb"
"
lab.nexedi.com/kirr/neo/go
/zodb"
)
)
// decode string as hex; panic on error
// decode string as hex; panic on error
...
...
go/neo/protogen.go
View file @
5c660da3
...
@@ -77,7 +77,7 @@ import (
...
@@ -77,7 +77,7 @@ import (
// parsed & typechecked input
// parsed & typechecked input
var
fset
=
token
.
NewFileSet
()
var
fset
=
token
.
NewFileSet
()
var
fileMap
=
map
[
string
]
*
ast
.
File
{}
// fileName -> AST
var
fileMap
=
map
[
string
]
*
ast
.
File
{}
// fileName -> AST
var
pkgMap
=
map
[
string
]
*
types
.
Package
{}
// pkg
Name
-> Package
var
pkgMap
=
map
[
string
]
*
types
.
Package
{}
// pkg
Path
-> Package
var
typeInfo
=
&
types
.
Info
{
var
typeInfo
=
&
types
.
Info
{
Types
:
make
(
map
[
ast
.
Expr
]
types
.
TypeAndValue
),
Types
:
make
(
map
[
ast
.
Expr
]
types
.
TypeAndValue
),
Defs
:
make
(
map
[
*
ast
.
Ident
]
types
.
Object
),
Defs
:
make
(
map
[
*
ast
.
Ident
]
types
.
Object
),
...
@@ -88,10 +88,30 @@ func pos(x interface { Pos() token.Pos }) token.Position {
...
@@ -88,10 +88,30 @@ func pos(x interface { Pos() token.Pos }) token.Position {
return
fset
.
Position
(
x
.
Pos
())
return
fset
.
Position
(
x
.
Pos
())
}
}
// get type name relative to neo package
// get type name in context of neo package
var
neoQualifier
types
.
Qualifier
var
(
zodbPkg
*
types
.
Package
neoPkg
*
types
.
Package
)
func
typeName
(
typ
types
.
Type
)
string
{
func
typeName
(
typ
types
.
Type
)
string
{
return
types
.
TypeString
(
typ
,
neoQualifier
)
qf
:=
func
(
pkg
*
types
.
Package
)
string
{
switch
pkg
{
case
neoPkg
:
// same package - unqualified
return
""
case
zodbPkg
:
// zodb is imported - only name
return
pkg
.
Name
()
default
:
// fully qualified otherwise
return
pkg
.
Path
()
}
}
return
types
.
TypeString
(
typ
,
qf
)
}
}
// bytes.Buffer + bell & whistles
// bytes.Buffer + bell & whistles
...
@@ -110,8 +130,9 @@ type localImporter struct {
...
@@ -110,8 +130,9 @@ type localImporter struct {
}
}
func
(
li
*
localImporter
)
Import
(
path
string
)
(
*
types
.
Package
,
error
)
{
func
(
li
*
localImporter
)
Import
(
path
string
)
(
*
types
.
Package
,
error
)
{
xpath
:=
strings
.
TrimPrefix
(
path
,
"../"
)
// ../zodb -> zodb
// xpath := strings.TrimPrefix(path, "../") // ../zodb -> zodb
pkg
:=
pkgMap
[
xpath
]
// pkg := pkgMap[xpath]
pkg
:=
pkgMap
[
path
]
if
pkg
!=
nil
{
if
pkg
!=
nil
{
return
pkg
,
nil
return
pkg
,
nil
}
}
...
@@ -119,7 +140,7 @@ func (li *localImporter) Import(path string) (*types.Package, error) {
...
@@ -119,7 +140,7 @@ func (li *localImporter) Import(path string) (*types.Package, error) {
return
li
.
Importer
.
Import
(
path
)
return
li
.
Importer
.
Import
(
path
)
}
}
func
loadPkg
(
pkg
Name
string
,
sources
...
string
)
*
types
.
Package
{
func
loadPkg
(
pkg
Path
string
,
sources
...
string
)
*
types
.
Package
{
var
filev
[]
*
ast
.
File
var
filev
[]
*
ast
.
File
// parse
// parse
...
@@ -137,11 +158,11 @@ func loadPkg(pkgName string, sources ...string) *types.Package {
...
@@ -137,11 +158,11 @@ func loadPkg(pkgName string, sources ...string) *types.Package {
// typecheck
// typecheck
conf
:=
types
.
Config
{
Importer
:
&
localImporter
{
importer
.
Default
()}}
conf
:=
types
.
Config
{
Importer
:
&
localImporter
{
importer
.
Default
()}}
pkg
,
err
:=
conf
.
Check
(
pkg
Name
,
fset
,
filev
,
typeInfo
)
pkg
,
err
:=
conf
.
Check
(
pkg
Path
,
fset
,
filev
,
typeInfo
)
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Fatalf
(
"typecheck: %v"
,
err
)
log
.
Fatalf
(
"typecheck: %v"
,
err
)
}
}
pkgMap
[
pkg
Name
]
=
pkg
pkgMap
[
pkg
Path
]
=
pkg
return
pkg
return
pkg
}
}
...
@@ -151,9 +172,8 @@ func main() {
...
@@ -151,9 +172,8 @@ func main() {
log
.
SetFlags
(
0
)
log
.
SetFlags
(
0
)
// go through proto.go and AST'ify & typecheck it
// go through proto.go and AST'ify & typecheck it
loadPkg
(
"zodb"
,
"../zodb/zodb.go"
)
zodbPkg
=
loadPkg
(
"lab.nexedi.com/kirr/neo/go/zodb"
,
"../zodb/zodb.go"
)
loadPkg
(
"neo"
,
"proto.go"
,
"neo.go"
)
neoPkg
=
loadPkg
(
"lab.nexedi.com/kirr/neo/go/neo"
,
"proto.go"
,
"neo.go"
)
neoQualifier
=
types
.
RelativeTo
(
pkgMap
[
"neo"
])
// prologue
// prologue
f
:=
fileMap
[
"proto.go"
]
f
:=
fileMap
[
"proto.go"
]
...
...
go/neo/server/cluster_test.go
View file @
5c660da3
...
@@ -25,17 +25,17 @@ import (
...
@@ -25,17 +25,17 @@ import (
//"reflect"
//"reflect"
"testing"
"testing"
"
../..
/neo"
"
lab.nexedi.com/kirr/neo/go
/neo"
//"
../..
/neo/client"
//"
lab.nexedi.com/kirr/neo/go
/neo/client"
//"
../..
/zodb"
//"
lab.nexedi.com/kirr/neo/go
/zodb"
"
../..
/zodb/storage/fs1"
"
lab.nexedi.com/kirr/neo/go
/zodb/storage/fs1"
"
../..
/xcommon/tracing"
"
lab.nexedi.com/kirr/neo/go
/xcommon/tracing"
"
../..
/xcommon/xnet"
"
lab.nexedi.com/kirr/neo/go
/xcommon/xnet"
"
../..
/xcommon/xnet/pipenet"
"
lab.nexedi.com/kirr/neo/go
/xcommon/xnet/pipenet"
"
../..
/xcommon/xsync"
"
lab.nexedi.com/kirr/neo/go
/xcommon/xsync"
"
../..
/xcommon/xtesting"
"
lab.nexedi.com/kirr/neo/go
/xcommon/xtesting"
"lab.nexedi.com/kirr/go123/exc"
"lab.nexedi.com/kirr/go123/exc"
...
...
go/neo/x_connection.go
View file @
5c660da3
...
@@ -4,7 +4,7 @@ package neo
...
@@ -4,7 +4,7 @@ package neo
import
(
import
(
"fmt"
"fmt"
"
..
/zodb"
"
lab.nexedi.com/kirr/neo/go
/zodb"
"lab.nexedi.com/kirr/go123/xerr"
"lab.nexedi.com/kirr/go123/xerr"
)
)
...
...
go/xcommon/xnet/pipenet/pipenet_test.go
View file @
5c660da3
...
@@ -25,7 +25,7 @@ import (
...
@@ -25,7 +25,7 @@ import (
"reflect"
"reflect"
"testing"
"testing"
"
../../..
/xcommon/xsync"
"
lab.nexedi.com/kirr/neo/go
/xcommon/xsync"
"lab.nexedi.com/kirr/go123/exc"
"lab.nexedi.com/kirr/go123/exc"
)
)
...
...
go/zodb/storage/fs1/filestorage_test.go
View file @
5c660da3
...
@@ -24,7 +24,7 @@ import (
...
@@ -24,7 +24,7 @@ import (
"reflect"
"reflect"
"testing"
"testing"
"
../../..
/zodb"
"
lab.nexedi.com/kirr/neo/go
/zodb"
"lab.nexedi.com/kirr/go123/exc"
"lab.nexedi.com/kirr/go123/exc"
)
)
...
...
go/zodb/storage/fs1/index_test.go
View file @
5c660da3
...
@@ -29,8 +29,8 @@ import (
...
@@ -29,8 +29,8 @@ import (
"strings"
"strings"
"testing"
"testing"
"
../../..
/zodb"
"
lab.nexedi.com/kirr/neo/go
/zodb"
"
.
/fsb"
"
lab.nexedi.com/kirr/neo/go/zodb/storage/fs1
/fsb"
)
)
type
indexEntry
struct
{
type
indexEntry
struct
{
...
...
go/zodb/storage/fs1/py/gen-testdata
View file @
5c660da3
...
@@ -182,7 +182,7 @@ def main():
...
@@ -182,7 +182,7 @@ def main():
print
>>
f
,
v
print
>>
f
,
v
emit
(
"// DO NOT EDIT - AUTOGENERATED (by py/gen-testdata)"
)
emit
(
"// DO NOT EDIT - AUTOGENERATED (by py/gen-testdata)"
)
emit
(
"package fs1
\
n
"
)
emit
(
"package fs1
\
n
"
)
emit
(
"import
\
"
../../..
/zodb
\
"
\
n
"
)
emit
(
"import
\
"
lab.nexedi.com/kirr/neo/go
/zodb
\
"
\
n
"
)
# index
# index
emit
(
"const _1fs_indexTopPos = %i"
%
stor
.
_pos
)
emit
(
"const _1fs_indexTopPos = %i"
%
stor
.
_pos
)
...
...
go/zodb/storage/fs1/testdata_expect_test.go
View file @
5c660da3
// DO NOT EDIT - AUTOGENERATED (by py/gen-testdata)
// DO NOT EDIT - AUTOGENERATED (by py/gen-testdata)
package
fs1
package
fs1
import
"
../../..
/zodb"
import
"
lab.nexedi.com/kirr/neo/go
/zodb"
const
_1fs_indexTopPos
=
12226
const
_1fs_indexTopPos
=
12226
var
_1fs_indexEntryv
=
[
...
]
indexEntry
{
var
_1fs_indexEntryv
=
[
...
]
indexEntry
{
...
...
go/zodb/zodbtools/dump_test.go
View file @
5c660da3
...
@@ -26,8 +26,8 @@ import (
...
@@ -26,8 +26,8 @@ import (
"regexp"
"regexp"
"testing"
"testing"
"
../..
/zodb/storage/fs1"
"
lab.nexedi.com/kirr/neo/go
/zodb/storage/fs1"
"
../..
/zodb"
"
lab.nexedi.com/kirr/neo/go
/zodb"
"github.com/sergi/go-diff/diffmatchpatch"
"github.com/sergi/go-diff/diffmatchpatch"
"lab.nexedi.com/kirr/go123/exc"
"lab.nexedi.com/kirr/go123/exc"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment