GoDoc and some typos...
This commit is contained in:
parent
9f37579562
commit
543b39f822
15 changed files with 37 additions and 19 deletions
|
|
@ -27,7 +27,7 @@ type AccountStore interface {
|
|||
Delete(*auth.Account) error
|
||||
}
|
||||
|
||||
// AccountResource implements account managment handler.
|
||||
// AccountResource implements account management handler.
|
||||
type AccountResource struct {
|
||||
Store AccountStore
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// Package admin ties together administration resources and handlers.
|
||||
package admin
|
||||
|
||||
import (
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// Package api configures an http server for administration and application resources.
|
||||
package api
|
||||
|
||||
import (
|
||||
|
|
@ -19,8 +20,8 @@ import (
|
|||
"github.com/go-chi/render"
|
||||
)
|
||||
|
||||
// NewAPI configures application resources and routes.
|
||||
func NewAPI() (*chi.Mux, error) {
|
||||
// New configures application resources and routes.
|
||||
func New() (*chi.Mux, error) {
|
||||
logger := logging.NewLogger()
|
||||
|
||||
db, err := database.DBConn()
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ type AccountStore interface {
|
|||
DeleteToken(*auth.Token) error
|
||||
}
|
||||
|
||||
// AccountResource implements account managment handler.
|
||||
// AccountResource implements account management handler.
|
||||
type AccountResource struct {
|
||||
Store AccountStore
|
||||
}
|
||||
|
|
@ -64,7 +64,7 @@ func (rs *AccountResource) accountCtx(next http.Handler) http.Handler {
|
|||
|
||||
type accountRequest struct {
|
||||
*auth.Account
|
||||
// override protected data here, although not really neccessary here
|
||||
// override protected data here, although not really necessary here
|
||||
// as we limit updated database columns in store as well
|
||||
ProtectedID int `json:"id"`
|
||||
ProtectedActive bool `json:"active"`
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// Package app ties together application resources and handlers.
|
||||
package app
|
||||
|
||||
import (
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ type Server struct {
|
|||
// NewServer creates and configures an APIServer serving all application routes.
|
||||
func NewServer() (*Server, error) {
|
||||
log.Println("configuring server...")
|
||||
api, err := NewAPI()
|
||||
api, err := New()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue