MCPcopy Create free account
hub / github.com/PasarGuard/node / NewConfig

Function NewConfig

backend/xray/config.go:816–835  ·  view source on GitHub ↗
(config string, exclude []string)

Source from the content-addressed store, hash-verified

814}
815
816func NewConfig(config string, exclude []string) (*Config, error) {
817 var xrayConfig Config
818 err := json.Unmarshal([]byte(config), &xrayConfig)
819 if err != nil {
820 return nil, err
821 }
822
823 for _, i := range xrayConfig.InboundConfigs {
824 if i.clients == nil {
825 i.clients = make(map[string]api.Account)
826 }
827 if slices.Contains(exclude, i.Tag) {
828 i.mu.Lock()
829 i.exclude = true
830 i.mu.Unlock()
831 }
832 }
833
834 return &xrayConfig, nil
835}

Callers 3

StartBackendMethod · 0.92
TestXrayBackendFunction · 0.70

Calls

no outgoing calls

Tested by 2

TestXrayBackendFunction · 0.56