Skip to content

Commit

Permalink
Add minimal import package
Browse files Browse the repository at this point in the history
  • Loading branch information
nekohasekai committed Jan 10, 2022
1 parent 0c7ae3c commit d432433
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 1 deletion.
2 changes: 1 addition & 1 deletion infra/vformat/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ func main() {
if strings.HasSuffix(filename, ".go") &&
!strings.HasSuffix(filename, ".pb.go") &&
!strings.Contains(dir, filepath.Join("testing", "mocks")) &&
!strings.Contains(path, filepath.Join("main", "distro", "all", "all.go")) {
!strings.Contains(path, filepath.Join("main", "distro", "all", "all.go", "minimal.go")) {

if changedFiles != nil && !changedFiles[path] {
return nil
Expand Down
73 changes: 73 additions & 0 deletions main/distro/mimimal/minimal.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
package mimimal

import (
// The following are necessary as they register handlers in their init functions.

// Mandatory features. Can't remove unless there are replacements.
_ "github.com/v2fly/v2ray-core/v5/app/dispatcher"
_ "github.com/v2fly/v2ray-core/v5/app/proxyman/inbound"
_ "github.com/v2fly/v2ray-core/v5/app/proxyman/outbound"

// Other optional features.
_ "github.com/v2fly/v2ray-core/v5/app/dns"
_ "github.com/v2fly/v2ray-core/v5/app/log"
_ "github.com/v2fly/v2ray-core/v5/app/policy"
_ "github.com/v2fly/v2ray-core/v5/app/reverse"
_ "github.com/v2fly/v2ray-core/v5/app/router"
_ "github.com/v2fly/v2ray-core/v5/app/stats"

// Fix dependency cycle caused by core import in internet package
_ "github.com/v2fly/v2ray-core/v5/transport/internet/tagged/taggedimpl"

// Developer preview features
_ "github.com/v2fly/v2ray-core/v5/app/observatory"

// Inbound and outbound proxies.
_ "github.com/v2fly/v2ray-core/v5/proxy/blackhole"
_ "github.com/v2fly/v2ray-core/v5/proxy/dns"
_ "github.com/v2fly/v2ray-core/v5/proxy/dokodemo"
_ "github.com/v2fly/v2ray-core/v5/proxy/freedom"
_ "github.com/v2fly/v2ray-core/v5/proxy/http"
_ "github.com/v2fly/v2ray-core/v5/proxy/shadowsocks"
_ "github.com/v2fly/v2ray-core/v5/proxy/shadowsocks/plugin/external"
_ "github.com/v2fly/v2ray-core/v5/proxy/shadowsocks/plugin/self"
_ "github.com/v2fly/v2ray-core/v5/proxy/socks"
_ "github.com/v2fly/v2ray-core/v5/proxy/trojan"
_ "github.com/v2fly/v2ray-core/v5/proxy/vless/inbound"
_ "github.com/v2fly/v2ray-core/v5/proxy/vless/outbound"
_ "github.com/v2fly/v2ray-core/v5/proxy/vmess/inbound"
_ "github.com/v2fly/v2ray-core/v5/proxy/vmess/outbound"

// Transports
_ "github.com/v2fly/v2ray-core/v5/transport/internet/domainsocket"
_ "github.com/v2fly/v2ray-core/v5/transport/internet/grpc"
_ "github.com/v2fly/v2ray-core/v5/transport/internet/http"
_ "github.com/v2fly/v2ray-core/v5/transport/internet/kcp"
_ "github.com/v2fly/v2ray-core/v5/transport/internet/quic"
_ "github.com/v2fly/v2ray-core/v5/transport/internet/tcp"
_ "github.com/v2fly/v2ray-core/v5/transport/internet/tls"
_ "github.com/v2fly/v2ray-core/v5/transport/internet/udp"
_ "github.com/v2fly/v2ray-core/v5/transport/internet/websocket"

// Transport headers
_ "github.com/v2fly/v2ray-core/v5/transport/internet/headers/http"
_ "github.com/v2fly/v2ray-core/v5/transport/internet/headers/noop"
_ "github.com/v2fly/v2ray-core/v5/transport/internet/headers/srtp"
_ "github.com/v2fly/v2ray-core/v5/transport/internet/headers/tls"
_ "github.com/v2fly/v2ray-core/v5/transport/internet/headers/utp"
_ "github.com/v2fly/v2ray-core/v5/transport/internet/headers/wechat"
_ "github.com/v2fly/v2ray-core/v5/transport/internet/headers/wireguard"

// Geo loaders
_ "github.com/v2fly/v2ray-core/v5/infra/conf/geodata/memconservative"
_ "github.com/v2fly/v2ray-core/v5/infra/conf/geodata/standard"

// JSON, TOML, YAML config support. (jsonv4) This disable selective compile
_ "github.com/v2fly/v2ray-core/v5/main/formats"

// Simplified config
_ "github.com/v2fly/v2ray-core/v5/proxy/http/simplified"
_ "github.com/v2fly/v2ray-core/v5/proxy/shadowsocks/simplified"
_ "github.com/v2fly/v2ray-core/v5/proxy/socks/simplified"
_ "github.com/v2fly/v2ray-core/v5/proxy/trojan/simplified"
)

0 comments on commit d432433

Please sign in to comment.