mirror of
https://github.com/mentos1386/zdravko.git
synced 2024-11-27 17:51:23 +00:00
feat: progress towards kv js implementation
This commit is contained in:
parent
cf1d26100b
commit
7c12fc069f
5 changed files with 23 additions and 13 deletions
|
@ -10,6 +10,8 @@ build:
|
|||
unstable:
|
||||
#!/bin/env bash
|
||||
set -exuo pipefail
|
||||
export DOCKER_REGISTRY={{ DOCKER_REGISTRY }}
|
||||
|
||||
goreleaser release --clean --snapshot --config ./build/release.yaml
|
||||
|
||||
IMAGES=$(docker image ls --format "{{'{{ .Repository }}:{{ .Tag }}'}}" | grep -e "{{ DOCKER_IMAGE }}.*")
|
||||
|
|
9
justfile
9
justfile
|
@ -7,17 +7,12 @@ set dotenv-load
|
|||
export JWT_PRIVATE_KEY := `cat jwt.private.pem || echo ""`
|
||||
export JWT_PUBLIC_KEY := `cat jwt.public.pem || echo ""`
|
||||
|
||||
DOCKER_REGISTRY := "ghcr.io/mentos1386/zdravko"
|
||||
GIT_SHA := `git rev-parse --short HEAD`
|
||||
|
||||
export DOCKER_REGISTRY := "ghcr.io/mentos1386/zdravko"
|
||||
|
||||
DOCKER_IMAGE := "ghcr.io/mentos1386/zdravko:sha-"+GIT_SHA
|
||||
DOCKER_IMAGE := "{{ DOCKER_REGISTRY }}:sha-{{ GIT_SHA }}"
|
||||
|
||||
STATIC_DIR := "./web/static"
|
||||
|
||||
OS := "linux darwin"
|
||||
ARCH := "amd64 arm64"
|
||||
|
||||
export CGO_ENABLED := "0"
|
||||
import 'build/Justfile'
|
||||
import 'deploy/Justfile'
|
||||
|
|
11
pkg/k6/zdravko/kv.go
Normal file
11
pkg/k6/zdravko/kv.go
Normal file
|
@ -0,0 +1,11 @@
|
|||
package zdravko
|
||||
|
||||
import "github.com/dop251/goja"
|
||||
|
||||
type Kv struct {
|
||||
}
|
||||
|
||||
func (z *Zdravko) Kv() goja.Value {
|
||||
zdravkoContext := GetZdravkoContext(z.vu.Context())
|
||||
return z.vu.Runtime().ToValue(zdravkoContext.Target)
|
||||
}
|
8
pkg/k6/zdravko/target.go
Normal file
8
pkg/k6/zdravko/target.go
Normal file
|
@ -0,0 +1,8 @@
|
|||
package zdravko
|
||||
|
||||
import "github.com/dop251/goja"
|
||||
|
||||
func (z *Zdravko) GetTarget() goja.Value {
|
||||
zdravkoContext := GetZdravkoContext(z.vu.Context())
|
||||
return z.vu.Runtime().ToValue(zdravkoContext.Target)
|
||||
}
|
|
@ -1,7 +1,6 @@
|
|||
package zdravko
|
||||
|
||||
import (
|
||||
"github.com/dop251/goja"
|
||||
"go.k6.io/k6/js/modules"
|
||||
)
|
||||
|
||||
|
@ -53,11 +52,6 @@ type Zdravko struct {
|
|||
Targets []Target
|
||||
}
|
||||
|
||||
func (z *Zdravko) GetTarget() goja.Value {
|
||||
zdravkoContext := GetZdravkoContext(z.vu.Context())
|
||||
return z.vu.Runtime().ToValue(zdravkoContext.Target)
|
||||
}
|
||||
|
||||
// Exports implements the modules.Instance interface and returns the exported types for the JS module.
|
||||
func (mi *ModuleInstance) Exports() modules.Exports {
|
||||
return modules.Exports{
|
||||
|
|
Loading…
Reference in a new issue