-
Notifications
You must be signed in to change notification settings - Fork 9
/
admire.go
57 lines (43 loc) · 1.74 KB
/
admire.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package persist
import (
"fmt"
)
var errAdmireNotFound ErrAdmireNotFound
type ErrAdmireNotFound struct{}
func (e ErrAdmireNotFound) Unwrap() error { return notFoundError }
func (e ErrAdmireNotFound) Error() string { return "admire not found" }
type ErrAdmireNotFoundByID struct{ ID DBID }
func (e ErrAdmireNotFoundByID) Unwrap() error { return errAdmireNotFound }
func (e ErrAdmireNotFoundByID) Error() string { return fmt.Sprintf("admire not found by id=%s", e.ID) }
type ErrAdmireNotFoundByActorIDFeedEventID struct {
ActorID DBID
FeedEventID DBID
}
func (e ErrAdmireNotFoundByActorIDFeedEventID) Unwrap() error { return errAdmireNotFound }
func (e ErrAdmireNotFoundByActorIDFeedEventID) Error() string {
return fmt.Sprintf("admire not found by actorID=%s; feedEventID=%s", e.ActorID, e.FeedEventID)
}
type ErrAdmireNotFoundByActorIDPostID struct {
ActorID DBID
PostID DBID
}
func (e ErrAdmireNotFoundByActorIDPostID) Unwrap() error { return errAdmireNotFound }
func (e ErrAdmireNotFoundByActorIDPostID) Error() string {
return fmt.Sprintf("admire not found by actorID=%s; postID=%s", e.ActorID, e.PostID)
}
type ErrAdmireNotFoundByActorIDTokenID struct {
ActorID DBID
TokenID DBID
}
func (e ErrAdmireNotFoundByActorIDTokenID) Unwrap() error { return errAdmireNotFound }
func (e ErrAdmireNotFoundByActorIDTokenID) Error() string {
return fmt.Sprintf("admire not found by actorID=%s; tokenID=%s", e.ActorID, e.TokenID)
}
type ErrAdmireNotFoundByActorIDCommentID struct {
ActorID DBID
CommentID DBID
}
func (e ErrAdmireNotFoundByActorIDCommentID) Unwrap() error { return errAdmireNotFound }
func (e ErrAdmireNotFoundByActorIDCommentID) Error() string {
return fmt.Sprintf("admire not found by actorID=%s; commentID=%s", e.ActorID, e.CommentID)
}