contract

package
v0.1.85 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KEY_TARGET_CONTRACT_PUB_KEY_FILENAME = "TARGET_CONTRACT_PUB_KEY_FILENAME"
)

Variables

View Source
var LoadPublicKeyFromEnv = F.Flow3(
	lookupCrt,
	E.FromOption[string](errors.OnNone("unable to locate the contract certificate from the environment variable [%s].", KEY_TARGET_CONTRACT_PUB_KEY_FILENAME)),
	E.Chain(readFile),
)

LoadPublicKeyFromEnv locats the contract key from the environment and loads it

View Source
var (

	// LoadRawContractFromYAML reads a contract from a YAML file
	LoadRawContractFromYAML = F.Flow2(
		readFile,
		E.Chain(C.ParseRawMapE),
	)
)

Functions

func CreateBusyboxContract

func CreateBusyboxContract(env map[string]string) E.Either[error, C.RawMap]

CreateBusyboxContract constructs the contract for the busybox image

func CreateContract

func CreateContract(env map[string]string) func(composeFolder string) E.Either[error, C.RawMap]

CreateContract constructs the contract for a specified image

func DefaultEncryption

func DefaultEncryption() ENC.Encryption

DefaultEncryption returns the default encryption implementation

func EncryptContract

func EncryptContract(encCert []byte) func(contract C.RawMap) E.Either[error, C.RawMap]

EncryptContract creates an encryption function on top of an encryption certificate that will encrypt and sign the contract. The signing key will be a temporary private key

func ValidateContract

func ValidateContract(contract C.RawMap) E.Either[error, C.RawMap]

ValidateContract validates a contract against its JSON schema

Types

type Credential

type Credential struct {
	Username string `json:"username" yaml:"username"`
	Password string `json:"password" yaml:"password"`
}

type Credentials

type Credentials = map[string]Credential

type LogDNA

type LogDNA struct {
	IngestionKey string `json:"ingestionKey" yaml:"ingestionKey"`
	Hostname     string `json:"hostname" yaml:"hostname"`
}

type Logging

type Logging struct {
	LogDNA *LogDNA `json:"logDNA" yaml:"logDNA"`
}

Jump to

Keyboard shortcuts

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