Skip to content

Commit

Permalink
remove unused pkg
Browse files Browse the repository at this point in the history
  • Loading branch information
vcptr committed Dec 14, 2019
1 parent 1e76123 commit 61e95e0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 64 deletions.
48 changes: 0 additions & 48 deletions infra/conf/command/command.go

This file was deleted.

9 changes: 0 additions & 9 deletions infra/conf/command/errors.generated.go

This file was deleted.

15 changes: 8 additions & 7 deletions infra/control/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,27 @@ import (
"v2ray.com/core/infra/conf/serial"
)

type MconfigCommand struct{}
type ConfigCommand struct{}

func (c *MconfigCommand) Name() string {
func (c *ConfigCommand) Name() string {
return "config"
}

func (c *MconfigCommand) Description() Description {
func (c *ConfigCommand) Description() Description {
return Description{
Short: "merge multiple json config",
Usage: []string{"v2ctl mconfig 1.json 2.json <url>.json"},
Usage: []string{"v2ctl config config.json c1.json c2.json <url>.json"},
}
}

func (c *MconfigCommand) Execute(args []string) error {
func (c *ConfigCommand) Execute(args []string) error {
if len(args) < 1 {
return newError("empty config list")
}

conf := &conf.Config{}
for _, arg := range args {
newError("Reading config: ", arg).AtInfo().WriteToLog()
r, err := c.LoadArg(arg)
common.Must(err)
c, err := serial.DecodeJSONConfig(r)
Expand All @@ -57,7 +58,7 @@ func (c *MconfigCommand) Execute(args []string) error {
return nil
}

func (c *MconfigCommand) LoadArg(arg string) (out io.Reader, err error) {
func (c *ConfigCommand) LoadArg(arg string) (out io.Reader, err error) {

var data []byte
if strings.HasPrefix(arg, "http://") || strings.HasPrefix(arg, "https://") {
Expand All @@ -74,5 +75,5 @@ func (c *MconfigCommand) LoadArg(arg string) (out io.Reader, err error) {
}

func init() {
common.Must(RegisterCommand(&MconfigCommand{}))
common.Must(RegisterCommand(&ConfigCommand{}))
}

0 comments on commit 61e95e0

Please sign in to comment.