Skip to content

Commit

Permalink
Add missing deprecation notice to deprecated code (#437)
Browse files Browse the repository at this point in the history
  • Loading branch information
chinsyo authored Nov 20, 2020
1 parent 9c1f251 commit 231f5bf
Show file tree
Hide file tree
Showing 6 changed files with 119 additions and 96 deletions.
2 changes: 1 addition & 1 deletion features/inbound/inbound.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type Handler interface {
// The tag of this handler.
Tag() string

// Deprecated. Do not use in new code.
// Deprecated: Do not use in new code.
GetRandomInboundProxy() (interface{}, net.Port, int)
}

Expand Down
26 changes: 21 additions & 5 deletions infra/conf/v2ray.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,16 +329,32 @@ func (c *StatsConfig) Build() (*stats.Config, error) {
}

type Config struct {
Port uint16 `json:"port"` // Port of this Point server. Deprecated.
// Port of this Point server.
// Deprecated: Port exists for historical compatibility
// and should not be used.
Port uint16 `json:"port"`

// Deprecated: InboundConfig exists for historical compatibility
// and should not be used.
InboundConfig *InboundDetourConfig `json:"inbound"`

// Deprecated: OutboundConfig exists for historical compatibility
// and should not be used.
OutboundConfig *OutboundDetourConfig `json:"outbound"`

// Deprecated: InboundDetours exists for historical compatibility
// and should not be used.
InboundDetours []InboundDetourConfig `json:"inboundDetour"`

// Deprecated: OutboundDetours exists for historical compatibility
// and should not be used.
OutboundDetours []OutboundDetourConfig `json:"outboundDetour"`

LogConfig *LogConfig `json:"log"`
RouterConfig *RouterConfig `json:"routing"`
DNSConfig *DNSConfig `json:"dns"`
InboundConfigs []InboundDetourConfig `json:"inbounds"`
OutboundConfigs []OutboundDetourConfig `json:"outbounds"`
InboundConfig *InboundDetourConfig `json:"inbound"` // Deprecated.
OutboundConfig *OutboundDetourConfig `json:"outbound"` // Deprecated.
InboundDetours []InboundDetourConfig `json:"inboundDetour"` // Deprecated.
OutboundDetours []OutboundDetourConfig `json:"outboundDetour"` // Deprecated.
Transport *TransportConfig `json:"transport"`
Policy *PolicyConfig `json:"policy"`
API *APIConfig `json:"api"`
Expand Down
17 changes: 10 additions & 7 deletions transport/config.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions transport/config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ import "transport/internet/config.proto";
// Global transport settings. This affects all type of connections that go
// through V2Ray. Deprecated. Use each settings in StreamConfig.
message Config {
option deprecated = true;
repeated v2ray.core.transport.internet.TransportConfig transport_settings = 1;
}
Loading

0 comments on commit 231f5bf

Please sign in to comment.