-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
39 lines (36 loc) · 1.46 KB
/
main.go
File metadata and controls
39 lines (36 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// @title GiGot API
// @version 0.1.0
// @description Git-backed sync server for Formidable — local-first, server-optional.
//
// @contact.name Peter van de Pas
// @license.name MIT
//
// @host localhost:3417
// @BasePath /api
//
// @securityDefinitions.apikey BearerAuth
// @in header
// @name Authorization
// @description Enter your bearer token as: Bearer <token>
//
// @securityDefinitions.basic BasicAuth
// @description HTTP Basic with the subscription token as the password. The username is ignored — tokens are self-identifying. This is the form `git clone http://user:<token>@host/git/repo` produces, so git-over-HTTP works out of the box.
//
// @securityDefinitions.apikey SessionAuth
// @in cookie
// @name gigot_session
// @description Session cookie minted by POST /api/admin/login (or any successful OAuth callback). Required by every /api/admin/* endpoint and the /fragments/* template server. Browsers attach it automatically; programmatic callers must include the cookie header on every request.
package main
import "github.com/petervdpas/GiGot/internal/cli"
// appVersion is overridden at build time via
//
// -ldflags "-X main.appVersion=${VERSION}"
//
// (see .github/workflows/release.yml and the Dockerfile build stage).
// The sentinel default makes a plain `go build .` produce a binary
// whose -version output flags the missing ldflag obviously, instead of
// a silent empty string.
var appVersion = "0.0.0-dev"
func main() {
cli.Execute(resolveVersion())
}