summaryrefslogtreecommitdiffstats
path: root/golang/api/handlers
diff options
context:
space:
mode:
Diffstat (limited to 'golang/api/handlers')
-rw-r--r--golang/api/handlers/editing.go18
-rw-r--r--golang/api/handlers/entities.go9
2 files changed, 8 insertions, 19 deletions
diff --git a/golang/api/handlers/editing.go b/golang/api/handlers/editing.go
index b0c006cb..5c267e9e 100644
--- a/golang/api/handlers/editing.go
+++ b/golang/api/handlers/editing.go
@@ -40,6 +40,7 @@ func GetOrCreateEditgroup() Editgroup {
return eg
}
+////
func NewGetEditorUsernameHandler(db *pg.DB) operations.GetEditorUsernameHandler {
return &getEditorUsername{db: db}
}
@@ -50,7 +51,7 @@ func (d *getEditorUsername) Handle(params operations.GetEditorUsernameParams) mi
return middleware.NotImplemented("operation .PostCreatorID has not yet been implemented")
}
-
+////
func NewGetEditorUsernameChangelogHandler(db *pg.DB) operations.GetEditorUsernameChangelogHandler {
return &getEditorUsernameChangelog{db: db}
}
@@ -61,6 +62,7 @@ func (d *getEditorUsernameChangelog) Handle(params operations.GetEditorUsernameC
return middleware.NotImplemented("operation .PostCreatorID has not yet been implemented")
}
+////
func NewGetEditgroupIDHandler(db *pg.DB) operations.GetEditgroupIDHandler {
return &getEditgroupID{db: db}
}
@@ -71,18 +73,7 @@ func (d *getEditgroupID) Handle(params operations.GetEditgroupIDParams) middlewa
return middleware.NotImplemented("operation .PostCreatorID has not yet been implemented")
}
-/*
-func NewGetEditgroupIDHandler(db *pg.DB) operations.GetEditgroupIDHandler {
- return &getEditgroupID{db: db}
-}
-type getCreatorID struct {
- db *pg.DB
-}
-func (d *getCreatorID) Handle(params operations.GetEditgroupIDParams) middleware.Responder {
- return middleware.NotImplemented("operation .PostCreatorID has not yet been implemented")
-}
-*/
-
+////
func NewPostEditgroupHandler(db *pg.DB) operations.PostEditgroupHandler {
return &postEditgroup{db: db}
}
@@ -93,6 +84,7 @@ func (d *postEditgroup) Handle(params operations.PostEditgroupParams) middleware
return middleware.NotImplemented("operation .PostEditgroupID has not yet been implemented")
}
+////
func NewPostEditgroupIDAcceptHandler(db *pg.DB) operations.PostEditgroupIDAcceptHandler {
return &postEditgroupIDAccept{db: db}
}
diff --git a/golang/api/handlers/entities.go b/golang/api/handlers/entities.go
index a2fb7db8..9e184d92 100644
--- a/golang/api/handlers/entities.go
+++ b/golang/api/handlers/entities.go
@@ -44,14 +44,13 @@ func (ci *CreatorIdent) State() string {
}
}
+////
func NewGetCreatorIDHandler(db *pg.DB) operations.GetCreatorIDHandler {
return &getCreatorID{db: db}
}
-
type getCreatorID struct {
db *pg.DB
}
-
func (d *getCreatorID) Handle(params operations.GetCreatorIDParams) middleware.Responder {
// "get or 404" using params.ID. join creator_ident and creator_rev.
// populate result data
@@ -75,28 +74,26 @@ func (d *getCreatorID) Handle(params operations.GetCreatorIDParams) middleware.R
return operations.NewGetCreatorIDOK().WithPayload(api_entity)
}
+////
func NewGetCreatorLookupHandler(db *pg.DB) operations.GetCreatorLookupHandler {
return &getCreatorLookup{db: db}
}
-
type getCreatorLookup struct {
db *pg.DB
}
-
func (d *getCreatorLookup) Handle(params operations.GetCreatorLookupParams) middleware.Responder {
// get-or-create editgroup based on current editor (session)
// insert new rev, ident, and edit
return middleware.NotImplemented("operation .GetCreatorLookup has not yet been implemented")
}
+////
func NewPostCreatorHandler(db *pg.DB) operations.PostCreatorHandler {
return &postCreator{db: db}
}
-
type postCreator struct {
db *pg.DB
}
-
func (d *postCreator) Handle(params operations.PostCreatorParams) middleware.Responder {
// get-or-create editgroup based on current editor (session)
// insert new rev, ident, and edit