Documentation ¶
Index ¶
- Variables
- func NewContext(ctx context.Context, sess Session) context.Context
- type MongoNoteStore
- func (s *MongoNoteStore) DeleteNote(id uuid.UUID) error
- func (s *MongoNoteStore) FoldersByFolder(userID uuid.UUID, folder string) ([]string, error)
- func (s *MongoNoteStore) NoteByID(id uuid.UUID) (notes.Note, error)
- func (s *MongoNoteStore) NotesByFolder(userID uuid.UUID, folder string, page page.Page) ([]notes.Note, int, error)
- func (s *MongoNoteStore) NotesByOwner(userID uuid.UUID, page page.Page) ([]notes.Note, int, error)
- func (s *MongoNoteStore) NotesByTag(userID uuid.UUID, tag string, page page.Page) ([]notes.Note, error)
- func (s *MongoNoteStore) SaveNote(note *notes.Note) error
- func (s *MongoNoteStore) Tags(userID uuid.UUID, page page.Page) ([]string, error)
- type MongoStore
- type MongoUserStore
- func (s *MongoUserStore) DeleteUser(id uuid.UUID) error
- func (s *MongoUserStore) SaveUser(user *users.User) error
- func (s *MongoUserStore) UserByID(id uuid.UUID) (users.User, error)
- func (s *MongoUserStore) UserByName(username string) (users.User, error)
- func (s *MongoUserStore) Users(page page.Page) ([]users.User, int, error)
- type NoteStore
- type Session
- type StormNoteStore
- func (s *StormNoteStore) DeleteNote(id uuid.UUID) error
- func (s *StormNoteStore) NoteByID(id uuid.UUID) (notes.Note, error)
- func (s *StormNoteStore) NotesByFolder(userID uuid.UUID, folder string, page page.Page) ([]notes.Note, int, error)
- func (s *StormNoteStore) NotesByOwner(userID uuid.UUID, page page.Page) ([]notes.Note, int, error)
- func (s *StormNoteStore) SaveNote(note *notes.Note) error
- type StormStore
- type StormUserStore
- func (s *StormUserStore) DeleteUser(id uuid.UUID) error
- func (s *StormUserStore) SaveUser(user *users.User) error
- func (s *StormUserStore) UserByID(id uuid.UUID) (users.User, error)
- func (s *StormUserStore) UserByName(username string) (users.User, error)
- func (s *StormUserStore) Users(page page.Page) ([]users.User, int, error)
- type UserStore
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("requested resource not found")
ErrNotFound should be returned when any database query finds no results. Driver-specific not found errors should never be returned.
Functions ¶
Types ¶
type MongoNoteStore ¶
type MongoNoteStore struct {
// contains filtered or unexported fields
}
func (*MongoNoteStore) DeleteNote ¶
func (s *MongoNoteStore) DeleteNote(id uuid.UUID) error
func (*MongoNoteStore) FoldersByFolder ¶
func (*MongoNoteStore) NotesByFolder ¶
func (*MongoNoteStore) NotesByOwner ¶
func (*MongoNoteStore) NotesByTag ¶
type MongoStore ¶
type MongoStore struct {
// contains filtered or unexported fields
}
func (*MongoStore) Close ¶
func (s *MongoStore) Close() error
func (*MongoStore) NoteStore ¶
func (s *MongoStore) NoteStore() NoteStore
func (*MongoStore) UserStore ¶
func (s *MongoStore) UserStore() UserStore
type MongoUserStore ¶
type MongoUserStore struct {
// contains filtered or unexported fields
}
func (*MongoUserStore) DeleteUser ¶
func (s *MongoUserStore) DeleteUser(id uuid.UUID) error
func (*MongoUserStore) UserByName ¶
func (s *MongoUserStore) UserByName(username string) (users.User, error)
type NoteStore ¶
type NoteStore interface { NoteByID(id uuid.UUID) (notes.Note, error) NotesByOwner(userID uuid.UUID, page page.Page) ([]notes.Note, int, error) NotesByFolder(userID uuid.UUID, folder string, page page.Page) ([]notes.Note, int, error) //FoldersByFolder(userID uuid.UUID, folder string) ([]string, error) //NotesByTag(userID uuid.UUID, tag string, page page.Page) ([]notes.Note, int, error) //Tags(userID uuid.UUID) ([]string, error) //Search(userID uuid.UUID, query string, page page.Page) ([]notes.Note, int, error) SaveNote(note *notes.Note) error DeleteNote(id uuid.UUID) error }
NoteStore implementations handle access to the backing store for notes.
type Session ¶
Session implementations handle access to the backing store(s) for notes and users for a single session. They may optionally also be an io.Closer, and if they are, they can expect to be closed after each request.
func FromContext ¶
FromContext returns the Session in the given Context, if it is set.
func NewSession ¶
NewSession returns a new database session for the given configuration, including selecting the appropriate database driver.
type StormNoteStore ¶
type StormNoteStore struct {
// contains filtered or unexported fields
}
func (*StormNoteStore) DeleteNote ¶
func (s *StormNoteStore) DeleteNote(id uuid.UUID) error
func (*StormNoteStore) NotesByFolder ¶
func (*StormNoteStore) NotesByOwner ¶
type StormStore ¶
type StormStore struct {
// contains filtered or unexported fields
}
func (*StormStore) Close ¶
func (s *StormStore) Close() error
func (*StormStore) NoteStore ¶
func (s *StormStore) NoteStore() NoteStore
func (*StormStore) UserStore ¶
func (s *StormStore) UserStore() UserStore
type StormUserStore ¶
type StormUserStore struct {
// contains filtered or unexported fields
}
func (*StormUserStore) DeleteUser ¶
func (s *StormUserStore) DeleteUser(id uuid.UUID) error
func (*StormUserStore) UserByName ¶
func (s *StormUserStore) UserByName(username string) (users.User, error)
type UserStore ¶
type UserStore interface { UserByID(id uuid.UUID) (users.User, error) UserByName(username string) (users.User, error) Users(page page.Page) ([]users.User, int, error) SaveUser(user *users.User) error DeleteUser(id uuid.UUID) error }
UserStore implementations handle access to the backing store for users.