mirror of
https://github.com/nitezs/sub2clash.git
synced 2024-12-23 06:44:41 -05:00
🎨 Refactor package for public import
This commit is contained in:
parent
3cfa4bdf24
commit
e504a6cca4
@ -2,9 +2,10 @@ package handler
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"sub2clash/config"
|
||||
"sub2clash/model"
|
||||
"sub2clash/validator"
|
||||
|
||||
"github.com/nitezs/sub2clash/config"
|
||||
"github.com/nitezs/sub2clash/model"
|
||||
"github.com/nitezs/sub2clash/validator"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"gopkg.in/yaml.v3"
|
||||
|
@ -9,11 +9,12 @@ import (
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sub2clash/common"
|
||||
"sub2clash/logger"
|
||||
"sub2clash/model"
|
||||
"sub2clash/parser"
|
||||
"sub2clash/validator"
|
||||
|
||||
"github.com/nitezs/sub2clash/common"
|
||||
"github.com/nitezs/sub2clash/logger"
|
||||
"github.com/nitezs/sub2clash/model"
|
||||
"github.com/nitezs/sub2clash/parser"
|
||||
"github.com/nitezs/sub2clash/validator"
|
||||
|
||||
"go.uber.org/zap"
|
||||
"gopkg.in/yaml.v3"
|
||||
|
@ -3,9 +3,10 @@ package handler
|
||||
import (
|
||||
_ "embed"
|
||||
"net/http"
|
||||
"sub2clash/config"
|
||||
"sub2clash/model"
|
||||
"sub2clash/validator"
|
||||
|
||||
"github.com/nitezs/sub2clash/config"
|
||||
"github.com/nitezs/sub2clash/model"
|
||||
"github.com/nitezs/sub2clash/validator"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"gopkg.in/yaml.v3"
|
||||
|
@ -7,11 +7,11 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"sub2clash/common"
|
||||
"sub2clash/common/database"
|
||||
"sub2clash/config"
|
||||
"sub2clash/model"
|
||||
"sub2clash/validator"
|
||||
"github.com/nitezs/sub2clash/common"
|
||||
"github.com/nitezs/sub2clash/common/database"
|
||||
"github.com/nitezs/sub2clash/config"
|
||||
"github.com/nitezs/sub2clash/model"
|
||||
"github.com/nitezs/sub2clash/validator"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
@ -5,9 +5,10 @@ import (
|
||||
"html/template"
|
||||
"log"
|
||||
"net/http"
|
||||
"sub2clash/api/handler"
|
||||
"sub2clash/constant"
|
||||
"sub2clash/middleware"
|
||||
|
||||
"github.com/nitezs/sub2clash/api/handler"
|
||||
"github.com/nitezs/sub2clash/constant"
|
||||
"github.com/nitezs/sub2clash/middleware"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
@ -5,7 +5,7 @@ import (
|
||||
"errors"
|
||||
"path/filepath"
|
||||
|
||||
"sub2clash/model"
|
||||
"github.com/nitezs/sub2clash/model"
|
||||
|
||||
"go.etcd.io/bbolt"
|
||||
)
|
||||
|
@ -3,8 +3,9 @@ package common
|
||||
import (
|
||||
"errors"
|
||||
"net/http"
|
||||
"sub2clash/config"
|
||||
"time"
|
||||
|
||||
"github.com/nitezs/sub2clash/config"
|
||||
)
|
||||
|
||||
type GetConfig struct {
|
||||
|
@ -2,10 +2,11 @@ package common
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"sub2clash/constant"
|
||||
"sub2clash/logger"
|
||||
"sub2clash/model"
|
||||
"sub2clash/parser"
|
||||
|
||||
"github.com/nitezs/sub2clash/constant"
|
||||
"github.com/nitezs/sub2clash/logger"
|
||||
"github.com/nitezs/sub2clash/model"
|
||||
"github.com/nitezs/sub2clash/parser"
|
||||
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
@ -3,7 +3,8 @@ package common
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"sub2clash/model"
|
||||
|
||||
"github.com/nitezs/sub2clash/model"
|
||||
)
|
||||
|
||||
func PrependRuleProvider(
|
||||
|
@ -8,9 +8,10 @@ import (
|
||||
"net/http"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"sub2clash/config"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/nitezs/sub2clash/config"
|
||||
)
|
||||
|
||||
var subsDir = "subs"
|
||||
|
@ -3,7 +3,8 @@ package common
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"sub2clash/config"
|
||||
|
||||
"github.com/nitezs/sub2clash/config"
|
||||
)
|
||||
|
||||
func writeTemplate(path string, template string) error {
|
||||
|
11
main.go
11
main.go
@ -4,11 +4,12 @@ import (
|
||||
_ "embed"
|
||||
"io"
|
||||
"strconv"
|
||||
"sub2clash/api"
|
||||
"sub2clash/common"
|
||||
"sub2clash/common/database"
|
||||
"sub2clash/config"
|
||||
"sub2clash/logger"
|
||||
|
||||
"github.com/nitezs/sub2clash/api"
|
||||
"github.com/nitezs/sub2clash/common"
|
||||
"github.com/nitezs/sub2clash/common/database"
|
||||
"github.com/nitezs/sub2clash/config"
|
||||
"github.com/nitezs/sub2clash/logger"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"go.uber.org/zap"
|
||||
|
@ -2,9 +2,10 @@ package middleware
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
"sub2clash/logger"
|
||||
"time"
|
||||
|
||||
"github.com/nitezs/sub2clash/logger"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
@ -5,8 +5,9 @@ import (
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sub2clash/constant"
|
||||
"sub2clash/model"
|
||||
|
||||
"github.com/nitezs/sub2clash/constant"
|
||||
"github.com/nitezs/sub2clash/model"
|
||||
)
|
||||
|
||||
func ParseHysteria(proxy string) (model.Proxy, error) {
|
||||
|
@ -4,8 +4,9 @@ import (
|
||||
"fmt"
|
||||
"net/url"
|
||||
"strings"
|
||||
"sub2clash/constant"
|
||||
"sub2clash/model"
|
||||
|
||||
"github.com/nitezs/sub2clash/constant"
|
||||
"github.com/nitezs/sub2clash/model"
|
||||
)
|
||||
|
||||
func ParseHysteria2(proxy string) (model.Proxy, error) {
|
||||
|
@ -4,8 +4,9 @@ import (
|
||||
"fmt"
|
||||
"net/url"
|
||||
"strings"
|
||||
"sub2clash/constant"
|
||||
"sub2clash/model"
|
||||
|
||||
"github.com/nitezs/sub2clash/constant"
|
||||
"github.com/nitezs/sub2clash/model"
|
||||
)
|
||||
|
||||
func ParseShadowsocks(proxy string) (model.Proxy, error) {
|
||||
|
@ -4,8 +4,9 @@ import (
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sub2clash/constant"
|
||||
"sub2clash/model"
|
||||
|
||||
"github.com/nitezs/sub2clash/constant"
|
||||
"github.com/nitezs/sub2clash/model"
|
||||
)
|
||||
|
||||
func ParseShadowsocksR(proxy string) (model.Proxy, error) {
|
||||
|
@ -4,8 +4,9 @@ import (
|
||||
"fmt"
|
||||
"net/url"
|
||||
"strings"
|
||||
"sub2clash/constant"
|
||||
"sub2clash/model"
|
||||
|
||||
"github.com/nitezs/sub2clash/constant"
|
||||
"github.com/nitezs/sub2clash/model"
|
||||
)
|
||||
|
||||
func ParseTrojan(proxy string) (model.Proxy, error) {
|
||||
|
@ -4,8 +4,9 @@ import (
|
||||
"fmt"
|
||||
"net/url"
|
||||
"strings"
|
||||
"sub2clash/constant"
|
||||
"sub2clash/model"
|
||||
|
||||
"github.com/nitezs/sub2clash/constant"
|
||||
"github.com/nitezs/sub2clash/model"
|
||||
)
|
||||
|
||||
func ParseVless(proxy string) (model.Proxy, error) {
|
||||
|
@ -5,8 +5,9 @@ import (
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sub2clash/constant"
|
||||
"sub2clash/model"
|
||||
|
||||
"github.com/nitezs/sub2clash/constant"
|
||||
"github.com/nitezs/sub2clash/model"
|
||||
)
|
||||
|
||||
func ParseVmess(proxy string) (model.Proxy, error) {
|
||||
|
Loading…
Reference in New Issue
Block a user