Skip to content

Commit

Permalink
move decompressor to internal
Browse files Browse the repository at this point in the history
  • Loading branch information
barakmich committed Apr 16, 2015
1 parent 2b86c28 commit f64df95
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion cayley.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import (
"github.com/google/cayley/db"
"github.com/google/cayley/graph"
"github.com/google/cayley/http"
"github.com/google/cayley/internal"
"github.com/google/cayley/quad"
"github.com/google/cayley/quad/cquads"
"github.com/google/cayley/quad/nquads"
Expand Down Expand Up @@ -286,7 +287,7 @@ func decompressAndLoad(qw graph.QuadWriter, cfg *config.Config, path, typ string
r = res.Body
}

r, err = quad.Decompressor(r)
r, err = internal.Decompressor(r)
if err != nil {
if err == io.EOF {
return nil
Expand Down
3 changes: 2 additions & 1 deletion cayley_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import (
"github.com/google/cayley/config"
"github.com/google/cayley/db"
"github.com/google/cayley/graph"
"github.com/google/cayley/internal"
"github.com/google/cayley/quad"
"github.com/google/cayley/query/gremlin"
)
Expand Down Expand Up @@ -705,7 +706,7 @@ var testDecompressor = []struct {

func TestDecompressor(t *testing.T) {
for _, test := range testDecompressor {
r, err := decompressor(test.input)
r, err := internal.Decompressor(test.input)
if err != test.err {
t.Fatalf("Unexpected error for %s, got:%v expect:%v", test.message, err, test.err)
}
Expand Down
3 changes: 2 additions & 1 deletion http/write.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/barakmich/glog"
"github.com/julienschmidt/httprouter"

"github.com/google/cayley/internal"
"github.com/google/cayley/quad"
"github.com/google/cayley/quad/cquads"
)
Expand Down Expand Up @@ -82,7 +83,7 @@ func (api *API) ServeV1WriteNQuad(w http.ResponseWriter, r *http.Request, params
blockSize = int64(api.config.LoadSize)
}

quadReader, err := quad.Decompressor(formFile)
quadReader, err := internal.Decompressor(formFile)
// TODO(kortschak) Make this configurable from the web UI.
dec := cquads.NewDecoder(quadReader)

Expand Down
2 changes: 1 addition & 1 deletion quad/decompressor.go → internal/decompressor.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package quad
package internal

import (
"bufio"
Expand Down

0 comments on commit f64df95

Please sign in to comment.