forked from TrueCloudLab/frostfs-s3-gw
2a93a216f8
- fix displaying list objects - simplify `ListObjects` - simplify `GetObjectHandler` - simplify `HeadObjectHandler` - add method for `GetBucketVersioningHandler` - add method for `ListMultipartUploadsHandler` - improvements for `HeadObjectHandler`, to display folders meta - update dependencies - github.com/aws/aws-sdk-go v1.36.26 - github.com/google/uuid v1.1.4 - github.com/gorilla/mux v1.8.0 - github.com/nspcc-dev/cdn-sdk v0.3.0 - github.com/nspcc-dev/neofs-api-go v1.22.0 - github.com/prometheus/client_golang v1.9.0 - github.com/stretchr/testify v1.7.0 - google.golang.org/grpc v1.35.0 Signed-off-by: Evgeniy Kulikov <kim@nspcc.ru>
52 lines
1 KiB
Go
52 lines
1 KiB
Go
package main
|
|
|
|
import (
|
|
"github.com/nspcc-dev/cdn-sdk/grace"
|
|
"github.com/nspcc-dev/cdn-sdk/logger"
|
|
"github.com/spf13/viper"
|
|
"go.uber.org/zap"
|
|
)
|
|
|
|
func newLogger(v *viper.Viper) *zap.Logger {
|
|
options := []logger.Option{
|
|
logger.WithLevel(v.GetString(cfgLoggerLevel)),
|
|
logger.WithTraceLevel(v.GetString(cfgLoggerTraceLevel)),
|
|
|
|
logger.WithFormat(v.GetString(cfgLoggerFormat)),
|
|
|
|
logger.WithSamplingInitial(v.GetInt(cfgLoggerSamplingInitial)),
|
|
logger.WithSamplingThereafter(v.GetInt(cfgLoggerSamplingThereafter)),
|
|
|
|
logger.WithAppName(v.GetString(cfgApplicationName)),
|
|
logger.WithAppVersion(v.GetString(cfgApplicationVersion)),
|
|
}
|
|
|
|
if v.GetBool(cfgLoggerNoCaller) {
|
|
options = append(options, logger.WithoutCaller())
|
|
}
|
|
|
|
if v.GetBool(cfgLoggerNoDisclaimer) {
|
|
options = append(options, logger.WithoutDisclaimer())
|
|
}
|
|
|
|
l, err := logger.New(options...)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
|
|
return l
|
|
}
|
|
|
|
func main() {
|
|
var (
|
|
v = newSettings()
|
|
l = newLogger(v)
|
|
g = grace.Context(l)
|
|
a = newApp(g, l, v)
|
|
)
|
|
|
|
go a.Server(g)
|
|
go a.Worker(g)
|
|
|
|
a.Wait()
|
|
}
|