Formatting
This commit is contained in:
parent
706be92cc2
commit
0d3ea6d3f5
4 changed files with 10 additions and 5 deletions
|
@ -13,8 +13,8 @@ type causer interface {
|
|||
// Error is an local error type
|
||||
// It should contain the ActivityPub object that generated the error
|
||||
type Error struct {
|
||||
on as.Item
|
||||
msg string
|
||||
on as.Item
|
||||
msg string
|
||||
parent error
|
||||
}
|
||||
|
||||
|
|
|
@ -106,7 +106,7 @@ func (c CollectionHandlerFn) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
type ItemHandlerFn func(http.ResponseWriter, *http.Request) (as.Item, error)
|
||||
|
||||
// ValidMethod validates if the current handler can process the current request
|
||||
func (i ItemHandlerFn) ValidMethod( r *http.Request) bool {
|
||||
func (i ItemHandlerFn) ValidMethod(r *http.Request) bool {
|
||||
return r.Method != http.MethodGet && r.Method != http.MethodHead
|
||||
}
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@ type CollectionTyper interface {
|
|||
}
|
||||
|
||||
type pathTyper struct{}
|
||||
|
||||
func (d pathTyper) Type(r *http.Request) CollectionType {
|
||||
if r.URL == nil || len(r.URL.Path) == 0 {
|
||||
return Unknown
|
||||
|
@ -104,4 +105,3 @@ func getValidCollection(typ string) CollectionType {
|
|||
func ValidCollection(typ string) bool {
|
||||
return getValidCollection(typ) != Unknown
|
||||
}
|
||||
|
||||
|
|
|
@ -8,28 +8,33 @@ import (
|
|||
type Loader interface {
|
||||
Load(f Filterable) (as.ItemCollection, int, error)
|
||||
}
|
||||
|
||||
// ActivityLoader
|
||||
type ActivityLoader interface {
|
||||
LoadActivities(f Filterable) (as.ItemCollection, int, error)
|
||||
}
|
||||
|
||||
// ActorLoader
|
||||
type ActorLoader interface {
|
||||
LoadActors(f Filterable) (as.ItemCollection, int, error)
|
||||
}
|
||||
|
||||
// ObjectLoader
|
||||
type ObjectLoader interface {
|
||||
LoadObjects(f Filterable) (as.ItemCollection, int, error)
|
||||
}
|
||||
|
||||
// ActivitySaver
|
||||
type ActivitySaver interface {
|
||||
SaveActivity(as.Item) (as.Item, error)
|
||||
}
|
||||
|
||||
// ActorSaver
|
||||
type ActorSaver interface {
|
||||
SaveActor(as.Item) (as.Item, error)
|
||||
}
|
||||
|
||||
// ObjectSaver
|
||||
type ObjectSaver interface {
|
||||
SaveObject(as.Item) (as.Item, error)
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue