wickra

package module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 7, 2026 License: Apache-2.0, MIT Imports: 4 Imported by: 0

README

Wickra Strategy-CI — Go

Go bindings for the Wickra Strategy-CI test runner over its C ABI hub via cgo. A Session drives the deterministic core over a JSON boundary, so the result is byte-identical to every other Wickra Strategy-CI binding.

Install

go get github.com/wickra-lib/wickra-strategy-ci-go

The prebuilt C ABI library is staged per platform under lib/<goos>_<goarch>/ and the header is vendored under include/. For a local build, copy the library built by cargo build -p wickra-strategy-ci-c --release into the matching lib/<goos>_<goarch>/ directory (on Windows, ensure that directory is on PATH when running tests).

Usage

package main

import (
	"fmt"

	wickra "github.com/wickra-lib/wickra-strategy-ci-go"
)

func main() {
	s := wickra.New()
	defer s.Close()

	resp, err := s.Command(`{"cmd":"run_test","test":{ /* ... */ },"data":{ /* ... */ }}`)
	if err != nil {
		panic(err)
	}
	fmt.Println(resp)
}

Surface

  • New() *Session — a stateless test session; tests and data are passed with each command. Call Close when done.
  • (*Session) Command(cmdJSON string) (string, error) — run a command envelope ({"cmd":"...", ...}) and return the response JSON. Commands: run_test, bless, run_suite, list, version.
  • Version() string — the crate version.

Internal errors come back as an {"ok": false, "error": ...} response, not as a returned error. The error is reserved for hard failures at the C ABI boundary.

Determinism

The response bytes are identical across languages and between the parallel and sequential execution paths, because the whole test runner lives once in the Rust core and this binding forwards its JSON verbatim.

See also

License

Dual-licensed under either MIT or Apache-2.0, at your option.

Documentation

Overview

Package wickra provides idiomatic Go bindings for wickra-strategy-ci over its C ABI hub: create a Session, drive it with command JSON (run_test, bless, run_suite, list, version) and read back the response JSON — the same protocol as the CLI and every other binding.

The binding links the prebuilt C ABI library, staged per platform under ./lib/<goos>_<goarch>/, with the header vendored under ./include.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Version

func Version() string

Version returns the library version.

Types

type Session

type Session struct {
	// contains filtered or unexported fields
}

Session is a stateless strategy-test session driven by JSON commands. Tests and data are passed with each command.

func New

func New() *Session

New creates a session. Call Close when done (a finalizer also frees it, but explicit Close is preferred).

func (*Session) Close

func (s *Session) Close()

Close frees the session handle. Safe to call more than once.

func (*Session) Command

func (s *Session) Command(cmdJSON string) (string, error)

Command applies a command JSON and returns the response JSON. It uses the C ABI's length-out protocol: a first call learns the length, then the response is read into a caller-owned buffer.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL