diff --git a/README.md b/README.md index 5a0bc55..9aa33cf 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ The redirects service provides an API that the frontend and the site-gateway ser ##### Search ```go - func (rs *Service) Search(_ http.ResponseWriter, r *http.Request, locale, path string) (map[redirectstore.RedirectSource]*redirectstore.RedirectDefinition, *redirectstore.RedirectDefinitionError) +func (rs *Service) Search(_ http.ResponseWriter, r *http.Request, locale, path string, page, pageSize int) (*redirectrepository.PaginatedResult, *redirectstore.RedirectDefinitionError) ``` Search for a redirect. diff --git a/domain/redirectdefinition/store/redirect.go b/domain/redirectdefinition/store/redirect.go index 67b092b..039bc3d 100644 --- a/domain/redirectdefinition/store/redirect.go +++ b/domain/redirectdefinition/store/redirect.go @@ -6,8 +6,11 @@ import ( ) const ( - RedirectCodePermanent RedirectCode = 301 - RedirectCodeTemporary RedirectCode = 307 // will this be needed? + RedirectCodePermanent RedirectCode = 301 // Permanent Redirect + RedirectCodeFound RedirectCode = 302 // Temporary Redirect (Found) + RedirectCodeTemporary RedirectCode = 307 // Temporary Redirect with method preservation + RedirectCodeNotFound RedirectCode = 404 // Resource Not Found + RedirectCodeGone RedirectCode = 410 // Resource Gone ) type RedirectResponse string @@ -19,11 +22,11 @@ type Redirect struct { func (r RedirectCode) Valid() bool { switch r { - case - RedirectCodePermanent: - return true - case - RedirectCodeTemporary: // will this be needed + case RedirectCodePermanent, + RedirectCodeFound, + RedirectCodeTemporary, + RedirectCodeNotFound, + RedirectCodeGone: return true default: return false