mirror of https://github.com/knative/client.git
bumping golang.org/x/time 2ce7c29...f3bd1da: > f3bd1da rate: add TokenAt and Tokens methods to Limiter. bumping knative.dev/serving 484e848...587f587: > 587f587 add missing probes (# 13563) > 5e3b4af Adds e2e test for activation-scale (# 13197) > b285cb4 Update net-certmanager nightly (# 13762) > aab7abe Update net-contour nightly (# 13761) > 0cf0da8 Update net-gateway-api nightly (# 13756) > efc0bb0 Update net-kourier nightly (# 13760) > 6bc4bb2 upgrade to latest dependencies (# 13759) > 59d4c52 Update net-kourier nightly (# 13755) > 5a7a72e Update net-contour nightly (# 13758) > cc58860 Update net-certmanager nightly (# 13757) > 879c723 upgrade to latest dependencies (# 13742) > 23212b3 Update net-kourier nightly (# 13733) > 12b0690 Update net-contour nightly (# 13734) > 628b3e6 Update net-gateway-api nightly (# 13732) > cd3fe03 Update net-certmanager nightly (# 13735) > 28b8fba upgrade to latest dependencies (# 13730) > 708374e TestAutoscaleSustaining scales to 8 instead of 10 (# 13679) > 168ea39 Update net-contour nightly (# 13729) > f2ee629 Update net-certmanager nightly (# 13728) > bd75129 upgrade to latest dependencies (# 13726) > f4792e4 check for renewing status (# 13666) > 51ed9ad Update net-contour nightly (# 13724) > 1b99dce Update net-gateway-api nightly (# 13719) > fe52019 Update net-certmanager nightly (# 13718) > 506f8c6 Update net-contour nightly (# 13717) > 1f5f822 Update net-kourier nightly (# 13698) > 7aeb55d Update net-gateway-api nightly (# 13716) > aa4149f Update net-certmanager nightly (# 13715) > 04da752 upgrade to latest dependencies (# 13713) > dfd39ca Update support rotation (# 13714) > 8c282ba Update net-certmanager nightly (# 13697) > 7ed2869 Update support rotation contacts (# 13703) > 0ec0ecf Update net-gateway-api nightly (# 13699) > 060a49a Update net-contour nightly (# 13705) > 53e91c9 Fix G112: Potential Slowloris Attacks lint errs (# 13702) > a99a936 upgrade to latest dependencies (# 13709) > 08812b3 Update net-istio nightly (# 13706) > 368994b Update community files (# 13707) > d68797e Bumping 'github.com/google/go-containerregistry' dependency (# 13701) > 9b9a951 upgrade to latest dependencies (# 13689) > e2add5d fix curl invocation (# 13683) > 6334ffe Update net-contour nightly (# 13676) > d7959af Update net-certmanager nightly (# 13686) > 4db2ada Update net-istio nightly (# 13687) > 7f2264d Update community files (# 13685) > baa6292 Update net-gateway-api nightly (# 13672) > 83d2dd7 Update net-kourier nightly (# 13673) > 2fc2a12 fix route reconciler test flakes (# 13684) > 729eb6d Update net-istio nightly (# 13674) > 30a2b0c Add k8s 1.26 for kind (# 13682) > 3764762 use GITHUB_TOKEN when querying net-istio releases (# 13681) > 485f2a9 upgrade to latest dependencies (# 13680) > 0639c5f Update community files (# 13678) > b4d7a28 clean up OWNER files (# 13668) > 68e128b Update net-contour nightly (# 13667) > f6ab591 Adds slack links to CNCF Knative slack channel (# 13655) > 53b3c92 Add serving-internal docs about Knative encryption support (# 13662) > 3b8d6cb Update net-contour nightly (# 13656) > b9b4c57 Update net-gateway-api nightly (# 13654) > 63832e2 Update net-contour nightly (# 13650) > 908edaf Update net-istio nightly (# 13649) > 06add5f Update net-kourier nightly (# 13648) bumping knative.dev/networking db2bcbe...c692e9e: > c692e9e upgrade to latest dependencies (# 776) > 475e232 upgrade to latest dependencies (# 775) > 5a5f810 upgrade to latest dependencies (# 767) > 2c2695b upgrade to latest dependencies (# 766) > 1bd50a5 Update community files (# 764) > 6a15e7d upgrade to latest dependencies (# 765) > 9373ba6 upgrade to latest dependencies (# 762) > 195809a Update community files (# 761) > c3510af upgrade to latest dependencies (# 760) > 2473e65 Update community files (# 759) > f6585dc update OWNERS file (# 758) > 89f3990 Assert all the expected DNSNames are part of the HTTP01 challenge (# 756) > 4ccbe60 adjust domain validation in kcert (# 754) bumping github.com/google/go-containerregistry 31786c6...1e09daa: > 1e09daa clarify crane download readme (# 1533) > 8e08d51 Revert "Hack around DockerHub plugin scope handling" (# 1531) > 5ad0a76 crane: support --full-ref for crane ls (# 1525) > b063f6a Hack around DockerHub plugin scope handling (# 1527) > e797859 crane: add digest --full (# 1524) > 3986cf4 test: use `T.TempDir` to create temporary test directory (# 1522) > 9db616f FIX mutate.Time not respecting history (# 1520) > 8048663 Race http fallback ping (# 1521) > e64ff3a Bump actions/stale from 6 to 7 (# 1519) > 9bd8237 Bump goreleaser/goreleaser-action from 3.2.0 to 4.1.0 (# 1511) > ffc14a0 Treat empty registry config as anonymous (# 1512) > 23d895d Fix missing doc comment (# 1509) > 6ba20c8 Fix various lints (# 1507) > 4270e04 Update Arch Linux install instructions (# 1508) > 37bf5df Revert "docs: pull latest instead of debug (# 1497)" (# 1504) > 47f0933 Use the default retry predicate in transport (# 1502) > c7270c2 Make unit tests substantially faster (# 1498) > a35805d Make credential warning slightly more accurate (# 1499) > 37b993a docs: pull latest instead of debug (# 1497) > cd77615 Add support for zstd compression (# 1487) > c412593 Fix calculating tarball size when duplicated layers exist (# 1495) > bdc946f add source archive checksum into the checksums.txt (# 1492) > 781782a Bump golangci/golangci-lint-action from 3.3.0 to 3.3.1 (# 1491) > 9e939fb Features: Allow eliding `serviceaccount` lookups. (# 1490) > 3e4f490 Bump slsa-framework/slsa-github-generator to 1.2.2 (# 1489) > 76ae819 Fix context.DeadlineExceeded comparison (# 1488) > 353a117 crane: add catalog argument use annotation (# 1473) > 1711cef Fix missing body.Close() in bearer auth (# 1482) > 426de7d Bump golangci/golangci-lint-action from 3.2.0 to 3.3.0 (# 1475) > 6442b02 Bump goreleaser/goreleaser-action from 3.1.0 to 3.2.0 (# 1476) > a0cca8a k8schain: Log and proceed if secret or SA are not found (# 1472) > 02f47e1 bump version of slsa generator (# 1468) > 3413eb6 registry: implement pagination (# 1430) > d3ed408 registry: implement blob deletion (# 1432) > 969699e Bump deps using ./hack/bump-deps.sh (# 1467) > 9b4fdd5 Bump actions/setup-go from 2 to 3 (# 1463) > a0f6687 Make ErrBadName checkable via errors.Is() (# 1462) > 7268da0 Bump actions/stale from 5 to 6 (# 1452) > 8eae069 Bump codecov/codecov-action from 3.1.0 to 3.1.1 (# 1453) > 9a5c14a fix crane's root.go after DefaultTransport change (# 1450) > e3b94c7 allow remote.DefaultTransport to be overridden by an http.RoundTripper (# 1449) > f981b4c deps: update goreleaser-action for bug (# 1444) > 87b3a79 feat: Add krane to release archive (# 1443) > e2d575c update crane installation instructions and release verification (# 1440) > 2859a0d feat: generate slsa provenance on github release artifacts (# 1438) > 771a9b4 e2e: pull and export stdin and stdout (# 1436) > 2b54510 fix: consider base image media type when appending layers (# 1437) > 7196cf3 Bump aws-actions/configure-aws-credentials from 1.6.1 to 1.7.0 (# 1424) > c1f9836 Bump opencontainers/image-spec (# 1423) > 24a1c33 Ignore docker config if it's a directory (# 1420) > 49cdb8b Correct usage of authn.NewKeychainFromHelper in docs (# 1419) > 19e3eff Retry ECONNRESET errors (# 1415) > 3ba4c51 Fix tar PAX format handling (# 1414) > 5749ee6 Support the platform specific authentication of krane in "auth get" command (# 1413) bumping golang.org/x/crypto 35f4265...642fcc3: > 642fcc3 go.mod: update golang.org/x dependencies > 56aed06 all: use automatic RFC linking > 9be5aaa all: fix a few function names on comments > d6f0a8c ssh: add ServerConfig.NoClientAuthCallback > 4161e89 all: replace bytes.Compare with bytes.Equal > eccd636 acme/autocert: remove TestRenewFromCache skips > 4ba4fb4 acme/autocert: fix renewal timer issue bumping knative.dev/eventing 4d6e1fc...1ff36e1: > 1ff36e1 Support testing ContainerSource with istio (# 6790) > a8128e6 [main] Upgrade to latest dependencies (# 6774) > 397387e SC settings for ApiServerSource's Receive Adapter's container/deployment (# 6788) > b474770 No reason for API ServerSource adapter to not inject istio sidecar (# 6789) > 7d7df2d Removes the deprecated DeadLetterChannel in ChannelableStatus (# 6722) > c5847a9 Port broker many triggers testcase to rekt (# 6761) > 52574ce Fixes issue where a CE response is truncated (# 6758) > 44b0b8a Remove deprecated usage of ZipkinTracingEnabled (# 6780) > 07e6d0c [main] Upgrade to latest dependencies (# 6770) > 70d2cb9 Pass EnvConfig to Broker conformance tests (# 6769) > f6afad3 Exclusive access to tracing flag for upgrade prober (# 6767) > 843b6f2 Allow event display to log requests (# 6764) > 23dc742 [main] Upgrade to latest dependencies (# 6765) > 82d85f9 [main] Upgrade to latest dependencies (# 6762) > 5f24569 [main] Upgrade to latest dependencies (# 6744) > dac6b8b [main] Update community files (# 6756) > 2b517b6 Deprecate `test/rekt/resources/svc` (# 6742) > bbbd425 Deprecate `test/rekt/resources/deployment` (# 6748) > f022034 Update dependencies (# 6753) > fdffabe Deprecate `test/rekt/resources/pod` package (# 6747) > dfd095f Remove event flaker since eventshub offers an equivalent feature (# 6750) > 0ab29eb Remove unused event-library (# 6751) > 82324b9 [main] Update community files (# 6743) > 452cd49 Adds apiVersion as an extension to api source events (# 6696) > b96d2fb Migrate from `knative.dev/reconciler-test/resources/svc` to `knative.dev/reconciler-test/pkg/resources/service` (# 6741) > f9ceb4f [main] Upgrade to latest dependencies (# 6715) > 37fa6e0 Extract scheduler config in a dedicate struct instead of many parameters (# 6736) > 4911986 Add function to check if a broker resource is `NotReady` (# 6737) > 2f98e55 Improve scheduler logging for state and pending vpods (# 6729) > 1092472 Scheduler doesn't reschedule vpods that are scheduled on unscehdulable pods (# 6726) > 40517be Added Broker class in `kubectl get -o wide` (# 6723) > e609459 [main] Update community files (# 6727) > 47a793b Revert "Change subscription patch logic to ensure resource version (# 6670) (# 6724) > 8b7551c Removing one more deprecated, unused func (# 6718) > 228eda3 Removing deprecated and unused func (# 6716) > ffc8fe0 Default a subscriptions subscriber and reply in webhook (# 6701) > 8d62a06 Adds link to the Knative CNCF Slack Channel (# 6711) > 91a1991 Install source at requirement phase in conformance tests (# 6712) > 983189d Set scheduler logging to debug (# 6705) > c3364e4 Remove UNUSED and deprecated test helpers (# 6710) > 9b8c4d6 Port BrokerWorkFlowWithTranformation test to rekt and code cleanup (# 6709) > 45e7a24 Do not overwrite existing imagePullSecrets in CopySecret (# 6707) > efba019 [main] Format Go code (# 6702) bumping golang.org/x/sync f12130a...8fcdb60: > 8fcdb60 singleflight: avoid race between multiple Do calls > 7f9b162 singleflight: remove forgotten field bumping golang.org/x/mod 86c51ed...b3066c3: > b3066c3 go.mod: update golang.org/x dependencies > e3c1277 go.mod: update to tagged x/tools version > aac77cd all: fix a few function names on comments > 2666ed6 go.mod: ignore cyclic dependency for tagging > 2adab6b zip: expand logging and use t.TempDir and t.Cleanup in test helpers > 02c9913 sumdb: remove redundant type conversion > 8f535f7 sumdb/note: fix some typos > ed83ed6 modfile: remove duplicate words from comments > f994a2a zip: set PWD consistently for commands in subdirectories > 046e8b3 modfile: improve error message for replace with '@' in path bumping knative.dev/pkg 247510c...b77a78c: > b77a78c upgrade to latest dependencies (# 2698) > 310274d bump golang version in downstream tests (# 2697) > fd00e03 Add certs secret name read from env (# 2685) > 645afb2 bump golang.org/x/net to v0.7.0 (# 2695) > 0591b75 bump net and text packages (# 2692) > 2fdd6bf Allow reconcilers to listen to leader promotion events (# 2688) > f65eba5 Make ZipkinTracingEnabled flag thread safe (# 2690) > f306c13 upgrade to latest dependencies (# 2684) > 2f55fe0 Fix potential slowloris attack (# 2682) > 8d1efe1 Update community files (# 2683) > 4a80605 Add health checks (# 2671) > 33e6b88 fix: `reconcilerImpl.updateStatus` calculates state difference in debug mode only (# 2678) > c889c5b upgrade to latest dependencies (# 2679) > fb44e94 Update community files (# 2676) > decc1cc Update community files (# 2674) > 8532ae0 update OWNERS files to use teams with active members (# 2672) > 408ad07 Make SetDefaults of Destination duck type nil safer (# 2670) bumping k8s.io/kube-openapi 67bda5d...172d655: > 172d655 Merge pull request # 319 from alexzielenski/json_next > 829ce0c fix json unmarshal bug when extension used with Responses (# 320) > 8d49439 add JSONRoundTripTestCase and add a Test*RoundTrip for every spec.* type which needs it > b7a9e6f Merge pull request # 318 from dims/add-go.mod-for-integration-tests > 3b3bb66 add jsonv2 roundtrip fuzz tests and benchmarks > a70c9af Merge pull request # 307 from apelisse/test-required-job > b856c89 Add a go.mod for integration test > 395774f add jsonv2 implementation > c6e407d Add required job that depends on matrix jobs > c601e50 add go-json-experiment/json to pkg/internal/third_party > 5ca72f5 gofmt changes Signed-off-by: Knative Automation <automation@knative.team> |
||
|---|---|---|
| .. | ||
| log | ||
| .gitignore | ||
| .goconvey | ||
| .travis.yml | ||
| CHANGES.md | ||
| LICENSE | ||
| Makefile | ||
| README.md | ||
| SECURITY.md | ||
| Srcfile | ||
| bench_test.sh | ||
| compress.go | ||
| compressor_cache.go | ||
| compressor_pools.go | ||
| compressors.go | ||
| constants.go | ||
| container.go | ||
| cors_filter.go | ||
| coverage.sh | ||
| curly.go | ||
| curly_route.go | ||
| custom_verb.go | ||
| doc.go | ||
| entity_accessors.go | ||
| extensions.go | ||
| filter.go | ||
| filter_adapter.go | ||
| json.go | ||
| jsoniter.go | ||
| jsr311.go | ||
| logger.go | ||
| mime.go | ||
| options_filter.go | ||
| parameter.go | ||
| path_expression.go | ||
| path_processor.go | ||
| request.go | ||
| response.go | ||
| route.go | ||
| route_builder.go | ||
| route_reader.go | ||
| router.go | ||
| service_error.go | ||
| web_service.go | ||
| web_service_container.go | ||
README.md
go-restful
package for building REST-style Web Services using Google Go
REST asks developers to use HTTP methods explicitly and in a way that's consistent with the protocol definition. This basic REST design principle establishes a one-to-one mapping between create, read, update, and delete (CRUD) operations and HTTP methods. According to this mapping:
- GET = Retrieve a representation of a resource
- POST = Create if you are sending content to the server to create a subordinate of the specified resource collection, using some server-side algorithm.
- PUT = Create if you are sending the full content of the specified resource (URI).
- PUT = Update if you are updating the full content of the specified resource.
- DELETE = Delete if you are requesting the server to delete the resource
- PATCH = Update partial content of a resource
- OPTIONS = Get information about the communication options for the request URI
Usage
Without Go Modules
All versions up to v2.*.* (on the master) are not supporting Go modules.
import (
restful "github.com/emicklei/go-restful"
)
Using Go Modules
As of version v3.0.0 (on the v3 branch), this package supports Go modules.
import (
restful "github.com/emicklei/go-restful/v3"
)
Example
ws := new(restful.WebService)
ws.
Path("/users").
Consumes(restful.MIME_XML, restful.MIME_JSON).
Produces(restful.MIME_JSON, restful.MIME_XML)
ws.Route(ws.GET("/{user-id}").To(u.findUser).
Doc("get a user").
Param(ws.PathParameter("user-id", "identifier of the user").DataType("string")).
Writes(User{}))
...
func (u UserResource) findUser(request *restful.Request, response *restful.Response) {
id := request.PathParameter("user-id")
...
}
Features
- Routes for request → function mapping with path parameter (e.g. {id} but also prefix_{var} and {var}_suffix) support
- Configurable router:
- (default) Fast routing algorithm that allows static elements, google custom method, regular expressions and dynamic parameters in the URL path (e.g. /resource/name:customVerb, /meetings/{id} or /static/{subpath:*})
- Routing algorithm after JSR311 that is implemented using (but does not accept) regular expressions
- Request API for reading structs from JSON/XML and accessing parameters (path,query,header)
- Response API for writing structs to JSON/XML and setting headers
- Customizable encoding using EntityReaderWriter registration
- Filters for intercepting the request → response flow on Service or Route level
- Request-scoped variables using attributes
- Containers for WebServices on different HTTP endpoints
- Content encoding (gzip,deflate) of request and response payloads
- Automatic responses on OPTIONS (using a filter)
- Automatic CORS request handling (using a filter)
- API declaration for Swagger UI (go-restful-openapi, see go-restful-swagger12)
- Panic recovery to produce HTTP 500, customizable using RecoverHandler(...)
- Route errors produce HTTP 404/405/406/415 errors, customizable using ServiceErrorHandler(...)
- Configurable (trace) logging
- Customizable gzip/deflate readers and writers using CompressorProvider registration
- Inject your own http.Handler using the
HttpMiddlewareHandlerToFilterfunction
How to customize
There are several hooks to customize the behavior of the go-restful package.
- Router algorithm
- Panic recovery
- JSON decoder
- Trace logging
- Compression
- Encoders for other serializers
- Use jsoniter by building this package using a build tag, e.g.
go build -tags=jsoniter .
Resources
- Example programs
- Example posted on blog
- Design explained on blog
- sourcegraph
- showcase: Zazkia - tcp proxy for testing resiliency
- showcase: Mora - MongoDB REST Api server
Type git shortlog -s for a full list of contributors.
© 2012 - 2022, http://ernestmicklei.com. MIT License. Contributions are welcome.
