Skip to content

Commit

Permalink
chore(deps): bump github.com/ViBiOh/ChatPotte from 0.1.1 to 0.2.3
Browse files Browse the repository at this point in the history
Bumps [github.com/ViBiOh/ChatPotte](https://github.com/ViBiOh/ChatPotte) from 0.1.1 to 0.2.3.
- [Release notes](https://github.com/ViBiOh/ChatPotte/releases)
- [Commits](ViBiOh/ChatPotte@v0.1.1...v0.2.3)

---
updated-dependencies:
- dependency-name: github.com/ViBiOh/ChatPotte
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: Vincent Boutour <[email protected]>
  • Loading branch information
dependabot[bot] authored and ViBiOh committed Aug 28, 2022
1 parent 5eeff6d commit b226014
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 61 deletions.
17 changes: 10 additions & 7 deletions cmd/fibr/fibr.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
"context"
"crypto/rand"
"embed"
"errors"
Expand Down Expand Up @@ -123,7 +124,7 @@ func main() {
eventBus, err := provider.NewEventBus(10, prometheusRegisterer, tracerApp.GetTracer("bus"))
logger.Fatal(err)

amqpClient, err := amqp.New(amqpConfig, prometheusApp.Registerer())
amqpClient, err := amqp.New(amqpConfig, prometheusApp.Registerer(), tracerApp.GetTracer("amqp"))
if err != nil && !errors.Is(err, amqp.ErrNoConfig) {
logger.Fatal(err)
} else if amqpClient != nil {
Expand All @@ -147,13 +148,13 @@ func main() {
shareApp, err := share.New(shareConfig, storageProvider, amqpClient)
logger.Fatal(err)

amqpExifApp, err := amqphandler.New(amqpExifConfig, amqpClient, exifApp.AMQPHandler)
amqpExifApp, err := amqphandler.New(amqpExifConfig, amqpClient, tracerApp.GetTracer("amqp_handler_exif"), exifApp.AMQPHandler)
logger.Fatal(err)

amqpShareApp, err := amqphandler.New(amqpShareConfig, amqpClient, shareApp.AMQPHandler)
amqpShareApp, err := amqphandler.New(amqpShareConfig, amqpClient, tracerApp.GetTracer("amqp_handler_share"), shareApp.AMQPHandler)
logger.Fatal(err)

amqpWebhookApp, err := amqphandler.New(amqpWebhookConfig, amqpClient, webhookApp.AMQPHandler)
amqpWebhookApp, err := amqphandler.New(amqpWebhookConfig, amqpClient, tracerApp.GetTracer("amqp_handler_webhook"), webhookApp.AMQPHandler)
logger.Fatal(err)

crudApp, err := crud.New(crudConfig, storageProvider, rendererApp, shareApp, webhookApp, thumbnailApp, exifApp, eventBus.Push, amqpClient, tracerApp.GetTracer("crud"))
Expand All @@ -167,9 +168,11 @@ func main() {
fibrApp := fibr.New(&crudApp, rendererApp, shareApp, webhookApp, middlewareApp)
handler := rendererApp.Handler(fibrApp.TemplateFunc)

go amqpExifApp.Start(healthApp.Done())
go amqpShareApp.Start(healthApp.Done())
go amqpWebhookApp.Start(healthApp.Done())
ctx := context.Background()

go amqpExifApp.Start(ctx, healthApp.Done())
go amqpShareApp.Start(ctx, healthApp.Done())
go amqpWebhookApp.Start(ctx, healthApp.Done())
go webhookApp.Start(healthApp.Done())
go shareApp.Start(healthApp.Done())
go crudApp.Start(healthApp.Done())
Expand Down
16 changes: 8 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ module github.com/ViBiOh/fibr
go 1.19

require (
github.com/ViBiOh/ChatPotte v0.1.1
github.com/ViBiOh/absto v1.0.1
github.com/ViBiOh/auth/v2 v2.14.0
github.com/ViBiOh/ChatPotte v0.2.3
github.com/ViBiOh/absto v1.0.2
github.com/ViBiOh/auth/v2 v2.14.1
github.com/ViBiOh/exas v0.5.0
github.com/ViBiOh/flags v1.2.0
github.com/ViBiOh/httputils/v4 v4.46.2
github.com/ViBiOh/httputils/v4 v4.46.3
github.com/ViBiOh/vith v0.5.0
github.com/golang/mock v1.6.0
github.com/prometheus/client_golang v1.13.0
github.com/streadway/amqp v1.0.0
go.opentelemetry.io/otel v1.9.0
go.opentelemetry.io/otel/trace v1.9.0
golang.org/x/crypto v0.0.0-20220817201139-bc19a97f63c8
golang.org/x/crypto v0.0.0-20220826181053-bd7e27e6170d
golang.org/x/text v0.3.7
)

Expand Down Expand Up @@ -50,9 +50,9 @@ require (
go.opentelemetry.io/otel/exporters/jaeger v1.9.0 // indirect
go.opentelemetry.io/otel/metric v0.31.0 // indirect
go.opentelemetry.io/otel/sdk v1.9.0 // indirect
golang.org/x/net v0.0.0-20220805013720-a33c5aa5df48 // indirect
golang.org/x/sys v0.0.0-20220804214406-8e32c043e418 // indirect
golang.org/x/net v0.0.0-20220822230855-b0a4917ee28c // indirect
golang.org/x/sys v0.0.0-20220823224334-20c2bfdbfe24 // indirect
golang.org/x/term v0.0.0-20220722155259-a9ba230a4035 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/ini.v1 v1.66.6 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
)
32 changes: 16 additions & 16 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/ViBiOh/ChatPotte v0.1.1 h1:EzuR3iKxqF3GrTlqSuTjc7Z3lD/I2ECW69dbiP2yNCs=
github.com/ViBiOh/ChatPotte v0.1.1/go.mod h1:EUC/dnF4psMbB1E7CI+UPWgtczZ2nRoPHkeUfzXUj7o=
github.com/ViBiOh/absto v1.0.1 h1:5/PrhgB0XAgC3zLCwxxQlbhZkoCBBsrgJAxPwM5ZYXE=
github.com/ViBiOh/absto v1.0.1/go.mod h1:ZoXcCx5C+xU9R6SBP4HPXSjf3WZcaVIfFCciiViZfCs=
github.com/ViBiOh/auth/v2 v2.14.0 h1:v/t+pOZOBbSemSRV2TZ+C44fZFR0xQqIR7F/PZgC440=
github.com/ViBiOh/auth/v2 v2.14.0/go.mod h1:w1nqMK6Zve6fpSvBi5J2gg8+4nDxmRpbUILqS0eTw5M=
github.com/ViBiOh/ChatPotte v0.2.3 h1:TSiHZ17J72QhJDt3SZ6YiSinm95uCZzIfsRSe5DZlb8=
github.com/ViBiOh/ChatPotte v0.2.3/go.mod h1:9Ybju6YblJO75h+D0lv1kV8b8HCFJY005sCznBbGZdQ=
github.com/ViBiOh/absto v1.0.2 h1:sER2SBJkhzZ138q9KqxsZPYq1XLJOSp2QfONQ+TZ1o8=
github.com/ViBiOh/absto v1.0.2/go.mod h1:WFjkaaoAtkkxdAxWwjCJBRFBmDc0/LDSMTONMtx0Ils=
github.com/ViBiOh/auth/v2 v2.14.1 h1:nWjChOT1AGia6xgNfDLD0Qp5KhRU3+pEE9QY1sxtNz4=
github.com/ViBiOh/auth/v2 v2.14.1/go.mod h1:2/eXcZpZps2aMvajyIX6PZJqmgXyxFzilPlEfGocOAA=
github.com/ViBiOh/exas v0.5.0 h1:ZL5v5rUOkkwo6PxhbOVe96L0RUre7SfStaVcqhE/IbU=
github.com/ViBiOh/exas v0.5.0/go.mod h1:sKRV/vz85Vj0caT+a3XWVFp0gyzXe36eZWL+XKge93E=
github.com/ViBiOh/flags v1.2.0 h1:DaujjNXzD29KxKyp4eZdn7c9+uBN5DokWgDAe7DcUmc=
github.com/ViBiOh/flags v1.2.0/go.mod h1:UyMB5zeD/aId7Xw3x7577ZNU298JmukzOcV8p/H2W1s=
github.com/ViBiOh/httputils/v4 v4.46.2 h1:Dv21a3U0K78Iw4eHxxt3tRz8kQeC0ThT4jdZMdk+7nI=
github.com/ViBiOh/httputils/v4 v4.46.2/go.mod h1:WADqXz2lb3av9YkDlF+ZJCSh1EaXCstj8AFn2snDarY=
github.com/ViBiOh/httputils/v4 v4.46.3 h1:004bv6lCHlNkqcOg7O6vXHGPrgiEePw+SXKJDT95jdg=
github.com/ViBiOh/httputils/v4 v4.46.3/go.mod h1:pnMewID1htYlsK9ibgnl2Rnjd9a0jFYHotIz0LxJcpQ=
github.com/ViBiOh/vith v0.5.0 h1:BpmjwWxd4NGmUJF12XpFOngK32539Lw3mvbMOaeOmhE=
github.com/ViBiOh/vith v0.5.0/go.mod h1:Wf40eedOBEcxeLzGzGpuO+2G8qe5Ov1WIIBPXohyKco=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
Expand Down Expand Up @@ -298,8 +298,8 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20220817201139-bc19a97f63c8 h1:GIAS/yBem/gq2MUqgNIzUHW7cJMmx3TGZOrnyYaNQ6c=
golang.org/x/crypto v0.0.0-20220817201139-bc19a97f63c8/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.0.0-20220826181053-bd7e27e6170d h1:3qF+Z8Hkrw9sOhrFHti9TlB1Hkac1x+DNRkv0XQiFjo=
golang.org/x/crypto v0.0.0-20220826181053-bd7e27e6170d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
Expand Down Expand Up @@ -363,8 +363,8 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b
golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220805013720-a33c5aa5df48 h1:N9Vc/rorQUDes6B9CNdIxAn5jODGj2wzfrei2x4wNj4=
golang.org/x/net v0.0.0-20220805013720-a33c5aa5df48/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
golang.org/x/net v0.0.0-20220822230855-b0a4917ee28c h1:JVAXQ10yGGVbSyoer5VILysz6YKjdNT2bsvlayjqhes=
golang.org/x/net v0.0.0-20220822230855-b0a4917ee28c/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
Expand Down Expand Up @@ -425,8 +425,8 @@ golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220804214406-8e32c043e418 h1:9vYwv7OjYaky/tlAeD7C4oC9EsPTlaFl1H2jS++V+ME=
golang.org/x/sys v0.0.0-20220804214406-8e32c043e418/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220823224334-20c2bfdbfe24 h1:TyKJRhyo17yWxOMCTHKWrc5rddHORMlnZ/j57umaUd8=
golang.org/x/sys v0.0.0-20220823224334-20c2bfdbfe24/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.0.0-20220722155259-a9ba230a4035 h1:Q5284mrmYTpACcm+eAKjKJH48BBwSyfJqmmGDTtT8Vc=
Expand Down Expand Up @@ -569,8 +569,8 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/ini.v1 v1.66.6 h1:LATuAqN/shcYAOkv3wl2L4rkaKqkcgTBQjOyYDvcPKI=
gopkg.in/ini.v1 v1.66.6/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
Expand Down
4 changes: 1 addition & 3 deletions pkg/exif/amqp.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/streadway/amqp"
)

func (a App) AMQPHandler(message amqp.Delivery) error {
func (a App) AMQPHandler(ctx context.Context, message amqp.Delivery) error {
var resp provider.ExifResponse

if err := json.Unmarshal(message.Body, &resp); err != nil {
Expand All @@ -23,8 +23,6 @@ func (a App) AMQPHandler(message amqp.Delivery) error {
return nil
}

ctx := context.Background()

exif, err := a.loadExif(ctx, resp.Item)
if err != nil && !absto.IsNotExist(err) {
logger.WithField("item", resp.Item.Pathname).Error("load exif: %s", err)
Expand Down
22 changes: 4 additions & 18 deletions pkg/mocks/storage.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 2 additions & 7 deletions pkg/provider/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ func SaveJSON(ctx context.Context, storageApp absto.Storage, filename string, co
done <- err
}()

err := storageApp.WriteTo(ctx, filename, reader)
err := storageApp.WriteTo(ctx, filename, reader, absto.WriteOpts{})

if jsonErr := <-done; jsonErr != nil {
err = model.WrapError(err, jsonErr)
Expand Down Expand Up @@ -244,12 +244,7 @@ func WriteToStorage(ctx context.Context, storageApp absto.Storage, output string
return fmt.Errorf("create directory: %w", err)
}

if size == -1 {
err = storageApp.WriteTo(ctx, output, reader)
} else {
err = storageApp.WriteSizedTo(ctx, output, size, reader)
}

err = storageApp.WriteTo(ctx, output, reader, absto.WriteOpts{Size: size})
if err != nil {
if removeErr := storageApp.Remove(ctx, output); removeErr != nil {
err = model.WrapError(err, fmt.Errorf("remove: %w", removeErr))
Expand Down
3 changes: 2 additions & 1 deletion pkg/share/amqp.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package share

import (
"context"
"encoding/json"
"fmt"

"github.com/ViBiOh/fibr/pkg/provider"
"github.com/streadway/amqp"
)

func (a *App) AMQPHandler(message amqp.Delivery) error {
func (a *App) AMQPHandler(_ context.Context, message amqp.Delivery) error {
var share provider.Share

if err := json.Unmarshal(message.Body, &share); err != nil {
Expand Down
3 changes: 2 additions & 1 deletion pkg/webhook/amqp.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package webhook

import (
"context"
"encoding/json"
"fmt"

Expand All @@ -9,7 +10,7 @@ import (
)

// AMQPHandler handle exif message
func (a *App) AMQPHandler(message amqp.Delivery) error {
func (a *App) AMQPHandler(_ context.Context, message amqp.Delivery) error {
var webhook provider.Webhook

if err := json.Unmarshal(message.Body, &webhook); err != nil {
Expand Down

0 comments on commit b226014

Please sign in to comment.