diff --git a/go.mod b/go.mod index 0dd3123..0a0b81b 100644 --- a/go.mod +++ b/go.mod @@ -3,14 +3,14 @@ module github.com/savsgio/kratgo go 1.13 require ( - github.com/allegro/bigcache/v2 v2.1.6 + github.com/allegro/bigcache/v2 v2.2.0 github.com/json-iterator/go v1.1.9 github.com/philhofer/fwd v1.0.0 // indirect - github.com/savsgio/atreugo/v10 v10.0.0 + github.com/savsgio/atreugo/v10 v10.4.2 github.com/savsgio/go-logger v1.0.0 - github.com/savsgio/gotils v0.0.0-20190925070755-524bc4f47500 + github.com/savsgio/gotils v0.0.0-20200319105752-a9cc718f6a3f github.com/savsgio/govaluate/v3 v3.0.0 - github.com/tinylib/msgp v1.1.1 - github.com/valyala/fasthttp v1.7.1 - gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2 + github.com/tinylib/msgp v1.1.2 + github.com/valyala/fasthttp v1.9.0 + gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c ) diff --git a/go.sum b/go.sum index 38ffc0e..3c0f262 100644 --- a/go.sum +++ b/go.sum @@ -1,12 +1,11 @@ -github.com/allegro/bigcache/v2 v2.1.6 h1:fjsiMqea8/z10XmKtPAcdEjUs1Vtpe2DwPQQ3Jdb5E4= -github.com/allegro/bigcache/v2 v2.1.6/go.mod h1:FppZsIO+IZk7gCuj5FiIDHGygD9xvWQcqg1uIPMb6tY= +github.com/allegro/bigcache/v2 v2.2.0 h1:rB+Vjrjp7OijGRFMeUpJYXjsn3lN6ooIvomEBKXlfj0= +github.com/allegro/bigcache/v2 v2.2.0/go.mod h1:FppZsIO+IZk7gCuj5FiIDHGygD9xvWQcqg1uIPMb6tY= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/fasthttp/router v0.5.2 h1:xdmx8uYc9IFDtlbG2/FhE1Gyowv7/sqMgMonRjoW0Yo= -github.com/fasthttp/router v0.5.2/go.mod h1:Y5JAeRTSPwSLoUgH4x75UnT1j1IcAgVshMDMMrnNmKQ= +github.com/fasthttp/router v0.7.0 h1:k2ZhnUNPr7CLXSwDSNvkuOtH4vSijR1Kjjxh0gYzWVQ= +github.com/fasthttp/router v0.7.0/go.mod h1:00BQmm3xiThNypescxIQ+Gfgw2I/3QWKvuagFoENUb4= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.9 h1:9yzud/Ht36ygwatGx56VwCZtlI/2AD15T1X2sjSuGns= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/klauspost/compress v1.8.2 h1:Bx0qjetmNjdFXASH02NSAREKpiaDwkO1DRZ3dV2KCcs= @@ -20,23 +19,24 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN github.com/philhofer/fwd v1.0.0 h1:UbZqGr5Y38ApvM/V/jEljVxwocdweyH+vmYvRPBnbqQ= github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/savsgio/atreugo/v10 v10.0.0 h1:qEAPXdsL5xnT1pE8Okc7nJAmhm5t8jdxNtAbWCbB4yU= -github.com/savsgio/atreugo/v10 v10.0.0/go.mod h1:L9q/eZ1qIeYdY/3OLErJ4YFHRXShbhWUUnnl9grTu/I= +github.com/savsgio/atreugo/v10 v10.4.2 h1:T9okjXLk5R48BODjfJs9YqkRgQoWqrhZqNUMIslWs1s= +github.com/savsgio/atreugo/v10 v10.4.2/go.mod h1:LWOafWytEjuY0hIVQ9Yycva93RBgGHPQBfaSjw1z6dk= github.com/savsgio/go-logger v1.0.0 h1:jiaRvohRr8RwtcK/WDcA/Yp4eaPaarAko3JNPzt1xoQ= github.com/savsgio/go-logger v1.0.0/go.mod h1:/ZzTTmB3JJqjZQcLlxTGbwy3fIsLUoYyldsSEL5rU2g= -github.com/savsgio/gotils v0.0.0-20190925070755-524bc4f47500 h1:9Pi10H7E8E79/x2HSe1FmMGd7BJ1WAqDKzwjpv+ojFg= -github.com/savsgio/gotils v0.0.0-20190925070755-524bc4f47500/go.mod h1:lHhJedqxCoHN+zMtwGNTXWmF0u9Jt363FYRhV6g0CdY= +github.com/savsgio/gotils v0.0.0-20200117113501-90175b0fbe3f/go.mod h1:lHhJedqxCoHN+zMtwGNTXWmF0u9Jt363FYRhV6g0CdY= +github.com/savsgio/gotils v0.0.0-20200308224205-e330c862e34f/go.mod h1:lHhJedqxCoHN+zMtwGNTXWmF0u9Jt363FYRhV6g0CdY= +github.com/savsgio/gotils v0.0.0-20200319105752-a9cc718f6a3f h1:XfUnevLK4O22at3R77FlyQHKwlQs75LELdsH2wRX2KQ= +github.com/savsgio/gotils v0.0.0-20200319105752-a9cc718f6a3f/go.mod h1:lHhJedqxCoHN+zMtwGNTXWmF0u9Jt363FYRhV6g0CdY= github.com/savsgio/govaluate/v3 v3.0.0 h1:nilYfq6DyMQvy/++E42NW+s56k0I5jgqjm5IRtrwRfc= github.com/savsgio/govaluate/v3 v3.0.0/go.mod h1:4hnQJKZBjiFt7RfuNjx5tmXs1yL6BhtP5j4OmZHm4C0= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/tinylib/msgp v1.1.1 h1:TnCZ3FIuKeaIy+F45+Cnp+caqdXGy4z74HvwXN+570Y= -github.com/tinylib/msgp v1.1.1/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= +github.com/tinylib/msgp v1.1.2 h1:gWmO7n0Ys2RBEb7GPYB9Ujq8Mk5p2U08lRnmMcGy6BQ= +github.com/tinylib/msgp v1.1.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.6.0/go.mod h1:FstJa9V+Pj9vQ7OJie2qMHdwemEDaDiSdBnvPM1Su9w= -github.com/valyala/fasthttp v1.7.1 h1:UHtt5/7O70RSUZTR/hSu0PNWMAfWx5AtsPp9Jk+g17M= -github.com/valyala/fasthttp v1.7.1/go.mod h1:FstJa9V+Pj9vQ7OJie2qMHdwemEDaDiSdBnvPM1Su9w= +github.com/valyala/fasthttp v1.9.0 h1:hNpmUdy/+ZXYpGy0OBfm7K0UQTzb73W0T0U4iJIVrMw= +github.com/valyala/fasthttp v1.9.0/go.mod h1:FstJa9V+Pj9vQ7OJie2qMHdwemEDaDiSdBnvPM1Su9w= github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a h1:0R4NLDRDZX6JcmhJgXi5E4b8Wg84ihbmUKp/GvSPEzc= github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -44,5 +44,5 @@ golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2 h1:XZx7nhd5GMaZpmDaEHFVafUZC7ya0fuo7cSJ3UCKYmM= -gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/modules/admin/admin.go b/modules/admin/admin.go index 3c8af8b..c27cd05 100644 --- a/modules/admin/admin.go +++ b/modules/admin/admin.go @@ -13,7 +13,7 @@ func New(cfg Config) (*Admin, error) { logName := "kratgo-admin" log := logger.New(logName, cfg.LogLevel, cfg.LogOutput) - a.server = atreugo.New(&atreugo.Config{ + a.server = atreugo.New(atreugo.Config{ Addr: cfg.FileConfig.Addr, LogName: logName, }) diff --git a/modules/admin/admin_test.go b/modules/admin/admin_test.go index 34eed83..953e605 100644 --- a/modules/admin/admin_test.go +++ b/modules/admin/admin_test.go @@ -56,12 +56,14 @@ func (mock *mockServer) ListenAndServe() error { return nil } -func (mock *mockServer) Path(httpMethod string, url string, viewFn atreugo.View) { +func (mock *mockServer) Path(httpMethod string, url string, viewFn atreugo.View) *atreugo.Path { mock.paths = append(mock.paths, mockPath{ method: httpMethod, url: url, view: viewFn, }) + + return nil } func (mock *mockServer) SetLogOutput(output io.Writer) { diff --git a/modules/admin/types.go b/modules/admin/types.go index b30d25b..51732cc 100644 --- a/modules/admin/types.go +++ b/modules/admin/types.go @@ -47,6 +47,6 @@ type Invalidator interface { // Server ... type Server interface { ListenAndServe() error - Path(httpMethod string, url string, viewFn atreugo.View) + Path(httpMethod string, url string, viewFn atreugo.View) *atreugo.Path SetLogOutput(output io.Writer) }