Chore: Move identity and errutil to apimachinery module (#89116)

This commit is contained in:
Ryan McKinley
2024-06-13 07:11:35 +03:00
committed by GitHub
parent 12a45fdeca
commit 99d8025829
298 changed files with 575 additions and 393 deletions
+18
View File
@@ -0,0 +1,18 @@
package errutil
// Source identifies from where an error originates.
type Source string
const (
// SourceServer implies error originates from within the server, i.e. this application.
SourceServer Source = "server"
// SourceDownstream implies error originates from response error while server acting
// as a proxy, i.e. from a downstream service.
SourceDownstream Source = "downstream"
)
// IsDownstream checks if Source is SourceDownstream.
func (s Source) IsDownstream() bool {
return s == SourceDownstream
}