MCPcopy Index your code
hub / github.com/1Panel-dev/1Panel / LoadServiceName

Function LoadServiceName

core/utils/controller/controller.go:172–188  ·  view source on GitHub ↗
(keyword string)

Source from the content-addressed store, hash-verified

170}
171
172func LoadServiceName(keyword string) (string, error) {
173 client, err := New()
174 if err != nil {
175 return "", err
176 }
177
178 processedName := loadProcessedName(client.Name(), keyword)
179 exist, _ := client.IsExist(processedName)
180 if exist {
181 return processedName, nil
182 }
183 alistName := loadFromPredefined(client, keyword)
184 if len(alistName) != 0 {
185 return alistName, nil
186 }
187 return "", fmt.Errorf("find such service for %s failed", keyword)
188}
189
190func loadProcessedName(mgr, keyword string) string {
191 keyword = strings.ToLower(keyword)

Callers 8

HandleFunction · 0.70
HandleStartFunction · 0.70
HandleStopFunction · 0.70
HandleRestartFunction · 0.70
CheckExistFunction · 0.70
CheckActiveFunction · 0.70
CheckEnableFunction · 0.70
GetServicePathFunction · 0.70

Calls 5

NewFunction · 0.70
loadProcessedNameFunction · 0.70
loadFromPredefinedFunction · 0.70
NameMethod · 0.65
IsExistMethod · 0.65

Tested by

no test coverage detected