go-paste/cmd/paste/main.go
xuu 392341cf38
Some checks failed
Deploy / deploy (push) Failing after 45s
build: use go install
2023-10-15 16:03:34 -06:00

56 lines
1.1 KiB
Go

// Package Paste API.
//
// the purpose of this application is to provide an application
// that is using plain go code to define a paste API
//
// Terms Of Service:
//
// there are no TOS at this moment, use at your own risk we take no responsibility
//
// Schemes: http, https
// Host: paste.sour.is
// BasePath: /
// Version: 0.0.1
// License: MIT http://opensource.org/licenses/MIT
// Contact: Xuu <me@sour.is> https://sour.is
//
// Consumes:
// - application/json
// - text/plain
//
// Produces:
// - application/json
// - text/plain
//
//
// swagger:meta
package main // import "go.sour.is/paste/cmd/paste"
import (
"os"
"os/signal"
"syscall"
_ "go.sour.is/paste/src/docs"
_ "go.sour.is/paste/src/routes"
"sour.is/x/toolbox/httpsrv"
"sour.is/x/toolbox/log"
)
func main() {
if args["serve"] == true {
httpsrv.Run()
c := make(chan os.Signal, 1)
signal.Notify(c, syscall.SIGINT, syscall.SIGTERM)
s := <-c
log.Debugf("Got Signal %d", s)
httpsrv.Shutdown()
log.Debug("DONE")
}
}
//go:generate go run github.com/go-swagger/go-swagger/cmd/swagger generate spec -o ../../src/docs/public/swagger.json