diff --git a/.gitignore b/.gitignore index 97304e8..cf8cf67 100644 --- a/.gitignore +++ b/.gitignore @@ -29,4 +29,7 @@ bnaries for programs and plugins *.log # wsdb -wsdb \ No newline at end of file +wsdb + +# vendor +vendor/ diff --git a/README.md b/README.md index 3047e9c..154a421 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ ### 1. Installation Go-SDK ```bash -go get -u github.com/it-chain/sdk +go get -u github.com/DE-labtory/sdk ``` @@ -59,7 +59,7 @@ your icode need to implement this interface. - Parse -p flag for port in main ( The port is used to create the ibox. ) -ICode need port for interact with it-chain engine. [tesseract](https://github.com/it-chain/tesseract) will give port using -p flag. +ICode need port for interact with it-chain engine. [tesseract](https://github.com/DE-labtory/tesseract) will give port using -p flag. So your icode need to parse -p flag for port. @@ -119,7 +119,7 @@ if you use any library in your icode, you must make [vendor](https://golang.org/ ## Sample Icode -You can refer sample icode in https://github.com/it-chain/sdk/blob/master/example +You can refer sample icode in https://github.com/DE-labtory/sdk/blob/master/example diff --git a/cell.go b/cell.go index 03eccea..81c3b39 100644 --- a/cell.go +++ b/cell.go @@ -1,5 +1,5 @@ /* - * Copyright 2018 It-chain + * Copyright 2018 DE-labtory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,7 @@ package sdk -import "github.com/it-chain/leveldb-wrapper" +import leveldbwrapper "github.com/DE-labtory/leveldb-wrapper" type Cell struct { DBHandler *leveldbwrapper.DBHandle diff --git a/example/handler/handler.go b/example/handler/handler.go index c04633c..6e48798 100644 --- a/example/handler/handler.go +++ b/example/handler/handler.go @@ -1,5 +1,5 @@ /* - * Copyright 2018 It-chain + * Copyright 2018 DE-labtory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,9 +24,9 @@ import ( "fmt" - "github.com/it-chain/sdk" - "github.com/it-chain/sdk/logger" - "github.com/it-chain/sdk/pb" + "github.com/DE-labtory/sdk" + "github.com/DE-labtory/sdk/logger" + "github.com/DE-labtory/sdk/pb" ) type HandlerExample struct { diff --git a/example/icode.go b/example/icode.go index ea9271b..16efbee 100644 --- a/example/icode.go +++ b/example/icode.go @@ -1,5 +1,5 @@ /* - * Copyright 2018 It-chain + * Copyright 2018 DE-labtory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,9 +20,9 @@ package main import ( "os" - "github.com/it-chain/sdk" - "github.com/it-chain/sdk/example/handler" - "github.com/it-chain/sdk/logger" + "github.com/DE-labtory/sdk" + "github.com/DE-labtory/sdk/example/handler" + "github.com/DE-labtory/sdk/logger" "github.com/jessevdk/go-flags" ) diff --git a/example/icode_test.go b/example/icode_test.go index 6033dac..2ef013f 100644 --- a/example/icode_test.go +++ b/example/icode_test.go @@ -1,5 +1,5 @@ /* - * Copyright 2018 It-chain + * Copyright 2018 DE-labtory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,10 +27,10 @@ import ( "sync" - "github.com/it-chain/sdk" - "github.com/it-chain/sdk/example/handler" - "github.com/it-chain/sdk/logger" - "github.com/it-chain/sdk/pb" + "github.com/DE-labtory/sdk" + "github.com/DE-labtory/sdk/example/handler" + "github.com/DE-labtory/sdk/logger" + "github.com/DE-labtory/sdk/pb" "github.com/stretchr/testify/assert" "google.golang.org/grpc" ) diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..b80c436 --- /dev/null +++ b/go.mod @@ -0,0 +1,11 @@ +module github.com/DE-labtory/sdk + +require ( + github.com/DE-labtory/leveldb-wrapper v0.0.0-20190307144420-061fb8638c2d + github.com/golang/protobuf v1.3.0 + github.com/jessevdk/go-flags v1.4.0 + github.com/sirupsen/logrus v1.3.0 + github.com/stretchr/testify v1.3.0 + golang.org/x/net v0.0.0-20190301231341-16b79f2e4e95 + google.golang.org/grpc v1.19.0 +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..e6b0fc5 --- /dev/null +++ b/go.sum @@ -0,0 +1,62 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/DE-labtory/leveldb-wrapper v0.0.0-20190307144420-061fb8638c2d h1:u9OGmyODO3z15CB9xDzNoMKeBGuLQB1PFJ7po15bg8I= +github.com/DE-labtory/leveldb-wrapper v0.0.0-20190307144420-061fb8638c2d/go.mod h1:bJrIZeTnjz7fQyuOeotV+vc3UOWw7udSAJZa8CNWBzA= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.0 h1:kbxbvI4Un1LUWKxufD+BiE6AEExYYgkQLQmLFqA1LFk= +github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= +github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db h1:woRePGFeVFfLKN/pOkfl+p/TAqKOfFu+7KPlMVpok/w= +github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA= +github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/sirupsen/logrus v1.3.0 h1:hI/7Q+DtNZ2kINb6qt/lS+IyXnHQe9e90POfeewL/ME= +github.com/sirupsen/logrus v1.3.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/syndtr/goleveldb v1.0.0 h1:fBdIW9lB4Iz0n9khmH8w27SJ3QEJ7+IgjPEwGSZiFdE= +github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793 h1:u+LnwYTOOW7Ukr/fppxEb1Nwz0AtPflrblfvUudpo+I= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190301231341-16b79f2e4e95 h1:fY7Dsw114eJN4boqzVSbpVHO6rTdhq6/GnXeu+PKnzU= +golang.org/x/net v0.0.0-20190301231341-16b79f2e4e95/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e h1:o3PsSEY8E4eXWkXrIP9YJALUkVZqzHJT5DOasTyn8Vs= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20180831171423-11092d34479b h1:lohp5blsw53GBXtLyLNaTXPXS9pJ1tiTw61ZHUoE9Qw= +google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/grpc v1.19.0 h1:cfg4PD8YEdSFnm7qLV4++93WcmhH2nIUhMjhdCvl3j8= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/handler.go b/handler.go index 8adc83a..c13f83d 100644 --- a/handler.go +++ b/handler.go @@ -1,5 +1,5 @@ /* - * Copyright 2018 It-chain + * Copyright 2018 DE-labtory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,7 @@ package sdk -import "github.com/it-chain/sdk/pb" +import "github.com/DE-labtory/sdk/pb" type RequestHandler interface { Name() string diff --git a/ibox.go b/ibox.go index 5d9f51c..be53b2a 100644 --- a/ibox.go +++ b/ibox.go @@ -1,5 +1,5 @@ /* - * Copyright 2018 It-chain + * Copyright 2018 DE-labtory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,8 +20,8 @@ package sdk import ( "os" - "github.com/it-chain/sdk/logger" - "github.com/it-chain/sdk/pb" + "github.com/DE-labtory/sdk/logger" + "github.com/DE-labtory/sdk/pb" ) type IBox struct { diff --git a/logger/log_wrapper.go b/logger/log_wrapper.go index 134cc7f..6ae79a4 100644 --- a/logger/log_wrapper.go +++ b/logger/log_wrapper.go @@ -1,5 +1,5 @@ /* - * Copyright 2018 It-chain + * Copyright 2018 DE-labtory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/pb/extension.go b/pb/extension.go index 4d72b5f..5b1eb8d 100644 --- a/pb/extension.go +++ b/pb/extension.go @@ -1,5 +1,5 @@ /* - * Copyright 2018 It-chain + * Copyright 2018 DE-labtory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/server_stream.go b/server_stream.go index 92172b8..0ccbe40 100644 --- a/server_stream.go +++ b/server_stream.go @@ -1,5 +1,5 @@ /* - * Copyright 2018 It-chain + * Copyright 2018 DE-labtory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,7 +23,7 @@ import ( "net" "time" - "github.com/it-chain/sdk/pb" + "github.com/DE-labtory/sdk/pb" "google.golang.org/grpc" ) diff --git a/server_stream_test.go b/server_stream_test.go index 13770ed..c6cd027 100644 --- a/server_stream_test.go +++ b/server_stream_test.go @@ -1,5 +1,5 @@ /* - * Copyright 2018 It-chain + * Copyright 2018 DE-labtory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,8 +27,8 @@ import ( "strconv" - "github.com/it-chain/sdk" - "github.com/it-chain/sdk/pb" + "github.com/DE-labtory/sdk" + "github.com/DE-labtory/sdk/pb" "github.com/stretchr/testify/assert" "google.golang.org/grpc" )