chore: Move httpapi, httpmw, & database into `coderd` (#568)

* chore: Move httpmw to /coderd directory
httpmw is specific to coderd and should be scoped under coderd

* chore: Move httpapi to /coderd directory
httpapi is specific to coderd and should be scoped under coderd

* chore: Move database  to /coderd directory
database is specific to coderd and should be scoped under coderd

* chore: Update codecov & gitattributes for generated files
* chore: Update Makefile
This commit is contained in:
Steven Masley 2022-03-25 16:07:45 -05:00 committed by GitHub
parent 6be949a88e
commit 591523a078
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
98 changed files with 155 additions and 155 deletions

2
.gitattributes vendored
View File

@ -1,5 +1,5 @@
# Generated files
database/dump.sql linguist-generated=true
coderd/database/dump.sql linguist-generated=true
peerbroker/proto/*.go linguist-generated=true
provisionerd/proto/*.go linguist-generated=true
provisionersdk/proto/*.go linguist-generated=true

View File

@ -10,15 +10,15 @@ build: site/out bin
.PHONY: build
# Runs migrations to output a dump of the database.
database/dump.sql: $(wildcard database/migrations/*.sql)
go run database/dump/main.go
coderd/database/dump.sql: $(wildcard coderd/database/migrations/*.sql)
go run coderd/database/dump/main.go
# Generates Go code for querying the database.
database/generate: fmt/sql database/dump.sql database/query.sql
cd database && sqlc generate && rm db_tmp.go
cd database && gofmt -w -r 'Querier -> querier' *.go
cd database && gofmt -w -r 'Queries -> sqlQuerier' *.go
.PHONY: database/generate
coderd/database/generate: fmt/sql coderd/database/dump.sql coderd/database/query.sql
cd coderd/database && sqlc generate && rm db_tmp.go
cd coderd/database && gofmt -w -r 'Querier -> querier' *.go
cd coderd/database && gofmt -w -r 'Queries -> sqlQuerier' *.go
.PHONY: coderd/database/generate
fmt/prettier:
@echo "--- prettier"
@ -30,18 +30,18 @@ else
endif
.PHONY: fmt/prettier
fmt/sql: ./database/query.sql
fmt/sql: ./coderd/database/query.sql
npx sql-formatter \
--language postgresql \
--lines-between-queries 2 \
./database/query.sql \
--output ./database/query.sql
sed -i 's/@ /@/g' ./database/query.sql
./coderd/database/query.sql \
--output ./coderd/database/query.sql
sed -i 's/@ /@/g' ./coderd/database/query.sql
fmt: fmt/prettier fmt/sql
.PHONY: fmt
gen: database/generate peerbroker/proto provisionersdk/proto provisionerd/proto
gen: coderd/database/generate peerbroker/proto provisionersdk/proto provisionerd/proto
.PHONY: gen
install: bin

View File

@ -10,8 +10,8 @@ import (
"github.com/charmbracelet/lipgloss"
"github.com/spf13/cobra"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/codersdk"
"github.com/coder/coder/database"
)
type JobOptions struct {

View File

@ -6,8 +6,8 @@ import (
"github.com/spf13/cobra"
"golang.org/x/xerrors"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/codersdk"
"github.com/coder/coder/database"
)
func parameterCreate() *cobra.Command {

View File

@ -15,8 +15,8 @@ import (
"golang.org/x/xerrors"
"github.com/coder/coder/cli/cliui"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/codersdk"
"github.com/coder/coder/database"
"github.com/coder/coder/provisionerd"
"github.com/coder/coder/provisionersdk"
)

View File

@ -7,7 +7,7 @@ import (
"github.com/coder/coder/cli/clitest"
"github.com/coder/coder/coderd/coderdtest"
"github.com/coder/coder/database"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/provisioner/echo"
"github.com/coder/coder/pty/ptytest"
)

View File

@ -8,8 +8,8 @@ import (
"github.com/spf13/cobra"
"github.com/coder/coder/cli/cliui"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/codersdk"
"github.com/coder/coder/database"
)
func projects() *cobra.Command {

View File

@ -9,8 +9,8 @@ import (
"github.com/spf13/cobra"
"golang.org/x/xerrors"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/codersdk"
"github.com/coder/coder/database"
"github.com/coder/coder/provisionersdk"
)

View File

@ -8,8 +8,8 @@ import (
"golang.org/x/term"
"golang.org/x/xerrors"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/codersdk"
"github.com/coder/coder/database"
)
func workspaceSSH() *cobra.Command {

View File

@ -28,10 +28,10 @@ import (
"github.com/coder/coder/cli/cliui"
"github.com/coder/coder/cli/config"
"github.com/coder/coder/coderd"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/coderd/database/databasefake"
"github.com/coder/coder/coderd/tunnel"
"github.com/coder/coder/codersdk"
"github.com/coder/coder/database"
"github.com/coder/coder/database/databasefake"
"github.com/coder/coder/provisioner/terraform"
"github.com/coder/coder/provisionerd"
"github.com/coder/coder/provisionersdk"

View File

@ -22,8 +22,8 @@ import (
"github.com/coder/coder/cli/clitest"
"github.com/coder/coder/coderd/coderdtest"
"github.com/coder/coder/coderd/database/postgres"
"github.com/coder/coder/codersdk"
"github.com/coder/coder/database/postgres"
)
func TestStart(t *testing.T) {

View File

@ -13,8 +13,8 @@ import (
"golang.org/x/xerrors"
"github.com/coder/coder/cli/cliui"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/codersdk"
"github.com/coder/coder/database"
)
func workspaceCreate() *cobra.Command {

View File

@ -6,8 +6,8 @@ import (
"github.com/spf13/cobra"
"github.com/coder/coder/cli/cliui"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/codersdk"
"github.com/coder/coder/database"
)
func workspaceDelete() *cobra.Command {

View File

@ -6,8 +6,8 @@ import (
"github.com/spf13/cobra"
"github.com/coder/coder/cli/cliui"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/codersdk"
"github.com/coder/coder/database"
)
func workspaceStart() *cobra.Command {

View File

@ -6,8 +6,8 @@ import (
"github.com/spf13/cobra"
"github.com/coder/coder/cli/cliui"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/codersdk"
"github.com/coder/coder/database"
)
func workspaceStop() *cobra.Command {

View File

@ -11,8 +11,8 @@ import (
"golang.org/x/xerrors"
"github.com/coder/coder/cli/cliui"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/codersdk"
"github.com/coder/coder/database"
)
func main() {

View File

@ -19,10 +19,10 @@ import (
"cdr.dev/slog"
"cdr.dev/slog/sloggers/sloghuman"
"github.com/coder/coder/coderd"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/coderd/database/databasefake"
"github.com/coder/coder/coderd/tunnel"
"github.com/coder/coder/codersdk"
"github.com/coder/coder/database"
"github.com/coder/coder/database/databasefake"
"github.com/coder/coder/provisioner/terraform"
"github.com/coder/coder/provisionerd"
"github.com/coder/coder/provisionersdk"

View File

@ -24,14 +24,14 @@ coverage:
ignore:
# This is generated code.
- database/models.go
- database/query.sql.go
- database/databasefake
- coderd/database/models.go
- coderd/database/query.sql.go
- coderd/database/databasefake
# These are generated or don't require tests.
- cmd
- coderd/tunnel
- database/dump
- database/postgres
- coderd/database/dump
- coderd/database/postgres
- peerbroker/proto
- provisionerd/proto
- provisionersdk/proto

View File

@ -10,9 +10,9 @@ import (
"google.golang.org/api/idtoken"
"cdr.dev/slog"
"github.com/coder/coder/database"
"github.com/coder/coder/httpapi"
"github.com/coder/coder/httpmw"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/coderd/httpapi"
"github.com/coder/coder/coderd/httpmw"
"github.com/coder/coder/site"
)

View File

@ -31,11 +31,11 @@ import (
"cdr.dev/slog"
"cdr.dev/slog/sloggers/slogtest"
"github.com/coder/coder/coderd"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/coderd/database/databasefake"
"github.com/coder/coder/coderd/database/postgres"
"github.com/coder/coder/codersdk"
"github.com/coder/coder/cryptorand"
"github.com/coder/coder/database"
"github.com/coder/coder/database/databasefake"
"github.com/coder/coder/database/postgres"
"github.com/coder/coder/provisioner/echo"
"github.com/coder/coder/provisionerd"
"github.com/coder/coder/provisionersdk"

View File

@ -8,7 +8,7 @@ import (
"github.com/google/uuid"
"github.com/coder/coder/database"
"github.com/coder/coder/coderd/database"
)
// New returns an in-memory fake of the database.

View File

@ -4,8 +4,8 @@
//
// To modify the database schema:
// 1. Add a new migration using "create_migration.sh" in database/migrations/
// 2. Run "make database/generate" in the root to generate models.
// 3. Add/Edit queries in "query.sql" and run "make database/generate" to create Go code.
// 2. Run "make coderd/database/generate" in the root to generate models.
// 3. Add/Edit queries in "query.sql" and run "make coderd/database/generate" to create Go code.
package database
import (

View File

@ -1,4 +1,4 @@
-- Code generated by 'make database/generate'. DO NOT EDIT.
-- Code generated by 'make coderd/database/generate'. DO NOT EDIT.
CREATE TYPE log_level AS ENUM (
'trace',

View File

@ -10,8 +10,8 @@ import (
"path/filepath"
"runtime"
"github.com/coder/coder/database"
"github.com/coder/coder/database/postgres"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/coderd/database/postgres"
)
func main() {
@ -76,7 +76,7 @@ func main() {
}
}
dump := fmt.Sprintf("-- Code generated by 'make database/generate'. DO NOT EDIT.\n%s", output.Bytes())
dump := fmt.Sprintf("-- Code generated by 'make coderd/database/generate'. DO NOT EDIT.\n%s", output.Bytes())
_, mainPath, _, ok := runtime.Caller(0)
if !ok {
panic("couldn't get caller path")

View File

@ -9,8 +9,8 @@ import (
"github.com/stretchr/testify/require"
"go.uber.org/goleak"
"github.com/coder/coder/database"
"github.com/coder/coder/database/postgres"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/coderd/database/postgres"
)
func TestMain(m *testing.M) {

View File

@ -9,7 +9,7 @@ import (
"github.com/stretchr/testify/require"
"go.uber.org/goleak"
"github.com/coder/coder/database/postgres"
"github.com/coder/coder/coderd/database/postgres"
_ "github.com/lib/pq"
)

View File

@ -7,7 +7,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/coder/coder/database"
"github.com/coder/coder/coderd/database"
)
func TestPubsubMemory(t *testing.T) {

View File

@ -10,8 +10,8 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/coder/coder/database"
"github.com/coder/coder/database/postgres"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/coderd/database/postgres"
)
func TestPubsub(t *testing.T) {

View File

@ -12,10 +12,10 @@ import (
"github.com/go-chi/chi/v5"
"github.com/go-chi/render"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/coderd/httpapi"
"github.com/coder/coder/coderd/httpmw"
"github.com/coder/coder/codersdk"
"github.com/coder/coder/database"
"github.com/coder/coder/httpapi"
"github.com/coder/coder/httpmw"
)
func (api *api) postFile(rw http.ResponseWriter, r *http.Request) {

View File

@ -9,7 +9,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/coder/coder/httpapi"
"github.com/coder/coder/coderd/httpapi"
)
func TestWrite(t *testing.T) {

View File

@ -13,8 +13,8 @@ import (
"golang.org/x/oauth2"
"github.com/coder/coder/database"
"github.com/coder/coder/httpapi"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/coderd/httpapi"
)
// AuthCookie represents the name of the cookie the API key is stored in.

View File

@ -12,11 +12,11 @@ import (
"github.com/stretchr/testify/require"
"golang.org/x/oauth2"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/coderd/database/databasefake"
"github.com/coder/coder/coderd/httpapi"
"github.com/coder/coder/coderd/httpmw"
"github.com/coder/coder/cryptorand"
"github.com/coder/coder/database"
"github.com/coder/coder/database/databasefake"
"github.com/coder/coder/httpapi"
"github.com/coder/coder/httpmw"
)
func randomAPIKeyParts() (id string, secret string) {

View File

@ -7,7 +7,7 @@ import (
"github.com/go-chi/chi/v5"
"github.com/google/uuid"
"github.com/coder/coder/httpapi"
"github.com/coder/coder/coderd/httpapi"
)
// parseUUID consumes a url parameter and parses it as a UUID.

View File

@ -9,8 +9,8 @@ import (
"github.com/go-chi/chi/v5"
"github.com/coder/coder/database"
"github.com/coder/coder/httpapi"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/coderd/httpapi"
)
type organizationParamContextKey struct{}

View File

@ -13,10 +13,10 @@ import (
"github.com/google/uuid"
"github.com/stretchr/testify/require"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/coderd/database/databasefake"
"github.com/coder/coder/coderd/httpmw"
"github.com/coder/coder/cryptorand"
"github.com/coder/coder/database"
"github.com/coder/coder/database/databasefake"
"github.com/coder/coder/httpmw"
)
func TestOrganizationParam(t *testing.T) {

View File

@ -9,8 +9,8 @@ import (
"github.com/go-chi/chi/v5"
"github.com/coder/coder/database"
"github.com/coder/coder/httpapi"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/coderd/httpapi"
)
type projectParamContextKey struct{}

View File

@ -13,10 +13,10 @@ import (
"github.com/google/uuid"
"github.com/stretchr/testify/require"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/coderd/database/databasefake"
"github.com/coder/coder/coderd/httpmw"
"github.com/coder/coder/cryptorand"
"github.com/coder/coder/database"
"github.com/coder/coder/database/databasefake"
"github.com/coder/coder/httpmw"
)
func TestProjectParam(t *testing.T) {

View File

@ -9,8 +9,8 @@ import (
"github.com/go-chi/chi/v5"
"github.com/coder/coder/database"
"github.com/coder/coder/httpapi"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/coderd/httpapi"
)
type projectVersionParamContextKey struct{}

View File

@ -13,10 +13,10 @@ import (
"github.com/google/uuid"
"github.com/stretchr/testify/require"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/coderd/database/databasefake"
"github.com/coder/coder/coderd/httpmw"
"github.com/coder/coder/cryptorand"
"github.com/coder/coder/database"
"github.com/coder/coder/database/databasefake"
"github.com/coder/coder/httpmw"
)
func TestProjectVersionParam(t *testing.T) {

View File

@ -7,8 +7,8 @@ import (
"github.com/go-chi/chi/v5"
"github.com/coder/coder/database"
"github.com/coder/coder/httpapi"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/coderd/httpapi"
)
type userParamContextKey struct{}

View File

@ -12,9 +12,9 @@ import (
"github.com/go-chi/chi/v5"
"github.com/stretchr/testify/require"
"github.com/coder/coder/database"
"github.com/coder/coder/database/databasefake"
"github.com/coder/coder/httpmw"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/coderd/database/databasefake"
"github.com/coder/coder/coderd/httpmw"
)
func TestUserParam(t *testing.T) {

View File

@ -9,8 +9,8 @@ import (
"github.com/google/uuid"
"github.com/coder/coder/database"
"github.com/coder/coder/httpapi"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/coderd/httpapi"
)
type workspaceAgentContextKey struct{}

View File

@ -10,9 +10,9 @@ import (
"github.com/google/uuid"
"github.com/stretchr/testify/require"
"github.com/coder/coder/database"
"github.com/coder/coder/database/databasefake"
"github.com/coder/coder/httpmw"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/coderd/database/databasefake"
"github.com/coder/coder/coderd/httpmw"
)
func TestWorkspaceAgent(t *testing.T) {

View File

@ -9,8 +9,8 @@ import (
"github.com/go-chi/chi/v5"
"github.com/coder/coder/database"
"github.com/coder/coder/httpapi"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/coderd/httpapi"
)
type workspaceBuildParamContextKey struct{}

View File

@ -13,10 +13,10 @@ import (
"github.com/google/uuid"
"github.com/stretchr/testify/require"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/coderd/database/databasefake"
"github.com/coder/coder/coderd/httpmw"
"github.com/coder/coder/cryptorand"
"github.com/coder/coder/database"
"github.com/coder/coder/database/databasefake"
"github.com/coder/coder/httpmw"
)
func TestWorkspaceBuildParam(t *testing.T) {

View File

@ -7,8 +7,8 @@ import (
"fmt"
"net/http"
"github.com/coder/coder/database"
"github.com/coder/coder/httpapi"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/coderd/httpapi"
)
type workspaceParamContextKey struct{}

View File

@ -13,10 +13,10 @@ import (
"github.com/google/uuid"
"github.com/stretchr/testify/require"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/coderd/database/databasefake"
"github.com/coder/coder/coderd/httpmw"
"github.com/coder/coder/cryptorand"
"github.com/coder/coder/database"
"github.com/coder/coder/database/databasefake"
"github.com/coder/coder/httpmw"
)
func TestWorkspaceParam(t *testing.T) {

View File

@ -9,8 +9,8 @@ import (
"github.com/go-chi/chi/v5"
"github.com/coder/coder/database"
"github.com/coder/coder/httpapi"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/coderd/httpapi"
)
type workspaceResourceParamContextKey struct{}

View File

@ -10,9 +10,9 @@ import (
"github.com/google/uuid"
"github.com/stretchr/testify/require"
"github.com/coder/coder/database"
"github.com/coder/coder/database/databasefake"
"github.com/coder/coder/httpmw"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/coderd/database/databasefake"
"github.com/coder/coder/coderd/httpmw"
)
func TestWorkspaceResourceParam(t *testing.T) {

View File

@ -12,10 +12,10 @@ import (
"github.com/moby/moby/pkg/namesgenerator"
"golang.org/x/xerrors"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/coderd/httpapi"
"github.com/coder/coder/coderd/httpmw"
"github.com/coder/coder/codersdk"
"github.com/coder/coder/database"
"github.com/coder/coder/httpapi"
"github.com/coder/coder/httpmw"
)
func (*api) organization(rw http.ResponseWriter, r *http.Request) {

View File

@ -9,8 +9,8 @@ import (
"github.com/stretchr/testify/require"
"github.com/coder/coder/coderd/coderdtest"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/codersdk"
"github.com/coder/coder/database"
"github.com/coder/coder/provisioner/echo"
)

View File

@ -8,7 +8,7 @@ import (
"github.com/google/uuid"
"golang.org/x/xerrors"
"github.com/coder/coder/database"
"github.com/coder/coder/coderd/database"
)
// ComputeScope targets identifiers to pull parameters from.

View File

@ -7,10 +7,10 @@ import (
"github.com/google/uuid"
"github.com/stretchr/testify/require"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/coderd/database/databasefake"
"github.com/coder/coder/coderd/parameter"
"github.com/coder/coder/cryptorand"
"github.com/coder/coder/database"
"github.com/coder/coder/database/databasefake"
)
func TestCompute(t *testing.T) {

View File

@ -10,9 +10,9 @@ import (
"github.com/go-chi/render"
"github.com/google/uuid"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/coderd/httpapi"
"github.com/coder/coder/codersdk"
"github.com/coder/coder/database"
"github.com/coder/coder/httpapi"
)
func (api *api) postParameter(rw http.ResponseWriter, r *http.Request) {

View File

@ -8,8 +8,8 @@ import (
"github.com/stretchr/testify/require"
"github.com/coder/coder/coderd/coderdtest"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/codersdk"
"github.com/coder/coder/database"
)
func TestPostParameter(t *testing.T) {

View File

@ -10,10 +10,10 @@ import (
"github.com/go-chi/render"
"github.com/google/uuid"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/coderd/httpapi"
"github.com/coder/coder/coderd/httpmw"
"github.com/coder/coder/codersdk"
"github.com/coder/coder/database"
"github.com/coder/coder/httpapi"
"github.com/coder/coder/httpmw"
)
// Returns a single project.

View File

@ -8,11 +8,11 @@ import (
"github.com/go-chi/render"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/coderd/httpapi"
"github.com/coder/coder/coderd/httpmw"
"github.com/coder/coder/coderd/parameter"
"github.com/coder/coder/codersdk"
"github.com/coder/coder/database"
"github.com/coder/coder/httpapi"
"github.com/coder/coder/httpmw"
)
func (api *api) projectVersion(rw http.ResponseWriter, r *http.Request) {

View File

@ -23,9 +23,9 @@ import (
"cdr.dev/slog"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/coderd/httpapi"
"github.com/coder/coder/coderd/parameter"
"github.com/coder/coder/database"
"github.com/coder/coder/httpapi"
"github.com/coder/coder/provisionerd/proto"
"github.com/coder/coder/provisionersdk"
sdkproto "github.com/coder/coder/provisionersdk/proto"

View File

@ -15,9 +15,9 @@ import (
"cdr.dev/slog"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/coderd/httpapi"
"github.com/coder/coder/codersdk"
"github.com/coder/coder/database"
"github.com/coder/coder/httpapi"
)
// Returns provisioner logs based on query parameters.

View File

@ -8,7 +8,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/coder/coder/coderd/coderdtest"
"github.com/coder/coder/database"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/provisioner/echo"
"github.com/coder/coder/provisionersdk/proto"
)

View File

@ -15,12 +15,12 @@ import (
"github.com/moby/moby/pkg/namesgenerator"
"golang.org/x/xerrors"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/coderd/httpapi"
"github.com/coder/coder/coderd/httpmw"
"github.com/coder/coder/coderd/userpassword"
"github.com/coder/coder/codersdk"
"github.com/coder/coder/cryptorand"
"github.com/coder/coder/database"
"github.com/coder/coder/httpapi"
"github.com/coder/coder/httpmw"
)
// Returns whether the initial user has been created or not.

View File

@ -9,8 +9,8 @@ import (
"github.com/stretchr/testify/require"
"github.com/coder/coder/coderd/coderdtest"
"github.com/coder/coder/coderd/httpmw"
"github.com/coder/coder/codersdk"
"github.com/coder/coder/httpmw"
)
func TestFirstUser(t *testing.T) {

View File

@ -7,10 +7,10 @@ import (
"github.com/go-chi/render"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/coderd/httpapi"
"github.com/coder/coder/coderd/httpmw"
"github.com/coder/coder/codersdk"
"github.com/coder/coder/database"
"github.com/coder/coder/httpapi"
"github.com/coder/coder/httpmw"
)
func (api *api) workspaceBuild(rw http.ResponseWriter, r *http.Request) {

View File

@ -9,9 +9,9 @@ import (
"github.com/go-chi/render"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/coderd/httpapi"
"github.com/coder/coder/codersdk"
"github.com/coder/coder/database"
"github.com/coder/coder/httpapi"
"github.com/mitchellh/mapstructure"
)

View File

@ -15,10 +15,10 @@ import (
"cdr.dev/slog"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/coderd/httpapi"
"github.com/coder/coder/coderd/httpmw"
"github.com/coder/coder/codersdk"
"github.com/coder/coder/database"
"github.com/coder/coder/httpapi"
"github.com/coder/coder/httpmw"
"github.com/coder/coder/peerbroker"
"github.com/coder/coder/peerbroker/proto"
"github.com/coder/coder/provisionersdk"

View File

@ -13,10 +13,10 @@ import (
"github.com/moby/moby/pkg/namesgenerator"
"golang.org/x/xerrors"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/coderd/httpapi"
"github.com/coder/coder/coderd/httpmw"
"github.com/coder/coder/codersdk"
"github.com/coder/coder/database"
"github.com/coder/coder/httpapi"
"github.com/coder/coder/httpmw"
)
func (api *api) workspace(rw http.ResponseWriter, r *http.Request) {

View File

@ -9,8 +9,8 @@ import (
"github.com/stretchr/testify/require"
"github.com/coder/coder/coderd/coderdtest"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/codersdk"
"github.com/coder/coder/database"
"github.com/coder/coder/provisioner/echo"
"github.com/coder/coder/provisionersdk/proto"
)

View File

@ -13,8 +13,8 @@ import (
"golang.org/x/xerrors"
"github.com/coder/coder/httpapi"
"github.com/coder/coder/httpmw"
"github.com/coder/coder/coderd/httpapi"
"github.com/coder/coder/coderd/httpmw"
)
// New creates a Coder client for the provided URL.

View File

@ -9,7 +9,7 @@ import (
"github.com/google/uuid"
"github.com/coder/coder/database"
"github.com/coder/coder/coderd/database"
)
// Organization is the JSON representation of a Coder organization.

View File

@ -9,7 +9,7 @@ import (
"github.com/google/uuid"
"github.com/coder/coder/database"
"github.com/coder/coder/coderd/database"
)
type ParameterScope string

View File

@ -9,7 +9,7 @@ import (
"github.com/google/uuid"
"github.com/coder/coder/database"
"github.com/coder/coder/coderd/database"
)
// Project is the JSON representation of a Coder project.

View File

@ -9,8 +9,8 @@ import (
"github.com/google/uuid"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/coderd/parameter"
"github.com/coder/coder/database"
)
// ProjectVersion represents a single version of a project.

View File

@ -15,7 +15,7 @@ import (
"golang.org/x/xerrors"
"nhooyr.io/websocket"
"github.com/coder/coder/database"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/provisionerd/proto"
"github.com/coder/coder/provisionersdk"
)

View File

@ -9,7 +9,7 @@ import (
"github.com/google/uuid"
"github.com/coder/coder/database"
"github.com/coder/coder/coderd/database"
)
// WorkspaceBuild is an at-point representation of a workspace state.

View File

@ -16,8 +16,8 @@ import (
"nhooyr.io/websocket"
"github.com/coder/coder/agent"
"github.com/coder/coder/database"
"github.com/coder/coder/httpmw"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/coderd/httpmw"
"github.com/coder/coder/peer"
"github.com/coder/coder/peerbroker"
"github.com/coder/coder/peerbroker/proto"

View File

@ -9,7 +9,7 @@ import (
"github.com/google/uuid"
"github.com/coder/coder/database"
"github.com/coder/coder/coderd/database"
)
// Workspace is a per-user deployment of a project. It tracks

View File

@ -17,7 +17,7 @@ import (
"storj.io/drpc/drpcserver"
"cdr.dev/slog"
"github.com/coder/coder/database"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/peerbroker/proto"
)

View File

@ -10,7 +10,7 @@ import (
"cdr.dev/slog"
"cdr.dev/slog/sloggers/slogtest"
"github.com/coder/coder/database"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/peer"
"github.com/coder/coder/peerbroker"
"github.com/coder/coder/peerbroker/proto"