mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-05-20 17:28:40 +00:00
edcee14d07
* [feature] Read + Write tombstones for deleted Actors * copyTombstone * update to use resultcache instead of old ttl cache Signed-off-by: kim <grufwub@gmail.com> * update go-cache library to fix result cache capacity / ordering bugs Signed-off-by: kim <grufwub@gmail.com> * bump go-cache/v3 to v3.1.6 to fix bugs Signed-off-by: kim <grufwub@gmail.com> * switch on status code * better explain ErrGone reasoning Signed-off-by: kim <grufwub@gmail.com> Co-authored-by: kim <grufwub@gmail.com>
23 lines
510 B
Go
23 lines
510 B
Go
package result
|
|
|
|
import "errors"
|
|
|
|
// ErrUnkownLookup ...
|
|
var ErrUnknownLookup = errors.New("unknown lookup identifier")
|
|
|
|
// IsConflictErr returns whether error is due to key conflict.
|
|
func IsConflictErr(err error) bool {
|
|
_, ok := err.(ConflictError)
|
|
return ok
|
|
}
|
|
|
|
// ConflictError is returned on cache key conflict.
|
|
type ConflictError struct {
|
|
Key string
|
|
}
|
|
|
|
// Error returns the message for this key conflict error.
|
|
func (c ConflictError) Error() string {
|
|
return "cache conflict for key \"" + c.Key + "\""
|
|
}
|