Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Move go library parts into lib dir
  • Loading branch information
Markus Herpich committed Apr 16, 2019
1 parent 545a168 commit 1eb5e93
Show file tree
Hide file tree
Showing 130 changed files with 166 additions and 167 deletions.
8 changes: 4 additions & 4 deletions Makefile
Expand Up @@ -13,7 +13,7 @@ GO_MODULE_PKGS := $(shell go list ./... | grep /module | grep -v /vendor)
GO_PKGS := $(shell go list ./... | grep -v /module | grep -v /vendor)

# those are intended to be a recursively expanded variables
GO_SRCS = $(shell find modules -name '*.go') $(shell find pkg -name '*.go')
GO_SRCS = $(shell find . -name '*.go')
FILTER = $(foreach v,$(2),$(if $(findstring $(1),$(v)),$(v),))
GO_MODULE_SRCS = $(call FILTER,module,$(GO_SRCS))

Expand Down Expand Up @@ -62,7 +62,7 @@ cleanall: clean
@touch .go_module_test

.go_qmstr_test: $(GO_SRCS)
go test ./cmd/... ./pkg/...
go test ./clients/... ./lib/go-qmstr/...
@touch .go_qmstr_test

.PHONY: gotest
Expand All @@ -78,7 +78,7 @@ golint: $(GOMETALINTER)

.PHONY: govet
govet: gotest
go tool vet cmd pkg
go vet ./lib/go-qmstr/wrapper/

install_qmstr_server: $(QMSTR_SERVER_BINARIES)
cp $^ /usr/local/bin
Expand All @@ -91,7 +91,7 @@ install_qmstr_all: install_qmstr_client install_qmstr_server
install_qmstr_client_gopath: $(QMSTR_CLIENT_BINARIES)
cp $^ ${GO_PATH}/bin/

pkg/service/%.pb.go: $(PROTOC_GEN_GO) proto/%.proto
lib/go-qmstr/service/%.pb.go: $(PROTOC_GEN_GO) proto/%.proto
protoc -I proto --go_out=plugins=grpc:pkg/service proto/*.proto

# Python related stuff
Expand Down
4 changes: 2 additions & 2 deletions clients/qmstr/qmstr.go
Expand Up @@ -16,8 +16,8 @@ import (
"github.com/docker/docker/api/types/mount"
"github.com/docker/docker/client"

"github.com/QMSTR/qmstr/pkg/common"
"github.com/QMSTR/qmstr/pkg/docker"
"github.com/QMSTR/qmstr/lib/go-qmstr/common"
"github.com/QMSTR/qmstr/lib/go-qmstr/docker"

flag "github.com/spf13/pflag"
)
Expand Down
2 changes: 1 addition & 1 deletion clients/qmstrctl/qmstrctl.go
Expand Up @@ -4,7 +4,7 @@ import (
"os"
"strings"

"github.com/QMSTR/qmstr/pkg/cli"
"github.com/QMSTR/qmstr/lib/go-qmstr/cli"
)

var fixableCommands = map[string]struct{}{"create": struct{}{}, "update": struct{}{}}
Expand Down
Expand Up @@ -9,7 +9,7 @@ import (

goflag "flag"

"github.com/QMSTR/qmstr/pkg/service"
"github.com/QMSTR/qmstr/lib/go-qmstr/service"
flag "github.com/spf13/pflag"
"google.golang.org/grpc"
)
Expand Down
Expand Up @@ -9,9 +9,9 @@ import (
"regexp"
"strings"

"github.com/QMSTR/qmstr/pkg/builder"
"github.com/QMSTR/qmstr/pkg/common"
"github.com/QMSTR/qmstr/pkg/service"
"github.com/QMSTR/qmstr/lib/go-qmstr/builder"
"github.com/QMSTR/qmstr/lib/go-qmstr/common"
"github.com/QMSTR/qmstr/lib/go-qmstr/service"
)

type command int
Expand Down
Expand Up @@ -5,7 +5,7 @@ import (
"os"
"testing"

"github.com/QMSTR/qmstr/pkg/arbuilder"
"github.com/QMSTR/qmstr/lib/go-qmstr/arbuilder"
)

func getTestBuilder() *arbuilder.ArBuilder {
Expand Down
4 changes: 2 additions & 2 deletions pkg/builder/builder.go → lib/go-qmstr/builder/builder.go
Expand Up @@ -7,8 +7,8 @@ import (
"github.com/pkg/errors"
"github.com/spf13/afero"

"github.com/QMSTR/qmstr/pkg/common"
"github.com/QMSTR/qmstr/pkg/service"
"github.com/QMSTR/qmstr/lib/go-qmstr/common"
"github.com/QMSTR/qmstr/lib/go-qmstr/service"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/add-graph.go → lib/go-qmstr/cli/add-graph.go
Expand Up @@ -6,7 +6,7 @@ import (
"log"
"os"

"github.com/QMSTR/qmstr/pkg/service"
"github.com/QMSTR/qmstr/lib/go-qmstr/service"
"github.com/spf13/cobra"
"golang.org/x/net/context"
yaml "gopkg.in/yaml.v2"
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion pkg/cli/common.go → lib/go-qmstr/cli/common.go
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"reflect"

"github.com/QMSTR/qmstr/pkg/service"
"github.com/QMSTR/qmstr/lib/go-qmstr/service"
"golang.org/x/net/context"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/connect.go → lib/go-qmstr/cli/connect.go
Expand Up @@ -3,7 +3,7 @@ package cli
import (
"fmt"

"github.com/QMSTR/qmstr/pkg/service"
"github.com/QMSTR/qmstr/lib/go-qmstr/service"
"github.com/spf13/cobra"
"golang.org/x/net/context"
)
Expand Down
4 changes: 2 additions & 2 deletions pkg/cli/copy.go → lib/go-qmstr/cli/copy.go
Expand Up @@ -5,8 +5,8 @@ import (
"os"
"path/filepath"

"github.com/QMSTR/qmstr/pkg/config"
"github.com/QMSTR/qmstr/pkg/docker"
"github.com/QMSTR/qmstr/lib/go-qmstr/config"
"github.com/QMSTR/qmstr/lib/go-qmstr/docker"
"github.com/docker/docker/client"

"golang.org/x/net/context"
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/create.go → lib/go-qmstr/cli/create.go
Expand Up @@ -5,7 +5,7 @@ import (
"log"
"reflect"

"github.com/QMSTR/qmstr/pkg/service"
"github.com/QMSTR/qmstr/lib/go-qmstr/service"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"golang.org/x/net/context"
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/create_test.go → lib/go-qmstr/cli/create_test.go
Expand Up @@ -4,7 +4,7 @@ import (
"log"
"testing"

"github.com/QMSTR/qmstr/pkg/service"
"github.com/QMSTR/qmstr/lib/go-qmstr/service"
"github.com/spf13/pflag"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/delete.go → lib/go-qmstr/cli/delete.go
Expand Up @@ -4,7 +4,7 @@ import (
"errors"
"fmt"

"github.com/QMSTR/qmstr/pkg/service"
"github.com/QMSTR/qmstr/lib/go-qmstr/service"
"github.com/spf13/cobra"
"golang.org/x/net/context"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/describe.go → lib/go-qmstr/cli/describe.go
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"io"

"github.com/QMSTR/qmstr/pkg/service"
"github.com/QMSTR/qmstr/lib/go-qmstr/service"
"github.com/spf13/cobra"
"golang.org/x/net/context"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/disconnect.go → lib/go-qmstr/cli/disconnect.go
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"reflect"

"github.com/QMSTR/qmstr/pkg/service"
"github.com/QMSTR/qmstr/lib/go-qmstr/service"
"github.com/spf13/cobra"
"golang.org/x/net/context"
)
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion pkg/cli/idparsing.go → lib/go-qmstr/cli/idparsing.go
Expand Up @@ -7,7 +7,7 @@ import (
"strconv"
"strings"

"github.com/QMSTR/qmstr/pkg/service"
"github.com/QMSTR/qmstr/lib/go-qmstr/service"
)

var ErrEmptyNodeIdent = errors.New("Empty node identifier")
Expand Down
Expand Up @@ -5,7 +5,7 @@ import (
"strconv"
"testing"

"github.com/QMSTR/qmstr/pkg/service"
"github.com/QMSTR/qmstr/lib/go-qmstr/service"
)

func TestInvalidIdentifier(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/log.go → lib/go-qmstr/cli/log.go
Expand Up @@ -4,7 +4,7 @@ import (
"bufio"
"fmt"

"github.com/QMSTR/qmstr/pkg/docker"
"github.com/QMSTR/qmstr/lib/go-qmstr/docker"
"github.com/docker/docker/api/types"
"github.com/docker/docker/client"
"github.com/spf13/cobra"
Expand Down
Expand Up @@ -6,7 +6,7 @@ import (

"golang.org/x/net/context"

"github.com/QMSTR/qmstr/pkg/service"
"github.com/QMSTR/qmstr/lib/go-qmstr/service"
"github.com/spf13/cobra"
)

Expand Down
4 changes: 2 additions & 2 deletions pkg/cli/quit.go → lib/go-qmstr/cli/quit.go
Expand Up @@ -5,12 +5,12 @@ import (
"os"
"time"

"github.com/QMSTR/qmstr/pkg/docker"
"github.com/QMSTR/qmstr/lib/go-qmstr/docker"
"github.com/docker/docker/client"

"golang.org/x/net/context"

pb "github.com/QMSTR/qmstr/pkg/service"
pb "github.com/QMSTR/qmstr/lib/go-qmstr/service"
"github.com/spf13/cobra"
)

Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions pkg/cli/root.go → lib/go-qmstr/cli/root.go
Expand Up @@ -6,8 +6,8 @@ import (
golog "log" // avoid having "log" in the namespace
"os"

"github.com/QMSTR/qmstr/pkg/logging"
"github.com/QMSTR/qmstr/pkg/service"
"github.com/QMSTR/qmstr/lib/go-qmstr/logging"
"github.com/QMSTR/qmstr/lib/go-qmstr/service"
"github.com/spf13/cobra"
"google.golang.org/grpc"
)
Expand Down
6 changes: 3 additions & 3 deletions pkg/cli/snapshot.go → lib/go-qmstr/cli/snapshot.go
Expand Up @@ -4,9 +4,9 @@ import (
"fmt"
"os"

"github.com/QMSTR/qmstr/pkg/common"
"github.com/QMSTR/qmstr/pkg/docker"
"github.com/QMSTR/qmstr/pkg/service"
"github.com/QMSTR/qmstr/lib/go-qmstr/common"
"github.com/QMSTR/qmstr/lib/go-qmstr/docker"
"github.com/QMSTR/qmstr/lib/go-qmstr/service"
"github.com/docker/docker/client"
"github.com/spf13/cobra"
"golang.org/x/net/context"
Expand Down
8 changes: 4 additions & 4 deletions pkg/cli/start.go → lib/go-qmstr/cli/start.go
Expand Up @@ -12,11 +12,11 @@ import (
"strings"
"time"

"github.com/QMSTR/qmstr/pkg/common"
"github.com/QMSTR/qmstr/pkg/master"
"github.com/QMSTR/qmstr/lib/go-qmstr/common"
"github.com/QMSTR/qmstr/lib/go-qmstr/master"

"github.com/QMSTR/qmstr/pkg/config"
"github.com/QMSTR/qmstr/pkg/docker"
"github.com/QMSTR/qmstr/lib/go-qmstr/config"
"github.com/QMSTR/qmstr/lib/go-qmstr/docker"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/filters"
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/status.go → lib/go-qmstr/cli/status.go
Expand Up @@ -4,7 +4,7 @@ import (
"io"
"os"

"github.com/QMSTR/qmstr/pkg/service"
"github.com/QMSTR/qmstr/lib/go-qmstr/service"
"github.com/spf13/cobra"
"golang.org/x/net/context"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/update.go → lib/go-qmstr/cli/update.go
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"log"

"github.com/QMSTR/qmstr/pkg/service"
"github.com/QMSTR/qmstr/lib/go-qmstr/service"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"golang.org/x/net/context"
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion pkg/cli/wait.go → lib/go-qmstr/cli/wait.go
Expand Up @@ -4,7 +4,7 @@ import (
"os"
"time"

"github.com/QMSTR/qmstr/pkg/service"
"github.com/QMSTR/qmstr/lib/go-qmstr/service"
"github.com/spf13/cobra"
"golang.org/x/net/context"
)
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions pkg/common/fileutil.go → lib/go-qmstr/common/fileutil.go
Expand Up @@ -10,8 +10,8 @@ import (
"regexp"
"strings"

"github.com/QMSTR/qmstr/pkg/database"
"github.com/QMSTR/qmstr/pkg/service"
"github.com/QMSTR/qmstr/lib/go-qmstr/database"
"github.com/QMSTR/qmstr/lib/go-qmstr/service"
)

var nonPosixChars = regexp.MustCompile(`[^A-Za-z0-9\._-]`)
Expand Down
Expand Up @@ -4,7 +4,7 @@ import (
"log"
"testing"

"github.com/QMSTR/qmstr/pkg/common"
"github.com/QMSTR/qmstr/lib/go-qmstr/common"
"github.com/spf13/afero"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/config/config.go → lib/go-qmstr/config/config.go
Expand Up @@ -7,7 +7,7 @@ import (
"log"
"os"

"github.com/QMSTR/qmstr/pkg/service"
"github.com/QMSTR/qmstr/lib/go-qmstr/service"
yaml "gopkg.in/yaml.v2"
)

Expand Down
File renamed without changes.
Expand Up @@ -6,7 +6,7 @@ import (
"reflect"
"strings"

"github.com/QMSTR/qmstr/pkg/common"
"github.com/QMSTR/qmstr/lib/go-qmstr/common"
)

func validateConfig(configuration *MasterConfig) error {
Expand Down
@@ -1,6 +1,6 @@
package database

import "github.com/QMSTR/qmstr/pkg/service"
import "github.com/QMSTR/qmstr/lib/go-qmstr/service"

func (db *DataBase) GetAnalyzerByName(name string) (*service.Analyzer, error) {
var ret map[string][]*service.Analyzer
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion pkg/database/dgraph.go → lib/go-qmstr/database/dgraph.go
Expand Up @@ -16,7 +16,7 @@ import (

"encoding/json"

"github.com/QMSTR/qmstr/pkg/service"
"github.com/QMSTR/qmstr/lib/go-qmstr/service"
client "github.com/dgraph-io/dgo"
"github.com/dgraph-io/dgo/protos/api"

Expand Down
Expand Up @@ -3,7 +3,7 @@ package database
import (
"testing"

"github.com/QMSTR/qmstr/pkg/service"
"github.com/QMSTR/qmstr/lib/go-qmstr/service"
)

func TestVarNameCalculation(t *testing.T) {
Expand Down
Expand Up @@ -9,7 +9,7 @@ import (
"strconv"
"text/template"

"github.com/QMSTR/qmstr/pkg/service"
"github.com/QMSTR/qmstr/lib/go-qmstr/service"
)

// AddDiagnosticNodes stores the given DiagnosticNodes in a PackageNode or FileNode identified by the nodeID
Expand Down
Expand Up @@ -11,7 +11,7 @@ import (
"sync/atomic"
"text/template"

"github.com/QMSTR/qmstr/pkg/service"
"github.com/QMSTR/qmstr/lib/go-qmstr/service"
)

// AddBuildFileNode adds a node to the insert queue in build phase
Expand Down
Expand Up @@ -8,7 +8,7 @@ import (
"log"
"text/template"

"github.com/QMSTR/qmstr/pkg/service"
"github.com/QMSTR/qmstr/lib/go-qmstr/service"
)

// AddInfoNodes stores the given InfoNodes in a PackageNode or FileNode identified by the nodeID
Expand Down
Expand Up @@ -7,7 +7,7 @@ import (
"log"
"sync/atomic"

"github.com/QMSTR/qmstr/pkg/service"
"github.com/QMSTR/qmstr/lib/go-qmstr/service"
)

var ErrNoSuchPackage = errors.New("no such package")
Expand Down

0 comments on commit 1eb5e93

Please sign in to comment.