| 1 | package confscip-go gomod v2ray.com/core . `v2ray.com/core/infra/conf`/ |
| 2 | |
| 3 | import ( |
| 4 | "github.com/golang/protobuf/protoscip-go gomod github.com/golang/protobuf v1.4.3 `github.com/golang/protobuf/proto`/" |
| 5 | "v2ray.com/core/app/reversescip-go gomod v2ray.com/core . `v2ray.com/core/app/reverse`/" |
| 6 | ) |
| 7 | |
| 8 | type BridgeConfigscip-go gomod v2ray.com/core . `v2ray.com/core/infra/conf`/BridgeConfig# struct { |
| 9 | Tagscip-go gomod v2ray.com/core . `v2ray.com/core/infra/conf`/BridgeConfig#Tag. string `json:"tag"` |
| 10 | Domainscip-go gomod v2ray.com/core . `v2ray.com/core/infra/conf`/BridgeConfig#Domain. string `json:"domain"` |
| 11 | } |
| 12 | |
| 13 | func (c *BridgeConfigscip-go gomod v2ray.com/core . `v2ray.com/core/infra/conf`/BridgeConfig#) Buildscip-go gomod v2ray.com/core . `v2ray.com/core/infra/conf`/BridgeConfig#Build().() (*reversescip-go gomod v2ray.com/core . `v2ray.com/core/app/reverse`/.BridgeConfigscip-go gomod v2ray.com/core . `v2ray.com/core/app/reverse`/BridgeConfig#, error) { |
| 14 | return &reversescip-go gomod v2ray.com/core . `v2ray.com/core/app/reverse`/.BridgeConfigscip-go gomod v2ray.com/core . `v2ray.com/core/app/reverse`/BridgeConfig#{ |
| 15 | Tagscip-go gomod v2ray.com/core . `v2ray.com/core/app/reverse`/BridgeConfig#Tag.: c.Tagscip-go gomod v2ray.com/core . `v2ray.com/core/infra/conf`/BridgeConfig#Tag., |
| 16 | Domainscip-go gomod v2ray.com/core . `v2ray.com/core/app/reverse`/BridgeConfig#Domain.: c.Domainscip-go gomod v2ray.com/core . `v2ray.com/core/infra/conf`/BridgeConfig#Domain., |
| 17 | }, nil |
| 18 | } |
| 19 | |
| 20 | type PortalConfigscip-go gomod v2ray.com/core . `v2ray.com/core/infra/conf`/PortalConfig# struct { |
| 21 | Tagscip-go gomod v2ray.com/core . `v2ray.com/core/infra/conf`/PortalConfig#Tag. string `json:"tag"` |
| 22 | Domainscip-go gomod v2ray.com/core . `v2ray.com/core/infra/conf`/PortalConfig#Domain. string `json:"domain"` |
| 23 | } |
| 24 | |
| 25 | func (c *PortalConfigscip-go gomod v2ray.com/core . `v2ray.com/core/infra/conf`/PortalConfig#) Buildscip-go gomod v2ray.com/core . `v2ray.com/core/infra/conf`/PortalConfig#Build().() (*reversescip-go gomod v2ray.com/core . `v2ray.com/core/app/reverse`/.PortalConfigscip-go gomod v2ray.com/core . `v2ray.com/core/app/reverse`/PortalConfig#, error) { |
| 26 | return &reversescip-go gomod v2ray.com/core . `v2ray.com/core/app/reverse`/.PortalConfigscip-go gomod v2ray.com/core . `v2ray.com/core/app/reverse`/PortalConfig#{ |
| 27 | Tagscip-go gomod v2ray.com/core . `v2ray.com/core/app/reverse`/PortalConfig#Tag.: c.Tagscip-go gomod v2ray.com/core . `v2ray.com/core/infra/conf`/PortalConfig#Tag., |
| 28 | Domainscip-go gomod v2ray.com/core . `v2ray.com/core/app/reverse`/PortalConfig#Domain.: c.Domainscip-go gomod v2ray.com/core . `v2ray.com/core/infra/conf`/PortalConfig#Domain., |
| 29 | }, nil |
| 30 | } |
| 31 | |
| 32 | type ReverseConfigscip-go gomod v2ray.com/core . `v2ray.com/core/infra/conf`/ReverseConfig# struct { |
| 33 | Bridgesscip-go gomod v2ray.com/core . `v2ray.com/core/infra/conf`/ReverseConfig#Bridges. []BridgeConfigscip-go gomod v2ray.com/core . `v2ray.com/core/infra/conf`/BridgeConfig# `json:"bridges"` |
| 34 | Portalsscip-go gomod v2ray.com/core . `v2ray.com/core/infra/conf`/ReverseConfig#Portals. []PortalConfigscip-go gomod v2ray.com/core . `v2ray.com/core/infra/conf`/PortalConfig# `json:"portals"` |
| 35 | } |
| 36 | |
| 37 | func (c *ReverseConfigscip-go gomod v2ray.com/core . `v2ray.com/core/infra/conf`/ReverseConfig#) Buildscip-go gomod v2ray.com/core . `v2ray.com/core/infra/conf`/ReverseConfig#Build().() (protoscip-go gomod github.com/golang/protobuf v1.4.3 `github.com/golang/protobuf/proto`/.Messagescip-go gomod github.com/golang/protobuf v1.4.3 `github.com/golang/protobuf/proto`/Message#, error) { |
| 38 | config := &reversescip-go gomod v2ray.com/core . `v2ray.com/core/app/reverse`/.Configscip-go gomod v2ray.com/core . `v2ray.com/core/app/reverse`/Config#{} |
| 39 | for _, bconfig := range c.Bridgesscip-go gomod v2ray.com/core . `v2ray.com/core/infra/conf`/ReverseConfig#Bridges. { |
| 40 | b, err := bconfig.Buildscip-go gomod v2ray.com/core . `v2ray.com/core/infra/conf`/BridgeConfig#Build().() |
| 41 | if err != nil { |
| 42 | return nil, err |
| 43 | } |
| 44 | config.BridgeConfigscip-go gomod v2ray.com/core . `v2ray.com/core/app/reverse`/Config#BridgeConfig. = append(config.BridgeConfigscip-go gomod v2ray.com/core . `v2ray.com/core/app/reverse`/Config#BridgeConfig., b) |
| 45 | } |
| 46 | |
| 47 | for _, pconfig := range c.Portalsscip-go gomod v2ray.com/core . `v2ray.com/core/infra/conf`/ReverseConfig#Portals. { |
| 48 | p, err := pconfig.Buildscip-go gomod v2ray.com/core . `v2ray.com/core/infra/conf`/PortalConfig#Build().() |
| 49 | if err != nil { |
| 50 | return nil, err |
| 51 | } |
| 52 | config.PortalConfigscip-go gomod v2ray.com/core . `v2ray.com/core/app/reverse`/Config#PortalConfig. = append(config.PortalConfigscip-go gomod v2ray.com/core . `v2ray.com/core/app/reverse`/Config#PortalConfig., p) |
| 53 | } |
| 54 | |
| 55 | return config, nil |
| 56 | } |