docker-compose.yml:

This commit is contained in:
Mikhail 2023-04-03 18:47:47 +00:00
parent 45b5202684
commit 399d8416f6
5 changed files with 15 additions and 4 deletions

@ -19,7 +19,7 @@ services:
restart: "no"
logging:
driver: "none"
entrypoint: [ "bash", "-c", "sleep 3 && mongosh --host mongo1:30001 --eval 'rs.initiate()'"]
entrypoint: [ "bash", "-c", "sleep 3 && mongosh --host mongo1:30001 --eval 'rs.initiate({_id:'penahub-rs',members:[{id:0, host:mongo1:30001}]})'"]
app:
container_name: app

2
go.mod

@ -3,7 +3,7 @@ module penahub.gitlab.yandexcloud.net/backend/templategen
go 1.19
require (
github.com/danilsolovyov/doc-template v0.0.0-20230327151707-b8182a1ee9f4
github.com/danilsolovyov/doc-template v0.0.0-20230119175525-46bf31d2f8bb
github.com/danilsolovyov/reflectgostructv1 v0.0.11
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/gorilla/mux v1.8.0

6
go.sum

@ -12,8 +12,10 @@ github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMe
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
github.com/danilsolovyov/doc-template v0.0.0-20230327151707-b8182a1ee9f4 h1:GwGyqqRbG1MQi+GgPX9yX8FGNwZJPIpyxivb4OjKgnc=
github.com/danilsolovyov/doc-template v0.0.0-20230327151707-b8182a1ee9f4/go.mod h1:nR0IgQFyfxaKnzDMdxyNpNieoL4hW593trhr4q4j6dM=
github.com/danilsolovyov/doc-template v0.0.0-20221126110329-5da086906f04 h1:HD/JvjE75g4noYp731sImUr9Mz2068ZEgDyNBUYxL4A=
github.com/danilsolovyov/doc-template v0.0.0-20221126110329-5da086906f04/go.mod h1:OskIiwxqSfUyC1zBmjTlPxVGj8ithRZd5Jqd4Lju6mQ=
github.com/danilsolovyov/doc-template v0.0.0-20230119175525-46bf31d2f8bb h1:pci+WYeWOlW8D9KXRe6sDODHlJvhbPFv/ZPu2UjKwjc=
github.com/danilsolovyov/doc-template v0.0.0-20230119175525-46bf31d2f8bb/go.mod h1:COeDMwtCpm/vzYPp3JJNCKVE0KNYX/UwebtmqYa/OdY=
github.com/danilsolovyov/reflectgostructv1 v0.0.11 h1:aAJo9mWTCt1sgL1bB3LkV2d/hQ07zU5Pj2zpiCaailI=
github.com/danilsolovyov/reflectgostructv1 v0.0.11/go.mod h1:CwTyBEg4Y22p1qZtHzEe07C5nsSVcc7vx3jdzphjmv4=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=

@ -314,6 +314,11 @@ func (h *Handlers) YaDiskDownloadLink(w http.ResponseWriter, r *http.Request) {
return
}
if yadisk == nil {
h.reportError(w, errors.New("yandex disk not found"), http.StatusUnprocessableEntity)
return
}
client, err := h.YaDisk.NewClient(r.Context(), yadisk.Token(), "")
if err != nil {
h.reportError(w, err, http.StatusInternalServerError)

@ -154,6 +154,10 @@ func (c *Client) DownloadFile(path string) (*DResp, error) {
return nil, err
}
if err := checkError(res); err != nil {
return nil, err
}
var resp DResp
if err := json.NewDecoder(res.Body).Decode(&resp); err != nil {