mirror of
https://github.com/aykhans/slash-e.git
synced 2025-04-19 05:25:43 +00:00
chore: add healthz point
This commit is contained in:
parent
d46e83b735
commit
4bc2a0ff42
@ -103,6 +103,11 @@ func NewServer(ctx context.Context, profile *profile.Profile, store *store.Store
|
|||||||
}
|
}
|
||||||
s.Secret = secret
|
s.Secret = secret
|
||||||
|
|
||||||
|
// Register healthz endpoint.
|
||||||
|
e.GET("/healthz", func(c echo.Context) error {
|
||||||
|
return c.String(http.StatusOK, "Service ready.")
|
||||||
|
})
|
||||||
|
|
||||||
rootGroup := e.Group("")
|
rootGroup := e.Group("")
|
||||||
// Register API v1 routes.
|
// Register API v1 routes.
|
||||||
apiV1Service := apiv1.NewAPIV1Service(profile, store, licenseService)
|
apiV1Service := apiv1.NewAPIV1Service(profile, store, licenseService)
|
||||||
|
18
store/db/postgres/common.go
Normal file
18
store/db/postgres/common.go
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
package postgres
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"strings"
|
||||||
|
)
|
||||||
|
|
||||||
|
func placeholder(n int) string {
|
||||||
|
return "$" + fmt.Sprint(n)
|
||||||
|
}
|
||||||
|
|
||||||
|
func placeholders(n int) string {
|
||||||
|
list := []string{}
|
||||||
|
for i := 0; i < n; i++ {
|
||||||
|
list = append(list, placeholder(i+1))
|
||||||
|
}
|
||||||
|
return strings.Join(list, ", ")
|
||||||
|
}
|
@ -171,11 +171,3 @@ func (d *DB) DeleteMemo(ctx context.Context, delete *store.DeleteMemo) error {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func placeholders(n int) string {
|
|
||||||
list := []string{}
|
|
||||||
for i := 0; i < n; i++ {
|
|
||||||
list = append(list, fmt.Sprintf("$%d", i+1))
|
|
||||||
}
|
|
||||||
return strings.Join(list, ", ")
|
|
||||||
}
|
|
||||||
|
@ -3,7 +3,6 @@ package postgres
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/yourselfhosted/slash/store"
|
"github.com/yourselfhosted/slash/store"
|
||||||
@ -153,7 +152,3 @@ func (d *DB) DeleteUser(ctx context.Context, delete *store.DeleteUser) error {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func placeholder(n int) string {
|
|
||||||
return "$" + fmt.Sprint(n)
|
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user