Documentation ¶
Index ¶
- Variables
- func IsUniqueConstraintError(err error) bool
- type Store
- func (s *Store) CreateEntry(entry shared.Entry, givenID string) (*shared.Entry, error)
- func (s *Store) CreateUser(user models.User) (*models.User, error)
- func (s *Store) DeleteEntry(id string) error
- func (s *Store) FindUserByEmail(email string) (*models.User, error)
- func (s *Store) FindUserByToken(token string) (*models.User, error)
- func (s *Store) GetEntryAndIncrease(id string) (*shared.Entry, error)
- func (s *Store) GetEntryByID(id string) (*shared.Entry, error)
- func (s *Store) LinkUpdate(link *shared.Entry) (*shared.Entry, error)
- func (s *Store) LinksList() ([]*shared.Entry, error)
- func (s *Store) UserUpdateToken(id uint, token string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrEntryIsExpired = errors.New("entry is expired")
ErrEntryIsExpired is returned when the entry is expired
View Source
var ErrGeneratingIDFailed = errors.New("could not generate unique id, all ten tries failed")
ErrGeneratingIDFailed is returned when the 10 tries to generate an id failed
View Source
var ErrNoValidURL = errors.New("the given URL is no valid URL")
ErrNoValidURL is returned when the URL is not valid
Functions ¶
func IsUniqueConstraintError ¶ added in v0.0.6
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store holds internal funcs and vars about the store
func (*Store) CreateEntry ¶
func (*Store) CreateUser ¶ added in v0.0.6
CreateUser creates a new User
func (*Store) DeleteEntry ¶
DeleteEntry deletes an Entry fully from the DB
func (*Store) FindUserByEmail ¶ added in v0.0.6
FindUserByEmail returns a user if given by email
func (*Store) FindUserByToken ¶ added in v0.0.6
func (*Store) GetEntryAndIncrease ¶
GetEntryAndIncrease the visitor count
func (*Store) GetEntryByID ¶
GetEntryByID returns an entry by ID
func (*Store) LinkUpdate ¶ added in v0.0.6
LinkUpdate updates a link
Click to show internal directories.
Click to hide internal directories.