mirror of
https://github.com/foomo/posh-providers.git
synced 2025-10-16 12:35:41 +00:00
docs(grafana/k6): add README
This commit is contained in:
parent
8e4b563e02
commit
38b1d67640
63
grafana/k6/README.md
Normal file
63
grafana/k6/README.md
Normal 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
|
||||
```
|
||||
|
||||
Loading…
Reference in New Issue
Block a user