docs(grafana/k6): add README

This commit is contained in:
Kevin Franklin Kim 2025-08-28 14:17:25 +02:00
parent 8e4b563e02
commit 38b1d67640
No known key found for this signature in database

63
grafana/k6/README.md Normal file
View File

@ -0,0 +1,63 @@
# POSH k6 provider
## Usage
### Plugin
```go
package main
type Plugin struct {
l log.Logger
op *onepassword.OnePassword
commands command.Commands
}
func New(l log.Logger) (plugin.Plugin, error) {
inst := &Plugin{
l: l,
cache: &cache.MemoryCache{},
commands: command.Commands{},
}
// ...
if value, err := onepassword.New(l, inst.cache); err != nil {
return nil, err
} else {
inst.op = value
}
// ...
inst.commands.MustAdd(k6.NewCommand(l, inst.op))
// ...
return inst, nil
}
```
### Config
```yaml
k6:
path: ./devtools/k6
envs:
dev:
URL: https://quickpizza.grafana.com
```
### Ownbrew
To install binary locally, add:
```yaml
ownbrew:
packages:
# https://github.com/grafana/k6/releases
- name: k6
tap: foomo/tap/grafana/k6
version: 1.2.2
```