mirror of
https://github.com/hanzoai/deploy.git
synced 2026-10-07 08:44:50 +00:00
* add internal http package Signed-off-by: Maxence Laude <[email protected]> * add services plugin Signed-off-by: Maxence Laude <[email protected]> * add generator plugin Signed-off-by: Maxence Laude <[email protected]> * adapted matrix && merge generator Signed-off-by: Maxence Laude <[email protected]> * adapted plugin to webhook Signed-off-by: Maxence Laude <[email protected]> * update applicationset controller and types for plugin Signed-off-by: Maxence Laude <[email protected]> * add proposal for applicationset plugin generator Signed-off-by: Maxence Laude <[email protected]> * execute codegen Signed-off-by: Maxence Laude <[email protected]> * First draft of documentation Signed-off-by: Maxence Laude <[email protected]> * Fix wrong expected error on client_test Signed-off-by: Maxence Laude <[email protected]> * docs(plugin-generator): minor improvements Signed-off-by: Sébastien Crocquesel <[email protected]> * Improvement * changes Signed-off-by: Michael Crenshaw <[email protected]> * fix docs Signed-off-by: Michael Crenshaw <[email protected]> * wrap output Signed-off-by: Michael Crenshaw <[email protected]> * fix test Signed-off-by: Michael Crenshaw <[email protected]> * fix tests Signed-off-by: Michael Crenshaw <[email protected]> * nested parameters Signed-off-by: Michael Crenshaw <[email protected]> * simplify Signed-off-by: Michael Crenshaw <[email protected]> * docs Signed-off-by: Michael Crenshaw <[email protected]> --------- Signed-off-by: Michael Crenshaw <[email protected]> * Add plugin to GetRequeueAfter function (merge && matrix) Signed-off-by: Maxence Laude <[email protected]> * Improvement : renaming * more changes Signed-off-by: Michael Crenshaw <[email protected]> * clearer docs Signed-off-by: Michael Crenshaw <[email protected]> * abstract Signed-off-by: Michael Crenshaw <[email protected]> * naming Signed-off-by: Michael Crenshaw <[email protected]> * revert accidental change Signed-off-by: Michael Crenshaw <[email protected]> * ugh Signed-off-by: Michael Crenshaw <[email protected]> * fix accidental renames Signed-off-by: Michael Crenshaw <[email protected]> --------- Signed-off-by: Michael Crenshaw <[email protected]> * Fix typo renaming Signed-off-by: Maxence Laude <[email protected]> * Improve docs Signed-off-by: Maxence Laude <[email protected]> * Webhook implementation Signed-off-by: Maxence Laude <[email protected]> * Typo docs Signed-off-by: Maxence Laude <[email protected]> * fix plugin generator nil panic Signed-off-by: Michael Crenshaw <[email protected]> * Add company to USERS.md Signed-off-by: Maxence Laude <[email protected]> * input.parameters * fix plugin generator nil panic Signed-off-by: Michael Crenshaw <[email protected]> * input.parameters Signed-off-by: Michael Crenshaw <[email protected]> --------- Signed-off-by: Michael Crenshaw <[email protected]> * Change param structure * change param structure Signed-off-by: Michael Crenshaw <[email protected]> * nest parameters Signed-off-by: Michael Crenshaw <[email protected]> --------- Signed-off-by: Michael Crenshaw <[email protected]> * Fix conflicts Signed-off-by: Maxence Laude <[email protected]> * Fix docs Signed-off-by: Maxence Laude <[email protected]> * Fix docs Signed-off-by: Maxence Laude <[email protected]> --------- Signed-off-by: Maxence Laude <[email protected]> Signed-off-by: Sébastien Crocquesel <[email protected]> Signed-off-by: Michael Crenshaw <[email protected]> Co-authored-by: Sébastien Crocquesel <[email protected]> Co-authored-by: Michael Crenshaw <[email protected]>
23 lines
541 B
Go
23 lines
541 B
Go
package http
|
|
|
|
import "time"
|
|
|
|
// ClientOptionFunc can be used to customize a new Restful API client.
|
|
type ClientOptionFunc func(*Client) error
|
|
|
|
// WithToken is an option for NewClient to set token
|
|
func WithToken(token string) ClientOptionFunc {
|
|
return func(c *Client) error {
|
|
c.token = token
|
|
return nil
|
|
}
|
|
}
|
|
|
|
// WithTimeout can be used to configure a custom timeout for requests.
|
|
func WithTimeout(timeout int) ClientOptionFunc {
|
|
return func(c *Client) error {
|
|
c.client.Timeout = time.Duration(timeout) * time.Second
|
|
return nil
|
|
}
|
|
}
|