Skip to content

Commit

Permalink
feat: progress towards kv js implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
mentos1386 committed Jun 8, 2024
1 parent cf1d261 commit 7c12fc0
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 13 deletions.
2 changes: 2 additions & 0 deletions build/Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}.*")
Expand Down
9 changes: 2 additions & 7 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
11 changes: 11 additions & 0 deletions pkg/k6/zdravko/kv.go
Original file line number Diff line number Diff line change
@@ -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 changes: 8 additions & 0 deletions pkg/k6/zdravko/target.go
Original file line number Diff line number Diff line change
@@ -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)
}
6 changes: 0 additions & 6 deletions pkg/k6/zdravko/zdravko.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package zdravko

import (
"github.com/dop251/goja"
"go.k6.io/k6/js/modules"
)

Expand Down Expand Up @@ -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{
Expand Down

0 comments on commit 7c12fc0

Please sign in to comment.