Adds basic documentation for internal packages (#43)
* Added basic documentation wireframe for api, commands, and forms. * Added doc.go
This commit is contained in:
parent
4c20c74e77
commit
00abbf1af5
13 changed files with 28 additions and 0 deletions
6
internal/api/doc.go
Normal file
6
internal/api/doc.go
Normal file
|
@ -0,0 +1,6 @@
|
|||
/*
|
||||
Package api contains REST request handlers used by the server package.
|
||||
|
||||
See https://photoprism.org/ for more information about PhotoPrism.
|
||||
*/
|
||||
package api
|
|
@ -9,6 +9,7 @@ import (
|
|||
"strconv"
|
||||
)
|
||||
|
||||
// GetPhotos searches the databse for photos based on a form.
|
||||
func GetPhotos(router *gin.RouterGroup, conf *photoprism.Config) {
|
||||
router.GET("/photos", func(c *gin.Context) {
|
||||
var form forms.PhotoSearchForm
|
||||
|
|
|
@ -14,6 +14,7 @@ var photoIconSvg = []byte(`
|
|||
<path d="M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"/>
|
||||
</svg>`)
|
||||
|
||||
// GetThumbnail searches the database for a thumbnail based on hash, size, and type.
|
||||
func GetThumbnail(router *gin.RouterGroup, conf *photoprism.Config) {
|
||||
router.GET("/thumbnails/:type/:size/:hash", func(c *gin.Context) {
|
||||
fileHash := c.Param("hash")
|
||||
|
|
|
@ -12,6 +12,7 @@ var ConfigCommand = cli.Command{
|
|||
Action: configAction,
|
||||
}
|
||||
|
||||
// Prints current configuration; called by ConfigCommand
|
||||
func configAction(context *cli.Context) error {
|
||||
conf := photoprism.NewConfig(context)
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@ var ConvertCommand = cli.Command{
|
|||
Action: convertAction,
|
||||
}
|
||||
|
||||
// Converts images to JPEG; called by ConvertCommand
|
||||
func convertAction(context *cli.Context) error {
|
||||
conf := photoprism.NewConfig(context)
|
||||
|
||||
|
|
6
internal/commands/doc.go
Normal file
6
internal/commands/doc.go
Normal file
|
@ -0,0 +1,6 @@
|
|||
/*
|
||||
This package contains commands and flags to be used by the main application.
|
||||
|
||||
See https://photoprism.org/ for more information about PhotoPrism.
|
||||
*/
|
||||
package commands
|
|
@ -35,6 +35,7 @@ var exportFlags = []cli.Flag{
|
|||
},
|
||||
}
|
||||
|
||||
// Exports photos as JPEG; called by ExportCommand and uses exportFlags
|
||||
func exportAction(context *cli.Context) error {
|
||||
conf := photoprism.NewConfig(context)
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@ var ImportCommand = cli.Command{
|
|||
Action: importAction,
|
||||
}
|
||||
|
||||
// Imports photos from path defined in context arg; called by ImportCommand;
|
||||
func importAction(context *cli.Context) error {
|
||||
conf := photoprism.NewConfig(context)
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@ var IndexCommand = cli.Command{
|
|||
Action: indexAction,
|
||||
}
|
||||
|
||||
// Indexes original photos; called by IndexCommand
|
||||
func indexAction(context *cli.Context) error {
|
||||
conf := photoprism.NewConfig(context)
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@ var MigrateCommand = cli.Command{
|
|||
Action: migrateAction,
|
||||
}
|
||||
|
||||
// Automatically migrates / initializes database; called by MigrateCommand
|
||||
func migrateAction(context *cli.Context) error {
|
||||
conf := photoprism.NewConfig(context)
|
||||
|
||||
|
|
|
@ -36,6 +36,7 @@ var startFlags = []cli.Flag{
|
|||
},
|
||||
}
|
||||
|
||||
// Starts web serve using startFlags; called by startCommand
|
||||
func startAction(context *cli.Context) error {
|
||||
conf := photoprism.NewConfig(context)
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@ var ThumbnailsCommand = cli.Command{
|
|||
Action: thumbnailsAction,
|
||||
}
|
||||
|
||||
// Creates thumbnail; called by ThumbnailsCommand
|
||||
func thumbnailsAction(context *cli.Context) error {
|
||||
conf := photoprism.NewConfig(context)
|
||||
|
||||
|
|
6
internal/forms/doc.go
Normal file
6
internal/forms/doc.go
Normal file
|
@ -0,0 +1,6 @@
|
|||
/*
|
||||
Package forms contains tagged structs for input value validation.
|
||||
|
||||
See https://photoprism.org/ for more information about PhotoPrism.
|
||||
*/
|
||||
package forms
|
Loading…
Reference in a new issue