aboutsummaryrefslogtreecommitdiff
path: root/example.go
AgeCommit message (Collapse)Author
2026-02-04cmd/gorankusu: implement socket based activation with systemdHEADmaindevShulhan
The internal/cmd/gorankusu now can run using systemd.socket(5).
2025-02-03cmd/gorankusu: add flags to set HTTP address and development modeShulhan
The flag "dev" is boolean that when set will run service in development mode, watching the adoc and ts files. The flag "http" is string that set the HTTP listen address.
2024-06-08all: add git.sr.ht APIs into exampleShulhan
The APIs is created using https://man.sr.ht/git.sr.ht/api.md as reference. We also needs the API to create webhook since no other way to create it in current sourcehut web.
2024-04-24all: refactoring form input for multipart form-dataShulhan
This changes replace handling type for storing multipart form-data from "map[string][]byte" to [*multipart.Form] based on changes on module "pakakeh.go".
2024-03-15all: update module pakakeh.go to the tipShulhan
2024-03-05all: replace module "share" with "pakakeh.go"Shulhan
2024-02-21all: move reading GORANKUSU_DEV environment to [Environment.IsDevelopment]Shulhan
2024-02-21all: add parameter to use custom listen address in NewExampleShulhan
This will allow running Example server with "make dev" and the test with "make" or "make test" at the same time.
2024-02-21all: add global HTTP headers for TargetShulhan
The Headers field on Target define the global headers that will be send along with all HTTPTarget or WebSocketTarget. The same header can also be defined on HTTPTarget that override the value of Target.
2024-02-19all: remove Run in ExampleShulhan
The Run handler is handled automatically.
2024-02-18example: add POST header that can return custom HTTP response codeShulhan
In some cases we found that if the HTTP response code is 202 the JSON response body is not indented. Turns out this is caused by HTTP Content-Type in response is "text/plain". Closes: https://todo.sr.ht/~shulhan/gorankusu/6
2024-02-16target: changes Opts to non-pointerShulhan
Previously, we use pointer to indicated that the Target can be attacked or not. Since HTTPTarget now have AllowAttack, this options can be changes to non-pointer.
2024-02-16all: change the signature of default request/response dumperShulhan
Instead of function that use the signature of HTTPRequestDumper/ HTTPResponseDumper; change it to function that _return_ HTTPRequestDumper/ HTTPResponseDumper. In this way, the documentation can show the clear relation between function and its type.
2024-02-16example: check for error and set default attack duration to 10 secondsShulhan
2024-02-16all: set default HTTPTarget Attack if its not setShulhan
Previously, the function for Attack need to be coded manually. This changes introduce new function DefaultHTTPAttack that generate HTTPAttackHandler based on the HTTPTarget method, request type, and Params; if AllowAttack is true and Attack is nil. Implements: https://todo.sr.ht/~shulhan/gorankusu/4
2024-02-15all: move example to root directoryShulhan
The goal is to remove duplicate code in testing and show the example on how to create Gorankusu service from godoc. Implements: https://todo.sr.ht/~shulhan/gorankusu/5