policy_sdk_go

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

README

Chimera Go Policy SDK

This module provides a SDK that can be used to write Chimera Policies using the Go programming language.

Due to current Go compiler limitations, Go policies must be built using TinyGo.

Building your policy with TinyGo

Assuming your policy tree looks like:

.
├── go.mod
├── go.sum
├── main.go

You can build the project with TinyGo from within that folder:

docker run --rm -v ${PWD}:/src -w /src tinygo/tinygo:0.17.0 tinygo build -o my-policy.wasm -target=wasi -no-debug .

Resulting in:

.
├── go.mod
├── go.sum
├── main.go
├── my-policy.wasm

Documentation

Index

Constants

View Source
const (
	NoMessage Message = ""
	NoCode    Code    = 0
)

Variables

This section is empty.

Functions

func AcceptRequest

func AcceptRequest() ([]byte, error)

func RejectRequest

func RejectRequest(message Message, code Code) ([]byte, error)

Types

type Code

type Code uint16

type Message

type Message string

Jump to

Keyboard shortcuts

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