mirror of
https://github.com/singchia/frontier.git
synced 2025-09-26 20:31:25 +08:00
refactor: change pkg directory for frontlas
This commit is contained in:
2
Makefile
2
Makefile
@@ -27,7 +27,7 @@ install:
|
||||
install -m 0755 -d $(DESTDIR)$(BINDIR)
|
||||
install -m 0755 -d $(DESTDIR)$(CONFDIR)
|
||||
install -m 0755 ./frontier $(DESTDIR)$(BINDIR)
|
||||
install -m 0755 ./pkg/config/frontier.yaml $(DESTDIR)$(CONFDIR)
|
||||
install -m 0755 ./pkg/frontier/config/frontier.yaml $(DESTDIR)$(CONFDIR)
|
||||
|
||||
.PHONY: image
|
||||
image:
|
||||
|
@@ -6,7 +6,7 @@ import (
|
||||
"encoding/json"
|
||||
"strconv"
|
||||
|
||||
"github.com/singchia/frontier/pkg/apis"
|
||||
"github.com/singchia/frontier/pkg/frontier/apis"
|
||||
"github.com/singchia/geminio"
|
||||
"github.com/singchia/geminio/client"
|
||||
"github.com/singchia/geminio/options"
|
||||
|
@@ -7,11 +7,11 @@ import (
|
||||
"runtime"
|
||||
|
||||
"github.com/jumboframes/armorigo/sigaction"
|
||||
"github.com/singchia/frontier/pkg/apis"
|
||||
"github.com/singchia/frontier/pkg/config"
|
||||
"github.com/singchia/frontier/pkg/mq"
|
||||
"github.com/singchia/frontier/pkg/repo"
|
||||
"github.com/singchia/frontier/pkg/server"
|
||||
"github.com/singchia/frontier/pkg/frontier/apis"
|
||||
"github.com/singchia/frontier/pkg/frontier/config"
|
||||
"github.com/singchia/frontier/pkg/frontier/mq"
|
||||
"github.com/singchia/frontier/pkg/frontier/repo"
|
||||
"github.com/singchia/frontier/pkg/frontier/server"
|
||||
"github.com/singchia/frontier/pkg/utils"
|
||||
"k8s.io/klog/v2"
|
||||
)
|
||||
|
@@ -3,4 +3,4 @@ FROM golang:1.18-alpine
|
||||
RUN go install github.com/swaggo/swag/cmd/swag@latest
|
||||
|
||||
WORKDIR /frontier
|
||||
CMD swag init -g pkg/controlplane/service/cp_service.go --output docs/swagger/
|
||||
CMD swag init -g pkg/frontier/controlplane/service/cp_service.go --output docs/swagger/
|
@@ -3,8 +3,8 @@ package apis
|
||||
import (
|
||||
"net"
|
||||
|
||||
"github.com/singchia/frontier/pkg/repo/dao"
|
||||
"github.com/singchia/frontier/pkg/repo/model"
|
||||
"github.com/singchia/frontier/pkg/frontier/repo/dao"
|
||||
"github.com/singchia/frontier/pkg/frontier/repo/model"
|
||||
"github.com/singchia/geminio"
|
||||
)
|
||||
|
@@ -7,10 +7,10 @@ import (
|
||||
"os"
|
||||
|
||||
"github.com/go-kratos/kratos/v2"
|
||||
"github.com/singchia/frontier/pkg/apis"
|
||||
"github.com/singchia/frontier/pkg/config"
|
||||
"github.com/singchia/frontier/pkg/controlplane/server"
|
||||
"github.com/singchia/frontier/pkg/controlplane/service"
|
||||
"github.com/singchia/frontier/pkg/frontier/apis"
|
||||
"github.com/singchia/frontier/pkg/frontier/config"
|
||||
"github.com/singchia/frontier/pkg/frontier/controlplane/server"
|
||||
"github.com/singchia/frontier/pkg/frontier/controlplane/service"
|
||||
"github.com/singchia/frontier/pkg/security"
|
||||
"github.com/soheilhy/cmux"
|
||||
"k8s.io/klog/v2"
|
@@ -4,7 +4,7 @@ import (
|
||||
"context"
|
||||
|
||||
v1 "github.com/singchia/frontier/api/controlplane/v1"
|
||||
"github.com/singchia/frontier/pkg/apis"
|
||||
"github.com/singchia/frontier/pkg/frontier/apis"
|
||||
)
|
||||
|
||||
// @title Frontier Swagger API
|
@@ -4,8 +4,8 @@ import (
|
||||
"context"
|
||||
|
||||
v1 "github.com/singchia/frontier/api/controlplane/v1"
|
||||
"github.com/singchia/frontier/pkg/repo/dao"
|
||||
"github.com/singchia/frontier/pkg/repo/model"
|
||||
"github.com/singchia/frontier/pkg/frontier/repo/dao"
|
||||
"github.com/singchia/frontier/pkg/frontier/repo/model"
|
||||
)
|
||||
|
||||
func (cps *ControlPlaneService) listEdges(_ context.Context, req *v1.ListEdgesRequest) (*v1.ListEdgesResponse, error) {
|
@@ -4,8 +4,8 @@ import (
|
||||
"context"
|
||||
|
||||
v1 "github.com/singchia/frontier/api/controlplane/v1"
|
||||
"github.com/singchia/frontier/pkg/repo/dao"
|
||||
"github.com/singchia/frontier/pkg/repo/model"
|
||||
"github.com/singchia/frontier/pkg/frontier/repo/dao"
|
||||
"github.com/singchia/frontier/pkg/frontier/repo/model"
|
||||
)
|
||||
|
||||
func (cps *ControlPlaneService) listServices(_ context.Context, req *v1.ListServicesRequest) (*v1.ListServicesResponse, error) {
|
@@ -6,8 +6,8 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/singchia/frontier/api/dataplane/v1/edge"
|
||||
"github.com/singchia/frontier/pkg/config"
|
||||
"github.com/singchia/frontier/pkg/repo/dao"
|
||||
"github.com/singchia/frontier/pkg/frontier/config"
|
||||
"github.com/singchia/frontier/pkg/frontier/repo/dao"
|
||||
"github.com/singchia/go-timer/v2"
|
||||
)
|
||||
|
@@ -12,8 +12,8 @@ import (
|
||||
"github.com/jumboframes/armorigo/log"
|
||||
"github.com/jumboframes/armorigo/rproxy"
|
||||
"github.com/jumboframes/armorigo/synchub"
|
||||
"github.com/singchia/frontier/pkg/apis"
|
||||
"github.com/singchia/frontier/pkg/config"
|
||||
"github.com/singchia/frontier/pkg/frontier/apis"
|
||||
"github.com/singchia/frontier/pkg/frontier/config"
|
||||
"github.com/singchia/frontier/pkg/mapmap"
|
||||
"github.com/singchia/frontier/pkg/security"
|
||||
"github.com/singchia/frontier/pkg/utils"
|
@@ -6,8 +6,8 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/singchia/frontier/api/dataplane/v1/edge"
|
||||
"github.com/singchia/frontier/pkg/config"
|
||||
"github.com/singchia/frontier/pkg/repo/dao"
|
||||
"github.com/singchia/frontier/pkg/frontier/config"
|
||||
"github.com/singchia/frontier/pkg/frontier/repo/dao"
|
||||
"github.com/singchia/go-timer/v2"
|
||||
)
|
||||
|
@@ -6,9 +6,9 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/jumboframes/armorigo/synchub"
|
||||
"github.com/singchia/frontier/pkg/apis"
|
||||
"github.com/singchia/frontier/pkg/repo/dao"
|
||||
"github.com/singchia/frontier/pkg/repo/model"
|
||||
"github.com/singchia/frontier/pkg/frontier/apis"
|
||||
"github.com/singchia/frontier/pkg/frontier/repo/dao"
|
||||
"github.com/singchia/frontier/pkg/frontier/repo/model"
|
||||
"github.com/singchia/geminio"
|
||||
"github.com/singchia/geminio/delegate"
|
||||
"k8s.io/klog/v2"
|
@@ -1,8 +1,8 @@
|
||||
package exchange
|
||||
|
||||
import (
|
||||
"github.com/singchia/frontier/pkg/apis"
|
||||
"github.com/singchia/frontier/pkg/config"
|
||||
"github.com/singchia/frontier/pkg/frontier/apis"
|
||||
"github.com/singchia/frontier/pkg/frontier/config"
|
||||
)
|
||||
|
||||
type exchange struct {
|
@@ -5,7 +5,7 @@ import (
|
||||
"encoding/binary"
|
||||
"io"
|
||||
|
||||
"github.com/singchia/frontier/pkg/apis"
|
||||
"github.com/singchia/frontier/pkg/frontier/apis"
|
||||
"github.com/singchia/geminio"
|
||||
"github.com/singchia/geminio/options"
|
||||
"k8s.io/klog/v2"
|
@@ -6,7 +6,7 @@ import (
|
||||
"encoding/json"
|
||||
"net"
|
||||
|
||||
"github.com/singchia/frontier/pkg/apis"
|
||||
"github.com/singchia/frontier/pkg/frontier/apis"
|
||||
|
||||
"k8s.io/klog/v2"
|
||||
)
|
@@ -6,8 +6,8 @@ import (
|
||||
|
||||
"github.com/google/uuid"
|
||||
amqp "github.com/rabbitmq/amqp091-go"
|
||||
"github.com/singchia/frontier/pkg/apis"
|
||||
"github.com/singchia/frontier/pkg/config"
|
||||
"github.com/singchia/frontier/pkg/frontier/apis"
|
||||
"github.com/singchia/frontier/pkg/frontier/config"
|
||||
"k8s.io/klog/v2"
|
||||
)
|
||||
|
@@ -4,8 +4,8 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/IBM/sarama"
|
||||
"github.com/singchia/frontier/pkg/apis"
|
||||
"github.com/singchia/frontier/pkg/config"
|
||||
"github.com/singchia/frontier/pkg/frontier/apis"
|
||||
"github.com/singchia/frontier/pkg/frontier/config"
|
||||
"github.com/singchia/geminio"
|
||||
"k8s.io/klog/v2"
|
||||
)
|
@@ -4,8 +4,8 @@ import (
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
|
||||
"github.com/singchia/frontier/pkg/apis"
|
||||
"github.com/singchia/frontier/pkg/config"
|
||||
"github.com/singchia/frontier/pkg/frontier/apis"
|
||||
"github.com/singchia/frontier/pkg/frontier/config"
|
||||
"github.com/singchia/geminio"
|
||||
"k8s.io/klog/v2"
|
||||
)
|
@@ -6,8 +6,8 @@ import (
|
||||
|
||||
"github.com/nats-io/nats.go"
|
||||
"github.com/nats-io/nats.go/jetstream"
|
||||
"github.com/singchia/frontier/pkg/apis"
|
||||
"github.com/singchia/frontier/pkg/config"
|
||||
"github.com/singchia/frontier/pkg/frontier/apis"
|
||||
"github.com/singchia/frontier/pkg/frontier/config"
|
||||
"k8s.io/klog/v2"
|
||||
)
|
||||
|
@@ -2,8 +2,8 @@ package mq
|
||||
|
||||
import (
|
||||
"github.com/nsqio/go-nsq"
|
||||
"github.com/singchia/frontier/pkg/apis"
|
||||
"github.com/singchia/frontier/pkg/config"
|
||||
"github.com/singchia/frontier/pkg/frontier/apis"
|
||||
"github.com/singchia/frontier/pkg/frontier/config"
|
||||
)
|
||||
|
||||
type mqNSQ struct {
|
@@ -4,8 +4,8 @@ import (
|
||||
"context"
|
||||
|
||||
"github.com/redis/go-redis/v9"
|
||||
"github.com/singchia/frontier/pkg/apis"
|
||||
"github.com/singchia/frontier/pkg/config"
|
||||
"github.com/singchia/frontier/pkg/frontier/apis"
|
||||
"github.com/singchia/frontier/pkg/frontier/config"
|
||||
)
|
||||
|
||||
type mqRedis struct {
|
@@ -4,7 +4,7 @@ import (
|
||||
"context"
|
||||
"encoding/binary"
|
||||
|
||||
"github.com/singchia/frontier/pkg/apis"
|
||||
"github.com/singchia/frontier/pkg/frontier/apis"
|
||||
"github.com/singchia/geminio"
|
||||
"github.com/singchia/geminio/options"
|
||||
"k8s.io/klog/v2"
|
@@ -1,8 +1,8 @@
|
||||
package dao
|
||||
|
||||
import (
|
||||
"github.com/singchia/frontier/pkg/config"
|
||||
"github.com/singchia/frontier/pkg/repo/model"
|
||||
"github.com/singchia/frontier/pkg/frontier/config"
|
||||
"github.com/singchia/frontier/pkg/frontier/repo/model"
|
||||
"gorm.io/driver/sqlite"
|
||||
"gorm.io/gorm"
|
||||
"k8s.io/klog/v2"
|
@@ -1,7 +1,7 @@
|
||||
package dao
|
||||
|
||||
import (
|
||||
"github.com/singchia/frontier/pkg/repo/model"
|
||||
"github.com/singchia/frontier/pkg/frontier/repo/model"
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/clause"
|
||||
)
|
@@ -7,8 +7,8 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/singchia/frontier/pkg/config"
|
||||
"github.com/singchia/frontier/pkg/repo/model"
|
||||
"github.com/singchia/frontier/pkg/frontier/config"
|
||||
"github.com/singchia/frontier/pkg/frontier/repo/model"
|
||||
)
|
||||
|
||||
func TestCreateEdge(t *testing.T) {
|
@@ -1,7 +1,7 @@
|
||||
package dao
|
||||
|
||||
import (
|
||||
"github.com/singchia/frontier/pkg/repo/model"
|
||||
"github.com/singchia/frontier/pkg/frontier/repo/model"
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/clause"
|
||||
)
|
@@ -5,8 +5,8 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/singchia/frontier/pkg/config"
|
||||
"github.com/singchia/frontier/pkg/repo/model"
|
||||
"github.com/singchia/frontier/pkg/frontier/config"
|
||||
"github.com/singchia/frontier/pkg/frontier/repo/model"
|
||||
)
|
||||
|
||||
func TestListServices(t *testing.T) {
|
11
pkg/frontier/repo/repo.go
Normal file
11
pkg/frontier/repo/repo.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package repo
|
||||
|
||||
import (
|
||||
"github.com/singchia/frontier/pkg/frontier/apis"
|
||||
"github.com/singchia/frontier/pkg/frontier/config"
|
||||
"github.com/singchia/frontier/pkg/frontier/repo/dao"
|
||||
)
|
||||
|
||||
func NewRepo(config *config.Configuration) (apis.Repo, error) {
|
||||
return dao.NewDao(config)
|
||||
}
|
@@ -1,12 +1,12 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"github.com/singchia/frontier/pkg/apis"
|
||||
"github.com/singchia/frontier/pkg/config"
|
||||
"github.com/singchia/frontier/pkg/controlplane"
|
||||
"github.com/singchia/frontier/pkg/edgebound"
|
||||
"github.com/singchia/frontier/pkg/exchange"
|
||||
"github.com/singchia/frontier/pkg/servicebound"
|
||||
"github.com/singchia/frontier/pkg/frontier/apis"
|
||||
"github.com/singchia/frontier/pkg/frontier/config"
|
||||
"github.com/singchia/frontier/pkg/frontier/controlplane"
|
||||
"github.com/singchia/frontier/pkg/frontier/edgebound"
|
||||
"github.com/singchia/frontier/pkg/frontier/exchange"
|
||||
"github.com/singchia/frontier/pkg/frontier/servicebound"
|
||||
"github.com/singchia/go-timer/v2"
|
||||
"k8s.io/klog/v2"
|
||||
)
|
@@ -1,7 +1,7 @@
|
||||
package servicebound
|
||||
|
||||
import (
|
||||
"github.com/singchia/frontier/pkg/apis"
|
||||
"github.com/singchia/frontier/pkg/frontier/apis"
|
||||
"github.com/singchia/geminio"
|
||||
"k8s.io/klog/v2"
|
||||
)
|
@@ -12,10 +12,10 @@ import (
|
||||
|
||||
"github.com/jumboframes/armorigo/log"
|
||||
"github.com/jumboframes/armorigo/synchub"
|
||||
"github.com/singchia/frontier/pkg/apis"
|
||||
"github.com/singchia/frontier/pkg/config"
|
||||
"github.com/singchia/frontier/pkg/frontier/apis"
|
||||
"github.com/singchia/frontier/pkg/frontier/config"
|
||||
"github.com/singchia/frontier/pkg/frontier/repo/model"
|
||||
"github.com/singchia/frontier/pkg/mapmap"
|
||||
"github.com/singchia/frontier/pkg/repo/model"
|
||||
"github.com/singchia/frontier/pkg/security"
|
||||
"github.com/singchia/frontier/pkg/utils"
|
||||
"github.com/singchia/geminio"
|
@@ -6,8 +6,8 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/singchia/frontier/api/dataplane/v1/service"
|
||||
"github.com/singchia/frontier/pkg/config"
|
||||
"github.com/singchia/frontier/pkg/repo/dao"
|
||||
"github.com/singchia/frontier/pkg/frontier/config"
|
||||
"github.com/singchia/frontier/pkg/frontier/repo/dao"
|
||||
"github.com/singchia/go-timer/v2"
|
||||
)
|
||||
|
@@ -6,9 +6,9 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/jumboframes/armorigo/synchub"
|
||||
"github.com/singchia/frontier/pkg/apis"
|
||||
"github.com/singchia/frontier/pkg/repo/dao"
|
||||
"github.com/singchia/frontier/pkg/repo/model"
|
||||
"github.com/singchia/frontier/pkg/frontier/apis"
|
||||
"github.com/singchia/frontier/pkg/frontier/repo/dao"
|
||||
"github.com/singchia/frontier/pkg/frontier/repo/model"
|
||||
"github.com/singchia/geminio"
|
||||
"github.com/singchia/geminio/delegate"
|
||||
"k8s.io/klog/v2"
|
@@ -1,11 +0,0 @@
|
||||
package repo
|
||||
|
||||
import (
|
||||
"github.com/singchia/frontier/pkg/apis"
|
||||
"github.com/singchia/frontier/pkg/config"
|
||||
"github.com/singchia/frontier/pkg/repo/dao"
|
||||
)
|
||||
|
||||
func NewRepo(config *config.Configuration) (apis.Repo, error) {
|
||||
return dao.NewDao(config)
|
||||
}
|
Reference in New Issue
Block a user