Documentation ¶
Index ¶
- Constants
- func HandleHealthz(w http.ResponseWriter, r *http.Request)
- func HandleNewTask(logger *zap.SugaredLogger, taskRunner TaskRunnerInterface, ...) func(w http.ResponseWriter, r *http.Request)
- func ListenAndServe(port string, timeout time.Duration, logger *zap.SugaredLogger, ...)
- type Authorizer
- type BashTask
- type CmdTask
- type ConcordTask
- type GateStorage
- type HelmTaskv3
- type KubectlTask
- type NGrinderTask
- func (task *NGrinderTask) CloneAndStartEndpoint() *url.URL
- func (task *NGrinderTask) Hash() string
- func (task *NGrinderTask) PollStatus(ctx context.Context) bool
- func (task *NGrinderTask) Run(ctx context.Context) *TaskRunResult
- func (task *NGrinderTask) StatusEndpoint() *url.URL
- func (task *NGrinderTask) StopEndpoint() *url.URL
- func (task *NGrinderTask) String() string
- type Task
- type TaskBase
- type TaskFactory
- type TaskRunResult
- type TaskRunner
- type TaskRunnerInterface
Constants ¶
View Source
const ARGUMENTS_INPUT_PREFIX = "arguments."
View Source
const TaskTypeBash = "bash"
View Source
const TaskTypeConcord = "concord"
TaskTypeConcord represents the concord type as string
View Source
const TaskTypeHelm = "helm"
View Source
const TaskTypeHelmv3 = "helmv3"
View Source
const TaskTypeKubectl = "kubectl"
View Source
const TaskTypeNGrinder = "ngrinder"
View Source
const TaskTypeShell = "cmd"
Variables ¶
This section is empty.
Functions ¶
func HandleHealthz ¶
func HandleHealthz(w http.ResponseWriter, r *http.Request)
HandleHealthz handles heath check requests
func HandleNewTask ¶
func HandleNewTask(logger *zap.SugaredLogger, taskRunner TaskRunnerInterface, authorizer *Authorizer) func(w http.ResponseWriter, r *http.Request)
HandleNewTask handles task creation requests
func ListenAndServe ¶
func ListenAndServe(port string, timeout time.Duration, logger *zap.SugaredLogger, taskRunner *TaskRunner, gate *GateStorage, authorizer *Authorizer, stopCh <-chan struct{})
ListenAndServe starts a web server and waits for SIGTERM
Types ¶
type Authorizer ¶ added in v1.19.0
type Authorizer struct {
// contains filtered or unexported fields
}
func NewAuthorizer ¶ added in v1.19.0
func NewAuthorizer(namespaceRegexp *regexp.Regexp) *Authorizer
func (*Authorizer) Authorize ¶ added in v1.19.0
func (a *Authorizer) Authorize(payload *flaggerv1.CanaryWebhookPayload) bool
type ConcordTask ¶
type ConcordTask struct { TaskBase Command string Org string Project string Repo string Entrypoint string Arguments map[string]string APIKeyPath string Endpoint string PollInterval time.Duration PollTimeout time.Duration BaseURL *url.URL // contains filtered or unexported fields }
ConcordTask represents a concord task
func NewConcordTask ¶
func NewConcordTask(metadata map[string]string, canary string, logger *zap.SugaredLogger) (*ConcordTask, error)
NewConcordTask instantiates a new Concord Task
func (*ConcordTask) Hash ¶
func (task *ConcordTask) Hash() string
func (*ConcordTask) Run ¶
func (task *ConcordTask) Run(ctx context.Context) (*TaskRunResult, error)
func (*ConcordTask) String ¶
func (task *ConcordTask) String() string
type GateStorage ¶
type GateStorage struct {
// contains filtered or unexported fields
}
func NewGateStorage ¶
func NewGateStorage(backend string) *GateStorage
type HelmTaskv3 ¶
type HelmTaskv3 struct { TaskBase // contains filtered or unexported fields }
func (*HelmTaskv3) Hash ¶
func (task *HelmTaskv3) Hash() string
func (*HelmTaskv3) Run ¶
func (task *HelmTaskv3) Run(ctx context.Context) (*TaskRunResult, error)
func (*HelmTaskv3) String ¶
func (task *HelmTaskv3) String() string
type KubectlTask ¶ added in v1.33.0
type KubectlTask struct { TaskBase // contains filtered or unexported fields }
func (*KubectlTask) Hash ¶ added in v1.33.0
func (task *KubectlTask) Hash() string
func (*KubectlTask) Run ¶ added in v1.33.0
func (task *KubectlTask) Run(ctx context.Context) (*TaskRunResult, error)
func (*KubectlTask) String ¶ added in v1.33.0
func (task *KubectlTask) String() string
type NGrinderTask ¶
type NGrinderTask struct { TaskBase // contains filtered or unexported fields }
func (*NGrinderTask) CloneAndStartEndpoint ¶
func (task *NGrinderTask) CloneAndStartEndpoint() *url.URL
nGrinder REST endpoints
func (*NGrinderTask) Hash ¶
func (task *NGrinderTask) Hash() string
func (*NGrinderTask) PollStatus ¶
func (task *NGrinderTask) PollStatus(ctx context.Context) bool
polling execution status of the new test and check if finished
func (*NGrinderTask) Run ¶
func (task *NGrinderTask) Run(ctx context.Context) *TaskRunResult
initiate a clone_and_start request and get new test id from response
func (*NGrinderTask) StatusEndpoint ¶
func (task *NGrinderTask) StatusEndpoint() *url.URL
func (*NGrinderTask) StopEndpoint ¶
func (task *NGrinderTask) StopEndpoint() *url.URL
func (*NGrinderTask) String ¶
func (task *NGrinderTask) String() string
type Task ¶
type Task interface { Hash() string Run(ctx context.Context) *TaskRunResult String() string Canary() string }
Modeling a loadtester task
type TaskFactory ¶
type TaskFactory = func(metadata map[string]string, canary string, logger *zap.SugaredLogger) (Task, error)
func GetTaskFactory ¶
func GetTaskFactory(typ string) (TaskFactory, bool)
type TaskRunResult ¶
type TaskRunResult struct {
// contains filtered or unexported fields
}
type TaskRunner ¶
type TaskRunner struct {
// contains filtered or unexported fields
}
func NewTaskRunner ¶
func NewTaskRunner(logger *zap.SugaredLogger, timeout time.Duration) *TaskRunner
func (*TaskRunner) Add ¶
func (tr *TaskRunner) Add(task Task)
func (*TaskRunner) GetTotalExecs ¶
func (tr *TaskRunner) GetTotalExecs() uint64
func (*TaskRunner) Start ¶
func (tr *TaskRunner) Start(interval time.Duration, stopCh <-chan struct{})
func (*TaskRunner) Timeout ¶
func (tr *TaskRunner) Timeout() time.Duration
Click to show internal directories.
Click to hide internal directories.