platform: modularize api/gui, add docs-tests-web foundation, and refresh root config
This commit is contained in:
26
selective-vpn-api/app/transport_singbox_profiles_errors.go
Normal file
26
selective-vpn-api/app/transport_singbox_profiles_errors.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package app
|
||||
|
||||
import "strings"
|
||||
|
||||
func errSingBoxProfileMode() error {
|
||||
return &singBoxProfileError{text: "mode must be typed|raw"}
|
||||
}
|
||||
|
||||
func errSingBoxProfileID() error {
|
||||
return &singBoxProfileError{text: "invalid profile id"}
|
||||
}
|
||||
|
||||
func errSingBoxProfileExists() error {
|
||||
return &singBoxProfileError{text: "profile already exists"}
|
||||
}
|
||||
|
||||
type singBoxProfileError struct {
|
||||
text string
|
||||
}
|
||||
|
||||
func (e *singBoxProfileError) Error() string {
|
||||
if e == nil {
|
||||
return "singbox profile error"
|
||||
}
|
||||
return strings.TrimSpace(e.text)
|
||||
}
|
||||
Reference in New Issue
Block a user