27 lines
514 B
Go
27 lines
514 B
Go
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)
|
|
}
|