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: run:
skip-dirs: skip-dirs:
# progressui is a modified 3rd party library from buildkit # progressui is a modified 3rd party library from buildkit
- pkg/progressui - util/progressui
linters: linters:
disable-all: true disable-all: true

View File

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

View File

@ -23,13 +23,13 @@ import (
"github.com/moby/buildkit/session" "github.com/moby/buildkit/session"
// docker output // docker output
"dagger.io/go/pkg/buildkitd" "go.dagger.io/dagger/util/buildkitd"
"dagger.io/go/pkg/progressui" "go.dagger.io/dagger/util/progressui"
"dagger.io/go/dagger/compiler" "go.dagger.io/dagger/compiler"
"dagger.io/go/dagger/environment" "go.dagger.io/dagger/environment"
"dagger.io/go/dagger/solver" "go.dagger.io/dagger/solver"
"dagger.io/go/dagger/state" "go.dagger.io/dagger/state"
) )
// A dagger client // A dagger client
@ -64,10 +64,10 @@ func New(ctx context.Context, host string, noCache bool) (*Client, error) {
}, nil }, 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 // 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) lg := log.Ctx(ctx)
eg, gctx := errgroup.WithContext(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() 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) lg := log.Ctx(ctx)
// Scan local dirs to grant access // Scan local dirs to grant access

View File

@ -3,12 +3,12 @@ package common
import ( import (
"context" "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/rs/zerolog/log"
"github.com/spf13/viper" "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 { func CurrentWorkspace(ctx context.Context) *state.Workspace {

View File

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

View File

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

View File

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

View File

@ -4,11 +4,11 @@ import (
"path/filepath" "path/filepath"
"strings" "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/cobra"
"github.com/spf13/viper" "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{ var dirCmd = &cobra.Command{

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -4,14 +4,14 @@ import (
"os" "os"
"strings" "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/moby/buildkit/util/appcontext"
"github.com/opentracing/opentracing-go" "github.com/opentracing/opentracing-go"
otlog "github.com/opentracing/opentracing-go/log" otlog "github.com/opentracing/opentracing-go/log"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/spf13/viper" "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{ var rootCmd = &cobra.Command{

View File

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

View File

@ -25,7 +25,7 @@ const (
) )
// set by goreleaser or other builder using // 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 ( var (
version = defaultVersion version = defaultVersion
versionMessage = "" versionMessage = ""

View File

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

View File

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

View File

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

View File

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

View File

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

2
go.mod
View File

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

View File

@ -10,7 +10,7 @@ import (
"cuelang.org/go/cue" "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. // An input is a value or artifact supplied by the user.

View File

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