Documentation
¶
Overview ¶
Package htmx handles the routes and views for the AJAX responses using the htmx library.
Index ¶
- Variables
- func AdvancedSubmit(c echo.Context, logger *zap.SugaredLogger, downloadDir string) error
- func DBConnections(c echo.Context) error
- func DataListMagazines(c echo.Context, logger *zap.SugaredLogger, input string) error
- func DataListReleasers(c echo.Context, logger *zap.SugaredLogger, input string) error
- func DeleteForever(c echo.Context, logger *zap.SugaredLogger, id string) error
- func DemozooProd(c echo.Context) error
- func DemozooSubmit(c echo.Context, logger *zap.SugaredLogger) error
- func DemozooValid(c echo.Context, id int) (demozoo.Production, error)
- func Duplicate(logger *zap.SugaredLogger, uid uuid.UUID, srcPath, dstDir string)
- func GlobTo(name string) string
- func HumanizeAndCount(c echo.Context, logger *zap.SugaredLogger, name string) error
- func ImageSubmit(c echo.Context, logger *zap.SugaredLogger, downloadDir string) error
- func IntroSubmit(c echo.Context, logger *zap.SugaredLogger, downloadDir string) error
- func LookupSHA384(c echo.Context, logger *zap.SugaredLogger) error
- func MagazineSubmit(c echo.Context, logger *zap.SugaredLogger, downloadDir string) error
- func Pings(c echo.Context, proto string, port int) error
- func PouetProd(c echo.Context) error
- func PouetSubmit(c echo.Context, logger *zap.SugaredLogger) error
- func PouetValid(c echo.Context, id int) (pouet.Response, error)
- func Record16Colors(c echo.Context) error
- func RecordClassification(c echo.Context, logger *zap.SugaredLogger) error
- func RecordComment(c echo.Context) error
- func RecordCommentReset(c echo.Context) error
- func RecordCreatorAudio(c echo.Context) error
- func RecordCreatorIll(c echo.Context) error
- func RecordCreatorProg(c echo.Context) error
- func RecordCreatorReset(c echo.Context) error
- func RecordCreatorText(c echo.Context) error
- func RecordDateIssued(c echo.Context) error
- func RecordDateIssuedReset(c echo.Context, elmID string) error
- func RecordDemozoo(c echo.Context) error
- func RecordFilename(c echo.Context) error
- func RecordFilenameReset(c echo.Context) error
- func RecordGitHub(c echo.Context) error
- func RecordLinks(c echo.Context) error
- func RecordLinksReset(c echo.Context) error
- func RecordPouet(c echo.Context) error
- func RecordRelations(c echo.Context) error
- func RecordReleasers(c echo.Context) error
- func RecordReleasersReset(c echo.Context) error
- func RecordSites(c echo.Context) error
- func RecordTitle(c echo.Context) error
- func RecordTitleReset(c echo.Context) error
- func RecordToggle(c echo.Context, state bool) error
- func RecordToggleByID(c echo.Context, key string, state bool) error
- func RecordVirusTotal(c echo.Context) error
- func RecordYouTube(c echo.Context) error
- func SearchByID(c echo.Context, logger *zap.SugaredLogger) error
- func SearchReleaser(c echo.Context, logger *zap.SugaredLogger) error
- func Suggestion(name, initialism string, count any) string
- func TemplateFuncMap() template.FuncMap
- func Templates(fs embed.FS) map[string]*template.Template
- func TextSubmit(c echo.Context, logger *zap.SugaredLogger, downloadDir string) error
- func TrainerSubmit(c echo.Context, logger *zap.SugaredLogger, downloadDir string) error
Constants ¶
This section is empty.
Variables ¶
var ( ErrDB = errors.New("database connection is nil") ErrFormat = errors.New("invalid format") ErrKey = errors.New("numeric record key is invalid") )
var ( ErrDir = errors.New("cannot be a directory") ErrFile = errors.New("cannot be a file") ErrSave = errors.New("cannot save a file") ErrMultiHead = errors.New("multipart file header is nil") ErrUUID = errors.New("invalid or an empty UUID") )
var ErrYT = errors.New("youtube watch video id needs to be empty or 11 characters")
Functions ¶
func AdvancedSubmit ¶
AdvancedSubmit is a handler for the /uploader/advanced route.
func DBConnections ¶ added in v0.8.0
DBConnections is the handler for the database connections page.
func DataListMagazines ¶
DataListMagazines is a handler for the /datalist/magazines route.
func DataListReleasers ¶
DataListReleasers is a handler for the /datalist/releasers route.
func DeleteForever ¶ added in v0.8.0
DeleteForever is a handler for the /delete/forever route.
func DemozooProd ¶
DemozooProd fetches the multiple download_links values from the Demozoo production API and attempts to download and save one of the linked files. If multiple links are found, the first link is used as they should all point to the same asset.
Both the Demozoo production ID param and the Defacto2 UUID query param values are required as params to fetch the production data and to save the file to the correct filename.
func DemozooSubmit ¶
func DemozooSubmit(c echo.Context, logger *zap.SugaredLogger) error
DemozooSubmit is the handler for the /demozoo/production/submit route. This will attempt to insert a new file record into the database using the Demozoo production ID. If the Demozoo production ID is already in use, an error message is returned.
func DemozooValid ¶
DemozooValid fetches the first usable download link from the Demozoo API. The production ID is validated and the production is checked to see if it is suitable for Defacto2. If the production is not suitable, an empty production is returned with a htmx message.
func Duplicate ¶
func Duplicate(logger *zap.SugaredLogger, uid uuid.UUID, srcPath, dstDir string)
Duplicate copies the chosen file to the destination directory. The UUID needs be provided as a unique identifier for the filename. The source path is the temporary file that was uploaded. The destination directory is where the file will be copied to.
func HumanizeAndCount ¶
HumanizeAndCount handles the post submission for the Uploader classification, such as the platform, operating system, section or category tags. The return value is either the humanized and counted classification or an error.
func ImageSubmit ¶
ImageSubmit is a handler for the /uploader/image route.
func IntroSubmit ¶
IntroSubmit is a handler for the /uploader/intro route.
func LookupSHA384 ¶
func LookupSHA384(c echo.Context, logger *zap.SugaredLogger) error
LookupSHA384 is a handler for the /uploader/sha384 route.
func MagazineSubmit ¶
MagazineSubmit is a handler for the /uploader/magazine route.
func PouetProd ¶
PouetProd fetches the multiple download_links values from the Pouet production API and attempts to download and save one of the linked files. If multiple links are found, the first link is used as they should all point to the same asset.
Both the Pouet production ID param and the Defacto2 UUID query param values are required as params to fetch the production data and to save the file to the correct filename.
func PouetSubmit ¶
func PouetSubmit(c echo.Context, logger *zap.SugaredLogger) error
PouetSubmit is the handler for the /pouet/production/submit route. This will attempt to insert a new file record into the database using the Pouet production ID. If the Pouet production ID is already in use, an error message is returned.
func PouetValid ¶
PouetValid fetches the first usable download link from the Pouet API. The production ID is validated and the production is checked to see if it is suitable for Defacto2. If the production is not suitable, an empty production is returned with a htmx message.
func Record16Colors ¶
Record16Colors handles the post submission for the file artifact 16 Colors link.
func RecordClassification ¶
func RecordClassification(c echo.Context, logger *zap.SugaredLogger) error
RecordClassification handles the post submission for the file artifact classifications, such as the platform, operating system, section or category tags. The return value is either the humanized and counted classification or an error.
func RecordComment ¶
RecordComment handles the post submission for the file artifact comment.
func RecordCommentReset ¶
RecordCommentReset handles the post submission for the file artifact comment reset.
func RecordCreatorAudio ¶
RecordCreatorAudio handles the post submission for the file artifact creator musician.
func RecordCreatorIll ¶
RecordCreatorIll handles the post submission for the file artifact creator illustrator.
func RecordCreatorProg ¶
RecordCreatorProg handles the post submission for the file artifact creator programmer.
func RecordCreatorReset ¶
RecordCreatorReset handles the post submission for the file artifact creators reset.
func RecordCreatorText ¶
RecordCreatorText handles the post submission for the file artifact creator text.
func RecordDateIssued ¶
RecordDateIssued handles the post submission for the file artifact date of release.
func RecordDateIssuedReset ¶
RecordDateIssuedReset handles the post submission for the file artifact date of release reset.
func RecordDemozoo ¶
RecordDemozoo handles the post submission for the file artifact Demozoo production link.
func RecordFilename ¶
RecordFilename handles the post submission for the file artifact filename.
func RecordFilenameReset ¶
RecordFilenameReset handles the post submission for the file artifact filename reset.
func RecordGitHub ¶
RecordGitHub handles the post submission for the file artifact GitHub repository link.
func RecordLinks ¶
RecordLinks handles the post submission for a form submission to provide the HTML formatted links for the "Links" section of the artifact editor.
func RecordLinksReset ¶ added in v0.8.0
RecordLinksReset handles the post submission for the file artifact links reset.
func RecordPouet ¶
RecordPouet handles the post submission for the file artifact Pouet production link.
func RecordRelations ¶
RecordRelations handles the post submission for the file artifact releaser relationships.
func RecordReleasers ¶
RecordReleasers handles the post submission for the file artifact releasers. It will only update the releaser1 and the releaser2 values if they have changed. The return value is either "Updated" or "Update" depending on if the values have changed.
func RecordReleasersReset ¶
RecordReleasersReset handles the post submission for the file artifact releasers reset. It will always reset and save the releaser1 and the releaser2 values. The return value is always "Resetted" unless an error occurs.
func RecordSites ¶
RecordSites handles the post submission for the file artifact website links.
func RecordTitle ¶
RecordTitle handles the post submission for the file artifact title.
func RecordTitleReset ¶
RecordTitleReset handles the post submission for the file artifact title reset.
func RecordToggle ¶
RecordToggle handles the post submission for the file artifact record toggle. The return value is either "online" or "offline" depending on the state.
func RecordToggleByID ¶ added in v0.8.0
RecordToggle handles the post submission for the file artifact record toggle. The key string is converted into an integer and used as the artifact id. The return value is either "online" or "offline" depending on the state.
func RecordVirusTotal ¶
RecordVirusTotal handles the post submission for the file artifact VirusTotal report link.
func RecordYouTube ¶
RecordYouTube handles the post submission for the file artifact YouTube watch video link.
func SearchByID ¶ added in v0.8.0
func SearchByID(c echo.Context, logger *zap.SugaredLogger) error
SearchByID is a handler for the /editor/search/id route.
func SearchReleaser ¶
func SearchReleaser(c echo.Context, logger *zap.SugaredLogger) error
SearchReleaser is a handler for the /search/releaser route.
func Suggestion ¶
Suggestion returns a human readable string of the byte count with a named description.
func TemplateFuncMap ¶
TemplateFuncMap are a collection of mapped functions that can be used in a template.
func TextSubmit ¶
TextSubmit is a handler for the /uploader/text route.
func TrainerSubmit ¶
TrainerSubmit is a handler for the /uploader/trainer route.
Types ¶
This section is empty.