Skip to content

Commit

Permalink
Sort imports
Browse files Browse the repository at this point in the history
  • Loading branch information
UnAfraid committed Oct 4, 2023
1 parent 0828952 commit 47a601d
Show file tree
Hide file tree
Showing 17 changed files with 40 additions and 23 deletions.
7 changes: 4 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ import (
"syscall"
"time"

"github.com/golang-jwt/jwt/v5"
"github.com/sirupsen/logrus"
"go.uber.org/automaxprocs/maxprocs"

"github.com/UnAfraid/wg-ui/pkg/api"
"github.com/UnAfraid/wg-ui/pkg/auth"
"github.com/UnAfraid/wg-ui/pkg/config"
Expand All @@ -21,9 +25,6 @@ import (
"github.com/UnAfraid/wg-ui/pkg/subscription"
"github.com/UnAfraid/wg-ui/pkg/user"
"github.com/UnAfraid/wg-ui/pkg/wg"
"github.com/golang-jwt/jwt/v5"
"github.com/sirupsen/logrus"
"go.uber.org/automaxprocs/maxprocs"
)

const (
Expand Down
1 change: 1 addition & 0 deletions pkg/api/internal/directive/directive_authenticated.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"

"github.com/99designs/gqlgen/graphql"

"github.com/UnAfraid/wg-ui/pkg/api/internal/model"
)

Expand Down
1 change: 1 addition & 0 deletions pkg/api/internal/handler/authentication_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"strings"

"github.com/99designs/gqlgen/graphql/handler/transport"

"github.com/UnAfraid/wg-ui/pkg/api/internal/model"
"github.com/UnAfraid/wg-ui/pkg/auth"
"github.com/UnAfraid/wg-ui/pkg/user"
Expand Down
3 changes: 2 additions & 1 deletion pkg/api/internal/handler/dataloader_middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ import (
"net/http"
"time"

"github.com/graph-gophers/dataloader/v7"

"github.com/UnAfraid/wg-ui/pkg/api/internal/model"
"github.com/UnAfraid/wg-ui/pkg/internal/adapt"
"github.com/UnAfraid/wg-ui/pkg/peer"
"github.com/UnAfraid/wg-ui/pkg/server"
"github.com/UnAfraid/wg-ui/pkg/user"
"github.com/graph-gophers/dataloader/v7"
)

var (
Expand Down
3 changes: 2 additions & 1 deletion pkg/api/internal/mutation/mutation_resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ package mutation
import (
"context"

"golang.zx2c4.com/wireguard/wgctrl/wgtypes"

"github.com/UnAfraid/wg-ui/pkg/api/internal/model"
"github.com/UnAfraid/wg-ui/pkg/api/internal/resolver"
"github.com/UnAfraid/wg-ui/pkg/auth"
"github.com/UnAfraid/wg-ui/pkg/manage"
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
)

type mutationResolver struct {
Expand Down
3 changes: 2 additions & 1 deletion pkg/api/internal/query/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ import (
"fmt"
"sync"

"github.com/graph-gophers/dataloader/v7"

"github.com/UnAfraid/wg-ui/pkg/api/internal/handler"
"github.com/UnAfraid/wg-ui/pkg/api/internal/model"
"github.com/UnAfraid/wg-ui/pkg/api/internal/resolver"
"github.com/UnAfraid/wg-ui/pkg/internal/adapt"
"github.com/graph-gophers/dataloader/v7"
)

func idsToStringIds(idKind model.IdKind, ids []*model.ID) ([]string, error) {
Expand Down
9 changes: 5 additions & 4 deletions pkg/api/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ import (
"github.com/99designs/gqlgen/graphql/handler/lru"
"github.com/99designs/gqlgen/graphql/handler/transport"
gqlplayground "github.com/99designs/gqlgen/graphql/playground"
"github.com/go-chi/chi/v5"
"github.com/gorilla/websocket"
"github.com/rs/cors"
"github.com/sirupsen/logrus"

"github.com/UnAfraid/wg-ui/pkg/api/internal/handler"
"github.com/UnAfraid/wg-ui/pkg/api/internal/resolver"
"github.com/UnAfraid/wg-ui/pkg/api/internal/tools/frontend"
Expand All @@ -23,10 +28,6 @@ import (
"github.com/UnAfraid/wg-ui/pkg/server"
"github.com/UnAfraid/wg-ui/pkg/user"
"github.com/UnAfraid/wg-ui/pkg/wg"
"github.com/go-chi/chi/v5"
"github.com/gorilla/websocket"
"github.com/rs/cors"
"github.com/sirupsen/logrus"
)

const (
Expand Down
3 changes: 2 additions & 1 deletion pkg/datastore/bbolt/peer_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ import (
"time"

"github.com/UnAfraid/searchindex"
"go.etcd.io/bbolt"

"github.com/UnAfraid/wg-ui/pkg/internal/adapt"
"github.com/UnAfraid/wg-ui/pkg/peer"
"go.etcd.io/bbolt"
)

const (
Expand Down
3 changes: 2 additions & 1 deletion pkg/datastore/bbolt/server_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ import (
"time"

"github.com/UnAfraid/searchindex"
"go.etcd.io/bbolt"

"github.com/UnAfraid/wg-ui/pkg/internal/adapt"
"github.com/UnAfraid/wg-ui/pkg/server"
"go.etcd.io/bbolt"
)

const (
Expand Down
3 changes: 2 additions & 1 deletion pkg/datastore/bbolt/user_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ import (
"time"

"github.com/UnAfraid/searchindex"
"github.com/UnAfraid/wg-ui/pkg/user"
"go.etcd.io/bbolt"

"github.com/UnAfraid/wg-ui/pkg/user"
)

const (
Expand Down
3 changes: 2 additions & 1 deletion pkg/manage/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ import (
"errors"
"time"

"github.com/sirupsen/logrus"

"github.com/UnAfraid/wg-ui/pkg/peer"
"github.com/UnAfraid/wg-ui/pkg/server"
"github.com/UnAfraid/wg-ui/pkg/user"
"github.com/UnAfraid/wg-ui/pkg/wg"
"github.com/sirupsen/logrus"
)

type Service interface {
Expand Down
5 changes: 3 additions & 2 deletions pkg/peer/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ import (
"strings"
"time"

"github.com/UnAfraid/wg-ui/pkg/server"
"github.com/UnAfraid/wg-ui/pkg/subscription"
"github.com/google/uuid"
"github.com/sirupsen/logrus"

"github.com/UnAfraid/wg-ui/pkg/server"
"github.com/UnAfraid/wg-ui/pkg/subscription"
)

var (
Expand Down
3 changes: 2 additions & 1 deletion pkg/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ import (
"strings"
"time"

"github.com/UnAfraid/wg-ui/pkg/internal/adapt"
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"

"github.com/UnAfraid/wg-ui/pkg/internal/adapt"
)

var namePattern = regexp.MustCompile("[a-zA-Z0-9.-_]{1,16}")
Expand Down
3 changes: 2 additions & 1 deletion pkg/server/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ import (
"strings"
"time"

"github.com/UnAfraid/wg-ui/pkg/subscription"
"github.com/google/uuid"
"github.com/sirupsen/logrus"
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"

"github.com/UnAfraid/wg-ui/pkg/subscription"
)

var (
Expand Down
3 changes: 2 additions & 1 deletion pkg/user/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ import (
"strings"
"time"

"github.com/UnAfraid/wg-ui/pkg/subscription"
"github.com/google/uuid"
"github.com/sirupsen/logrus"

"github.com/UnAfraid/wg-ui/pkg/subscription"
)

var (
Expand Down
3 changes: 2 additions & 1 deletion pkg/wg/interface_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ import (
"slices"
"strings"

"github.com/UnAfraid/wg-ui/pkg/server"
"github.com/sirupsen/logrus"
"github.com/vishvananda/netlink"

"github.com/UnAfraid/wg-ui/pkg/server"
)

func configureInterface(name string, address string, mtu int) error {
Expand Down
7 changes: 4 additions & 3 deletions pkg/wg/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ import (
"strings"
"time"

"github.com/UnAfraid/wg-ui/pkg/internal/adapt"
"github.com/UnAfraid/wg-ui/pkg/peer"
"github.com/UnAfraid/wg-ui/pkg/server"
"github.com/sirupsen/logrus"
"golang.zx2c4.com/wireguard/wgctrl"
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"

"github.com/UnAfraid/wg-ui/pkg/internal/adapt"
"github.com/UnAfraid/wg-ui/pkg/peer"
"github.com/UnAfraid/wg-ui/pkg/server"
)

const (
Expand Down

0 comments on commit 47a601d

Please sign in to comment.