cleanup: move packages to top level, change vanity URL

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
Andrea Luzzardi 2021-05-25 16:53:26 -07:00
parent e13153a284
commit af776b8abe
45 changed files with 74 additions and 74 deletions

View File

@ -1,7 +1,7 @@
run:
skip-dirs:
# progressui is a modified 3rd party library from buildkit
- pkg/progressui
- util/progressui
linters:
disable-all: true

View File

@ -38,8 +38,8 @@ lint: shellcheck cuelint golint check-buildkit-version
check-buildkit-version:
@test \
"$(shell grep buildkit ./go.mod | cut -d' ' -f2)" = \
"$(shell grep ' = "v' ./pkg/buildkitd/buildkitd.go | sed -E 's/^.*version.*=.*\"(v.*)\"/\1/' )" \
|| { echo buildkit version mismatch go.mod != pkg/buildkitd/buildkitd.go ; exit 1; }
"$(shell grep ' = "v' ./util/buildkitd/buildkitd.go | sed -E 's/^.*version.*=.*\"(v.*)\"/\1/' )" \
|| { echo buildkit version mismatch go.mod != util/buildkitd/buildkitd.go ; exit 1; }
.PHONY: integration
integration: dagger-debug

View File

@ -23,13 +23,13 @@ import (
"github.com/moby/buildkit/session"
// docker output
"dagger.io/go/pkg/buildkitd"
"dagger.io/go/pkg/progressui"
"go.dagger.io/dagger/util/buildkitd"
"go.dagger.io/dagger/util/progressui"
"dagger.io/go/dagger/compiler"
"dagger.io/go/dagger/environment"
"dagger.io/go/dagger/solver"
"dagger.io/go/dagger/state"
"go.dagger.io/dagger/compiler"
"go.dagger.io/dagger/environment"
"go.dagger.io/dagger/solver"
"go.dagger.io/dagger/state"
)
// A dagger client
@ -64,10 +64,10 @@ func New(ctx context.Context, host string, noCache bool) (*Client, error) {
}, nil
}
type ClientDoFunc func(context.Context, *environment.Environment, solver.Solver) error
type DoFunc func(context.Context, *environment.Environment, solver.Solver) error
// FIXME: return completed *Route, instead of *compiler.Value
func (c *Client) Do(ctx context.Context, state *state.State, fn ClientDoFunc) (*environment.Environment, error) {
func (c *Client) Do(ctx context.Context, state *state.State, fn DoFunc) (*environment.Environment, error) {
lg := log.Ctx(ctx)
eg, gctx := errgroup.WithContext(ctx)
@ -93,7 +93,7 @@ func (c *Client) Do(ctx context.Context, state *state.State, fn ClientDoFunc) (*
return environment, eg.Wait()
}
func (c *Client) buildfn(ctx context.Context, env *environment.Environment, fn ClientDoFunc, ch chan *bk.SolveStatus) error {
func (c *Client) buildfn(ctx context.Context, env *environment.Environment, fn DoFunc, ch chan *bk.SolveStatus) error {
lg := log.Ctx(ctx)
// Scan local dirs to grant access

View File

@ -3,12 +3,12 @@ package common
import (
"context"
"dagger.io/go/dagger/client"
"dagger.io/go/dagger/environment"
"dagger.io/go/dagger/solver"
"dagger.io/go/dagger/state"
"github.com/rs/zerolog/log"
"github.com/spf13/viper"
"go.dagger.io/dagger/client"
"go.dagger.io/dagger/environment"
"go.dagger.io/dagger/solver"
"go.dagger.io/dagger/state"
)
func CurrentWorkspace(ctx context.Context) *state.Workspace {

View File

@ -8,10 +8,10 @@ import (
"strings"
"cuelang.org/go/cue"
"dagger.io/go/cmd/dagger/cmd/common"
"dagger.io/go/cmd/dagger/logger"
"dagger.io/go/dagger/compiler"
"dagger.io/go/dagger/state"
"go.dagger.io/dagger/cmd/dagger/cmd/common"
"go.dagger.io/dagger/cmd/dagger/logger"
"go.dagger.io/dagger/compiler"
"go.dagger.io/dagger/state"
"go.mozilla.org/sops/v3"
"go.mozilla.org/sops/v3/decrypt"

View File

@ -3,10 +3,10 @@ package cmd
import (
"os"
"dagger.io/go/cmd/dagger/logger"
"dagger.io/go/dagger/state"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"go.dagger.io/dagger/cmd/dagger/logger"
"go.dagger.io/dagger/state"
)
var initCmd = &cobra.Command{

View File

@ -1,10 +1,10 @@
package input
import (
"dagger.io/go/cmd/dagger/logger"
"dagger.io/go/dagger/state"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"go.dagger.io/dagger/cmd/dagger/logger"
"go.dagger.io/dagger/state"
)
var containerCmd = &cobra.Command{

View File

@ -4,11 +4,11 @@ import (
"path/filepath"
"strings"
"dagger.io/go/cmd/dagger/cmd/common"
"dagger.io/go/cmd/dagger/logger"
"dagger.io/go/dagger/state"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"go.dagger.io/dagger/cmd/dagger/cmd/common"
"go.dagger.io/dagger/cmd/dagger/logger"
"go.dagger.io/dagger/state"
)
var dirCmd = &cobra.Command{

View File

@ -1,10 +1,10 @@
package input
import (
"dagger.io/go/cmd/dagger/logger"
"dagger.io/go/dagger/state"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"go.dagger.io/dagger/cmd/dagger/logger"
"go.dagger.io/dagger/state"
)
var gitCmd = &cobra.Command{

View File

@ -1,10 +1,10 @@
package input
import (
"dagger.io/go/cmd/dagger/logger"
"dagger.io/go/dagger/state"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"go.dagger.io/dagger/cmd/dagger/logger"
"go.dagger.io/dagger/state"
)
var jsonCmd = &cobra.Command{

View File

@ -6,13 +6,13 @@ import (
"os"
"text/tabwriter"
"dagger.io/go/cmd/dagger/cmd/common"
"dagger.io/go/cmd/dagger/logger"
"dagger.io/go/dagger/client"
"dagger.io/go/dagger/compiler"
"dagger.io/go/dagger/environment"
"dagger.io/go/dagger/solver"
"dagger.io/go/dagger/state"
"go.dagger.io/dagger/client"
"go.dagger.io/dagger/cmd/dagger/cmd/common"
"go.dagger.io/dagger/cmd/dagger/logger"
"go.dagger.io/dagger/compiler"
"go.dagger.io/dagger/environment"
"go.dagger.io/dagger/solver"
"go.dagger.io/dagger/state"
"github.com/spf13/cobra"
"github.com/spf13/viper"

View File

@ -5,11 +5,11 @@ import (
"io"
"os"
"dagger.io/go/cmd/dagger/cmd/common"
"dagger.io/go/dagger/state"
"github.com/rs/zerolog/log"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"go.dagger.io/dagger/cmd/dagger/cmd/common"
"go.dagger.io/dagger/state"
)
// Cmd exposes the top-level command

View File

@ -4,10 +4,10 @@ import (
"fmt"
"syscall"
"dagger.io/go/cmd/dagger/logger"
"dagger.io/go/dagger/state"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"go.dagger.io/dagger/cmd/dagger/logger"
"go.dagger.io/dagger/state"
"golang.org/x/term"
)

View File

@ -1,10 +1,10 @@
package input
import (
"dagger.io/go/cmd/dagger/logger"
"dagger.io/go/dagger/state"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"go.dagger.io/dagger/cmd/dagger/logger"
"go.dagger.io/dagger/state"
)
var textCmd = &cobra.Command{

View File

@ -1,10 +1,10 @@
package input
import (
"dagger.io/go/cmd/dagger/cmd/common"
"dagger.io/go/cmd/dagger/logger"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"go.dagger.io/dagger/cmd/dagger/cmd/common"
"go.dagger.io/dagger/cmd/dagger/logger"
)
var unsetCmd = &cobra.Command{

View File

@ -1,10 +1,10 @@
package input
import (
"dagger.io/go/cmd/dagger/logger"
"dagger.io/go/dagger/state"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"go.dagger.io/dagger/cmd/dagger/logger"
"go.dagger.io/dagger/state"
)
var yamlCmd = &cobra.Command{

View File

@ -8,10 +8,10 @@ import (
"strings"
"text/tabwriter"
"dagger.io/go/cmd/dagger/cmd/common"
"dagger.io/go/cmd/dagger/logger"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"go.dagger.io/dagger/cmd/dagger/cmd/common"
"go.dagger.io/dagger/cmd/dagger/logger"
)
var listCmd = &cobra.Command{

View File

@ -1,10 +1,10 @@
package cmd
import (
"dagger.io/go/cmd/dagger/cmd/common"
"dagger.io/go/cmd/dagger/logger"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"go.dagger.io/dagger/cmd/dagger/cmd/common"
"go.dagger.io/dagger/cmd/dagger/logger"
)
var newCmd = &cobra.Command{

View File

@ -4,10 +4,10 @@ import (
"fmt"
"cuelang.org/go/cue"
"dagger.io/go/cmd/dagger/cmd/common"
"dagger.io/go/cmd/dagger/logger"
"dagger.io/go/dagger/client"
"dagger.io/go/dagger/compiler"
"go.dagger.io/dagger/client"
"go.dagger.io/dagger/cmd/dagger/cmd/common"
"go.dagger.io/dagger/cmd/dagger/logger"
"go.dagger.io/dagger/compiler"
"github.com/spf13/cobra"
"github.com/spf13/viper"

View File

@ -4,14 +4,14 @@ import (
"os"
"strings"
"dagger.io/go/cmd/dagger/cmd/input"
"dagger.io/go/cmd/dagger/cmd/output"
"dagger.io/go/cmd/dagger/logger"
"github.com/moby/buildkit/util/appcontext"
"github.com/opentracing/opentracing-go"
otlog "github.com/opentracing/opentracing-go/log"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"go.dagger.io/dagger/cmd/dagger/cmd/input"
"go.dagger.io/dagger/cmd/dagger/cmd/output"
"go.dagger.io/dagger/cmd/dagger/logger"
)
var rootCmd = &cobra.Command{

View File

@ -1,8 +1,8 @@
package cmd
import (
"dagger.io/go/cmd/dagger/cmd/common"
"dagger.io/go/cmd/dagger/logger"
"go.dagger.io/dagger/cmd/dagger/cmd/common"
"go.dagger.io/dagger/cmd/dagger/logger"
"github.com/spf13/cobra"
"github.com/spf13/viper"

View File

@ -25,7 +25,7 @@ const (
)
// set by goreleaser or other builder using
// -ldflags='-X dagger.io/go/cmd/dagger/cmd.version=<version>'
// -ldflags='-X go.dagger.io/dagger/cmd/dagger/cmd.version=<version>'
var (
version = defaultVersion
versionMessage = ""

View File

@ -1,7 +1,7 @@
package main
import (
"dagger.io/go/cmd/dagger/cmd"
"go.dagger.io/dagger/cmd/dagger/cmd"
)
func main() {

View File

@ -9,10 +9,10 @@ import (
"cuelang.org/go/cue"
cueflow "cuelang.org/go/tools/flow"
"dagger.io/go/dagger/compiler"
"dagger.io/go/dagger/solver"
"dagger.io/go/dagger/state"
"dagger.io/go/stdlib"
"go.dagger.io/dagger/compiler"
"go.dagger.io/dagger/solver"
"go.dagger.io/dagger/state"
"go.dagger.io/dagger/stdlib"
"github.com/opentracing/opentracing-go"
"github.com/opentracing/opentracing-go/ext"

View File

@ -3,8 +3,8 @@ package environment
import (
"testing"
"dagger.io/go/dagger/state"
"github.com/stretchr/testify/require"
"go.dagger.io/dagger/state"
)
func TestLocalDirs(t *testing.T) {

View File

@ -4,8 +4,8 @@ import (
"context"
"cuelang.org/go/cue"
"dagger.io/go/dagger/compiler"
"github.com/rs/zerolog/log"
"go.dagger.io/dagger/compiler"
)
func isReference(val cue.Value) bool {

View File

@ -25,8 +25,8 @@ import (
"github.com/rs/zerolog/log"
"gopkg.in/yaml.v3"
"dagger.io/go/dagger/compiler"
"dagger.io/go/dagger/solver"
"go.dagger.io/dagger/compiler"
"go.dagger.io/dagger/solver"
)
const (

2
go.mod
View File

@ -1,4 +1,4 @@
module dagger.io/go
module go.dagger.io/dagger
go 1.16

View File

@ -10,7 +10,7 @@ import (
"cuelang.org/go/cue"
"dagger.io/go/dagger/compiler"
"go.dagger.io/dagger/compiler"
)
// An input is a value or artifact supplied by the user.

View File

@ -9,8 +9,8 @@ import (
"path"
"path/filepath"
"dagger.io/go/dagger/keychain"
"github.com/rs/zerolog/log"
"go.dagger.io/dagger/keychain"
"gopkg.in/yaml.v3"
)