contract-go

command module
v1.0.39 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

README

Contract Go

Utility functions to encrypt and decrypt an Hyper Protect Container Runtime contract.

Usage

Refer to main.go for an example

Design

The API design is based on functional and monadic interfaces exposed by the fp-go library.

Error Handling

Functions that can produce an error return an Either instead of the idiomatic golang tuple, because an Either can be used in functiona composition but the tuple cannot.

Side Effects

Functions with side effects are represented as IOEither, i.e. the actual execution of the side effect is deferred until the function gets executed

Idiomatic golang style
  • Either: to convert a function returning Either to a function in golang style, call Either.UneitherizeXXX

References

  • contract-schema - JSON schema for the contract
  • fp-go - implementation of the functional programming layer

Documentation

Overview

Package main contains the entry point for the code generator

Jump to

Keyboard shortcuts

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