Documentation ¶
Index ¶
- type API
- func (api *API) GetAllDocumentHandler(w http.ResponseWriter, r *http.Request)
- func (api *API) GetOneDocumentHandler(w http.ResponseWriter, r *http.Request)
- func (api *API) GetOneUserHandler(w http.ResponseWriter, r *http.Request)
- func (api *API) InsertDocumentHandler(w http.ResponseWriter, r *http.Request)
- func (api *API) InsertUserHandler(w http.ResponseWriter, r *http.Request)
- func (api *API) UpdateDocumentHandler(w http.ResponseWriter, r *http.Request)
- func (api *API) UpdateUserHandler(w http.ResponseWriter, r *http.Request)
- type ContextKey
- type Document
- type Page
- func (page *Page) CreateSession(w http.ResponseWriter, r *http.Request)
- func (page *Page) DeleteSession(w http.ResponseWriter, r *http.Request)
- func (page *Page) RenderAllDocument(w http.ResponseWriter, r *http.Request)
- func (page *Page) RenderDashboard(w http.ResponseWriter, r *http.Request)
- func (page *Page) RenderEditDocument(w http.ResponseWriter, r *http.Request)
- func (page *Page) RenderEditor(w http.ResponseWriter, r *http.Request)
- func (page *Page) RenderIndex(w http.ResponseWriter, r *http.Request)
- func (page *Page) RenderLogin(w http.ResponseWriter, r *http.Request)
- func (page *Page) RenderNewDocument(w http.ResponseWriter, r *http.Request)
- func (page *Page) RenderNewUser(w http.ResponseWriter, r *http.Request)
- func (page *Page) RenderOneDocument(w http.ResponseWriter, r *http.Request)
- func (page *Page) SaveEditDocument(w http.ResponseWriter, r *http.Request)
- func (page *Page) SaveNewDocument(w http.ResponseWriter, r *http.Request)
- func (page *Page) SaveNewUser(w http.ResponseWriter, r *http.Request)
- type SQLStore
- func (s *SQLStore) DeleteSession(ctx context.Context, tokenHash string) error
- func (s *SQLStore) GetAllDocument(ctx context.Context) ([]*Document, error)
- func (s *SQLStore) GetOneDocument(ctx context.Context, id int64) (*Document, error)
- func (s *SQLStore) GetOneSession(ctx context.Context, tokenHash string) (*Session, error)
- func (s *SQLStore) GetOneUser(ctx context.Context, id int64) (*User, error)
- func (s *SQLStore) GetOneUserByUsername(ctx context.Context, username string) (*User, error)
- func (s *SQLStore) GetUsernameSession(ctx context.Context, tokenHash string) string
- func (s *SQLStore) InsertDocument(ctx context.Context, d *Document) (int64, error)
- func (s *SQLStore) InsertSession(ctx context.Context, d *Session) (int64, error)
- func (s *SQLStore) InsertUser(ctx context.Context, d *User) (int64, error)
- func (s *SQLStore) InsertUserPage(ctx context.Context, username string, email string, passwordHash string) (int64, error)
- func (s *SQLStore) UpdateDocument(ctx context.Context, id int64, field string, value string) error
- func (s *SQLStore) UpdateUser(ctx context.Context, id int64, field string, value string) error
- type Session
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
func NewHandlerAPI ¶
func (*API) GetAllDocumentHandler ¶
func (api *API) GetAllDocumentHandler(w http.ResponseWriter, r *http.Request)
func (*API) GetOneDocumentHandler ¶
func (api *API) GetOneDocumentHandler(w http.ResponseWriter, r *http.Request)
func (*API) GetOneUserHandler ¶
func (api *API) GetOneUserHandler(w http.ResponseWriter, r *http.Request)
func (*API) InsertDocumentHandler ¶
func (api *API) InsertDocumentHandler(w http.ResponseWriter, r *http.Request)
func (*API) InsertUserHandler ¶
func (api *API) InsertUserHandler(w http.ResponseWriter, r *http.Request)
func (*API) UpdateDocumentHandler ¶
func (api *API) UpdateDocumentHandler(w http.ResponseWriter, r *http.Request)
func (*API) UpdateUserHandler ¶
func (api *API) UpdateUserHandler(w http.ResponseWriter, r *http.Request)
type ContextKey ¶
type ContextKey int
const ( KeyUsername ContextKey = iota KeyIsAuthenticated ContextKey = iota )
type Page ¶
type Page struct {
// contains filtered or unexported fields
}
func NewHandlerPage ¶
func (*Page) CreateSession ¶
func (page *Page) CreateSession(w http.ResponseWriter, r *http.Request)
func (*Page) DeleteSession ¶
func (page *Page) DeleteSession(w http.ResponseWriter, r *http.Request)
func (*Page) RenderAllDocument ¶
func (page *Page) RenderAllDocument(w http.ResponseWriter, r *http.Request)
func (*Page) RenderDashboard ¶
func (page *Page) RenderDashboard(w http.ResponseWriter, r *http.Request)
func (*Page) RenderEditDocument ¶
func (page *Page) RenderEditDocument(w http.ResponseWriter, r *http.Request)
func (*Page) RenderEditor ¶
func (page *Page) RenderEditor(w http.ResponseWriter, r *http.Request)
func (*Page) RenderIndex ¶
func (page *Page) RenderIndex(w http.ResponseWriter, r *http.Request)
func (*Page) RenderLogin ¶
func (page *Page) RenderLogin(w http.ResponseWriter, r *http.Request)
func (*Page) RenderNewDocument ¶
func (page *Page) RenderNewDocument(w http.ResponseWriter, r *http.Request)
func (*Page) RenderNewUser ¶
func (page *Page) RenderNewUser(w http.ResponseWriter, r *http.Request)
func (*Page) RenderOneDocument ¶
func (page *Page) RenderOneDocument(w http.ResponseWriter, r *http.Request)
func (*Page) SaveEditDocument ¶
func (page *Page) SaveEditDocument(w http.ResponseWriter, r *http.Request)
func (*Page) SaveNewDocument ¶
func (page *Page) SaveNewDocument(w http.ResponseWriter, r *http.Request)
func (*Page) SaveNewUser ¶
func (page *Page) SaveNewUser(w http.ResponseWriter, r *http.Request)
type SQLStore ¶
type SQLStore struct {
// contains filtered or unexported fields
}
func NewSQLStore ¶
func (*SQLStore) DeleteSession ¶
func (*SQLStore) GetAllDocument ¶
func (*SQLStore) GetOneDocument ¶
func (*SQLStore) GetOneSession ¶
func (*SQLStore) GetOneUser ¶
func (*SQLStore) GetOneUserByUsername ¶
func (*SQLStore) GetUsernameSession ¶
func (*SQLStore) InsertDocument ¶
func (*SQLStore) InsertSession ¶
func (*SQLStore) InsertUser ¶
func (*SQLStore) InsertUserPage ¶
func (*SQLStore) UpdateDocument ¶
Click to show internal directories.
Click to hide internal directories.