mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-09-20 10:10:13 +00:00
test(compat): add deterministic local fixtures
Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba>
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
package fixture
|
||||
|
||||
import "errors"
|
||||
|
||||
var (
|
||||
ErrPayloadOverrun = errors.New("fixture payload exceeds transfer limit")
|
||||
ErrPayloadSizeMismatch = errors.New("fixture payload size mismatch")
|
||||
)
|
||||
|
||||
type PathRejectionReason string
|
||||
|
||||
const (
|
||||
PathRejectionEmpty PathRejectionReason = "empty"
|
||||
PathRejectionAbsolute PathRejectionReason = "absolute"
|
||||
PathRejectionParent PathRejectionReason = "parent"
|
||||
PathRejectionVolume PathRejectionReason = "volume"
|
||||
PathRejectionSeparator PathRejectionReason = "separator"
|
||||
PathRejectionDestructiveRoot PathRejectionReason = "destructive_root"
|
||||
PathRejectionEscape PathRejectionReason = "escape"
|
||||
PathRejectionSymlinkParent PathRejectionReason = "symlink_parent"
|
||||
PathRejectionADS PathRejectionReason = "ads"
|
||||
)
|
||||
|
||||
type AgentPathError struct {
|
||||
Reason PathRejectionReason
|
||||
}
|
||||
|
||||
func (e *AgentPathError) Error() string {
|
||||
return "agent path rejected: " + string(e.Reason)
|
||||
}
|
||||
|
||||
func rejectPath(reason PathRejectionReason) error {
|
||||
return &AgentPathError{Reason: reason}
|
||||
}
|
||||
Reference in New Issue
Block a user