common

package
v0.5.0 Latest Latest
Warning

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

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

Documentation

Overview

Copyright 2022 IBM Corp.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2022 IBM Corp.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2022 IBM Corp.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2022 IBM Corp.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	KeyAttestation = "attestation"
	KeyCert        = "cert"
	KeyCerts       = "certs"
	KeyChecksum    = "checksum"
	KeyChecksums   = "checksums"
	KeyContract    = "contract"
	KeyFolder      = "folder"
	KeyImageID     = "image"
	KeyImages      = "images"
	KeyJSON        = "json"
	KeyPrivKey     = "privkey"
	KeyRendered    = "rendered"
	KeySha256      = "sha256"
	KeySpec        = "spec"
	KeyTemplate    = "template"
	KeyText        = "text"
	KeyVersion     = "version"
	KeyVersions    = "versions"

	KeyExpiryDays = "expiry"
	KeyCaCert     = "cacert"
	KeyCaKey      = "cakey"
	KeyCsrParams  = "csrparams"
	KeyCsrfile    = "csrfile"

	PrefixBasicEncoding = "hyper-protect-basic"
)

Variables

View Source
var (
	Base64Encode  = base64.StdEncoding.EncodeToString
	Base64DecodeE = E.Eitherize1(base64.StdEncoding.DecodeString)

	Base64EncodeE = F.Flow2(
		Base64Encode,
		E.Of[error, string],
	)

	PlainTextEncodeE = F.Flow2(
		B.ToString,
		E.Of[error, string],
	)

	CreateTempE = E.Eitherize2(os.CreateTemp)

	MapBytesToStgE = E.Map[error](B.ToString)
	MapStgToBytesE = E.Map[error](S.ToBytes)
	MapRefAnyE     = E.Map[error](F.Ref[any])

	FromErrorO = O.FromPredicate(isError)
)
View Source
var (
	GetStdOut = T.First[[]byte, []byte]
)

Functions

func DefaultHttpClient added in v0.1.11

func DefaultHttpClient() *http.Client

func ExecCommand

func ExecCommand(name string, arg ...string) func([]byte) E.Either[error, CommandOutput]

func ToTypeE

func ToTypeE[A any](data any) E.Either[error, A]

Types

type CommandOutput

type CommandOutput = T.Tuple2[[]byte, []byte]

Jump to

Keyboard shortcuts

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