Skip to content

Commit

Permalink
reduce dependencies, add test code for examples
Browse files Browse the repository at this point in the history
  • Loading branch information
emicklei committed Dec 24, 2023
1 parent a328c20 commit aaf45fd
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 4 deletions.
2 changes: 2 additions & 0 deletions examples/filters/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
curl http://localhost:8080/users/42
curl http://localhost:8080/users
1 change: 1 addition & 0 deletions examples/form-httpin/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
curl http://localhost:8080/users?gender=male&age_range=18&age_range=22&is_member=1&access_token=my-private-secret
1 change: 1 addition & 0 deletions examples/form/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
curl -X POST -d "name=test" -H "content-type:application/x-www-form-urlencoded" http://localhost:8080/profiles
1 change: 1 addition & 0 deletions examples/fulllog/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
curl -H "content-type:application/json" http://localhost:8080/users -d '{"Id":42, "Name":"Captain Marvel"}'
3 changes: 3 additions & 0 deletions examples/google-custom-method/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
curl http://localhost:8080/resource:validate
curl -X POST http://localhost:8080/resource/some-resource-id:init
curl -X POST http://localhost:8080/resource/some-resource-id:recycle
1 change: 1 addition & 0 deletions examples/hello/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
curl http://localhost:8080/hello
1 change: 1 addition & 0 deletions examples/jwtauth/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
curl http://localhost:8080/secret
1 change: 1 addition & 0 deletions examples/pathtail/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
curl http://localhost:8080/basepath/some/other/location/test.xml
2 changes: 2 additions & 0 deletions examples/prepost/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
curl http://localhost:8080/1
curl http://localhost:8080/2
5 changes: 1 addition & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,4 @@ module github.com/emicklei/go-restful/v3

go 1.13

require (
github.com/emicklei/go-restful-openapi/v2 v2.9.1
github.com/go-openapi/spec v0.20.9
)
require github.com/json-iterator/go v1.1.12
15 changes: 15 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=

0 comments on commit aaf45fd

Please sign in to comment.