Documentation ¶
Index ¶
- Variables
- func CreateRedirect(c context.Context, record *model.Redirect) error
- func DeleteRedirect(c context.Context, id string) error
- func GetRedirect(c context.Context, id string) (*model.Redirect, error)
- func GetRedirects(c context.Context) ([]*model.Redirect, error)
- func ToContext(c Setter, store Store)
- func UpdateRedirect(c context.Context, record *model.Redirect) error
- type Setter
- type Store
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrRedirectNotFound gets returned if a redirect can't be found on the store. ErrRedirectNotFound = fmt.Errorf("Failed to find a redirect") // ErrRedirectSourceExists gets returned if a redirect s source already exists. ErrRedirectSourceExists = fmt.Errorf("Source already exists") )
Functions ¶
func CreateRedirect ¶
CreateRedirect creates a redirect on the store.
func DeleteRedirect ¶
DeleteRedirect deletes a redirect from the store.
func GetRedirect ¶
GetRedirect retrieves a specific redirect from the store.
func GetRedirects ¶
GetRedirects retrieves all redirects from the store.
Types ¶
type Setter ¶
type Setter interface {
Set(string, interface{})
}
Setter defines a context that enables setting values.
type Store ¶
type Store interface { // Name simply returns the name of the store implementation. Name() string // Config just returns a simple configuration explanation. Config() string // GetRedirects retrieves all redirects from the store. GetRedirects() ([]*model.Redirect, error) // GetRedirect retrieves a specific redirect from the store. GetRedirect(string) (*model.Redirect, error) // DeleteRedirect deletes a redirect from the store. DeleteRedirect(string) error // CreateRedirect creates a redirect on the store. CreateRedirect(*model.Redirect) error // UpdateRedirect updates a redirect on the store. UpdateRedirect(*model.Redirect) error }
Store implements all required data-layer functions for Redirects.
func FromContext ¶
FromContext gets the store from the context.
Click to show internal directories.
Click to hide internal directories.