move api to internal/

This commit is contained in:
Alan Donovan 2021-09-15 13:09:31 -04:00
parent 3abde5f0c5
commit 06719866c9
11 changed files with 28 additions and 11 deletions

View file

@ -6,7 +6,7 @@ import (
"net/url"
"os"
"github.com/github/ghcs/api"
"github.com/github/ghcs/internal/api"
"github.com/skratchdot/open-golang/open"
"github.com/spf13/cobra"
)

View file

@ -11,7 +11,7 @@ import (
"github.com/AlecAivazis/survey/v2"
"github.com/AlecAivazis/survey/v2/terminal"
"github.com/github/ghcs/api"
"github.com/github/ghcs/internal/api"
"golang.org/x/term"
)

View file

@ -9,8 +9,8 @@ import (
"github.com/AlecAivazis/survey/v2"
"github.com/fatih/camelcase"
"github.com/github/ghcs/api"
"github.com/github/ghcs/cmd/ghcs/output"
"github.com/github/ghcs/internal/api"
"github.com/github/ghcs/internal/codespaces"
"github.com/spf13/cobra"
)

View file

@ -7,8 +7,8 @@ import (
"os"
"strings"
"github.com/github/ghcs/api"
"github.com/github/ghcs/cmd/ghcs/output"
"github.com/github/ghcs/internal/api"
"github.com/spf13/cobra"
)

View file

@ -5,8 +5,8 @@ import (
"fmt"
"os"
"github.com/github/ghcs/api"
"github.com/github/ghcs/cmd/ghcs/output"
"github.com/github/ghcs/internal/api"
"github.com/spf13/cobra"
)

View file

@ -6,8 +6,8 @@ import (
"net"
"os"
"github.com/github/ghcs/api"
"github.com/github/ghcs/cmd/ghcs/output"
"github.com/github/ghcs/internal/api"
"github.com/github/ghcs/internal/codespaces"
"github.com/github/go-liveshare"
"github.com/spf13/cobra"

View file

@ -11,8 +11,8 @@ import (
"strconv"
"strings"
"github.com/github/ghcs/api"
"github.com/github/ghcs/cmd/ghcs/output"
"github.com/github/ghcs/internal/api"
"github.com/github/ghcs/internal/codespaces"
"github.com/github/go-liveshare"
"github.com/muhammadmuzzammil1998/jsonc"

View file

@ -6,8 +6,8 @@ import (
"net"
"os"
"github.com/github/ghcs/api"
"github.com/github/ghcs/cmd/ghcs/output"
"github.com/github/ghcs/internal/api"
"github.com/github/ghcs/internal/codespaces"
"github.com/github/go-liveshare"
"github.com/spf13/cobra"

View file

@ -1,4 +1,3 @@
// TODO(adonovan): rename to package codespaces, and codespaces.Client.
package api
// For descriptions of service interfaces, see:
@ -7,6 +6,24 @@ package api
// - https://github.com/github/github/blob/master/app/api/codespaces.rb (for vscs_internal)
// TODO(adonovan): replace the last link with a public doc URL when available.
// TODO(adonovan): a possible reorganization would be to split this
// file into three internal packages, one per backend service, and to
// rename api.API to github.Client:
//
// - github.GetUser(github.Client)
// - github.GetRepository(Client)
// - github.ReadFile(Client, nwo, branch, path) // was GetCodespaceRepositoryContents
// - codespaces.Create(Client, user, repo, sku, branch, location)
// - codespaces.Delete(Client, user, token, name)
// - codespaces.Get(Client, token, owner, name)
// - codespaces.GetMachineTypes(Client, user, repo, branch, location)
// - codespaces.GetToken(Client, login, name)
// - codespaces.List(Client, user)
// - codespaces.Start(Client, token, codespace)
// - visualstudio.GetRegionLocation(http.Client) // no dependency on github
//
// This would make the meaning of each operation clearer.
import (
"bytes"
"context"

View file

@ -6,7 +6,7 @@ import (
"fmt"
"time"
"github.com/github/ghcs/api"
"github.com/github/ghcs/internal/api"
"github.com/github/go-liveshare"
)

View file

@ -9,7 +9,7 @@ import (
"strings"
"time"
"github.com/github/ghcs/api"
"github.com/github/ghcs/internal/api"
"github.com/github/go-liveshare"
)