Documentation ¶
Index ¶
- Constants
- Variables
- func CopyDir(src string, dst string) (err error)
- func CopyFile(src, dst string) (err error)
- func FindAllAddresses() ([]net.IP, error)
- func GetHostPort(rawURL string) (string, error)
- func GuessExternalAddress() net.IP
- func IsAddrPort(s string) error
- func IsFQDN(s string) error
- func IsProbablyGloballyReachable(ip net.IP) bool
- func Mkdir(d string) error
- func NormalizeFQDN(s string) string
- func TrimArgs(osArgs []string) []string
- type Namespace
- func (n Namespace) Base64() string
- func (n *Namespace) Equal(cmp *Namespace) bool
- func (n Namespace) Hex() string
- func (n Namespace) IsKeyManager() bool
- func (n Namespace) IsTest() bool
- func (n *Namespace) MarshalBinary() (data []byte, err error)
- func (n *Namespace) MarshalHex() ([]byte, error)
- func (n Namespace) MarshalText() ([]byte, error)
- func (n Namespace) String() string
- func (n *Namespace) UnmarshalBase64(text []byte) error
- func (n *Namespace) UnmarshalBinary(data []byte) error
- func (n *Namespace) UnmarshalHex(text string) error
- func (n *Namespace) UnmarshalText(text []byte) error
- type NamespaceFlag
Constants ¶
const ( // NamespaceSize is the size of a chain namespace identifier in bytes. NamespaceSize = 32 // NamespaceHexSize is the size of the chain namespace identifier in string format. NamespaceHexSize = NamespaceSize * 2 // NamespaceIDSize is the size of the identifier component of a namespace. NamespaceIDSize = NamespaceSize - 8 NamespaceTest NamespaceFlag = 1 << 63 NamespaceKeyManager NamespaceFlag = 1 << 62 )
Variables ¶
var ( // ErrMalformedNamespace is the error returned when a namespace // identifier is malformed. ErrMalformedNamespace = errors.New("malformed namespace") )
Functions ¶
func CopyDir ¶ added in v0.2201.9
CopyDir recursively copies a directory tree, attempting to preserve permissions. Source directory must exist, destination directory must *not* exist. Symlinks are ignored and skipped.
func CopyFile ¶ added in v0.2201.9
CopyFile copies the contents of the file named src to the file named by dst. The file will be created if it does not already exist. If the destination file exists, all it's contents will be replaced by the contents of the source file. The file mode will be copied from the source and the copied data is synced/flushed to stable storage. Taken from: https://github.com/hasura/graphql-engine/blob/6532a658eb3dfae9dde251c6c9377f2268ecc8a8/cli/util/copy.go#L13-L115
func FindAllAddresses ¶
FindAllAddresses returns all addresses found by examining all up interfaces (skipping loopback).
func GetHostPort ¶
GetHostPort makes a normalized "host:port" string from the given raw URL.
func GuessExternalAddress ¶
GuessExternalAddress returns a best guess of the external address, or nil if the process fails.
func IsAddrPort ¶
IsAddrPort validates that the provided string is an address + port.
func IsProbablyGloballyReachable ¶ added in v0.2103.0
IsProbablyGloballyReachable returns true if the provided IP address is likely to be globally reachable.
func Mkdir ¶
Mkdir creates a directory iff it does not exist, and otherwise ensures that the filesystem permissions are sufficiently restrictive.
func NormalizeFQDN ¶
NormalizeFQDN normalizes the provided string as a FQDN.
func TrimArgs ¶
TrimArgs removes all arguments in the argument list occurring before the "--" separator. The first argument is treated as the binary name (as in os.Args) and is left unchanged.
If the argument list does not include the separator, a slice containing only the first argument is returned.
It is an error to call this function with an empty slice.
Types ¶
type Namespace ¶
type Namespace [NamespaceSize]byte
Namespace is a chain namespace identifier.
func NewNamespace ¶
func NewNamespace(id [NamespaceIDSize]byte, flags NamespaceFlag) (Namespace, error)
NewNamespace returns a new namespace from it's component ID and flags.
func NewTestNamespaceFromSeed ¶
func NewTestNamespaceFromSeed(seed []byte, flags NamespaceFlag) Namespace
NewTestNamespaceFromSeed returns a test namespace from a seed and flags.
func (Namespace) Base64 ¶ added in v0.2103.1
Base64 returns the base64 string representation of a namespace identifier.
func (Namespace) Hex ¶ added in v0.2103.1
Hex returns the hexadecimal string representation of a namespace identifier.
func (Namespace) IsKeyManager ¶
IsKeyManager returns true iff the namespace is for a key manager runtime.
func (*Namespace) MarshalBinary ¶
MarshalBinary encodes a namespace identifier into binary form.
func (*Namespace) MarshalHex ¶ added in v0.2103.0
MarshalHex encodes a namespace identifier into a hexadecimal form.
func (Namespace) MarshalText ¶
MarshalText encodes a namespace identifier into text form.
func (*Namespace) UnmarshalBase64 ¶ added in v0.2200.0
UnmarshalBase64 deserializes a Base64 text string into the given type.
func (*Namespace) UnmarshalBinary ¶
UnmarshalBinary decodes a binary marshaled namespace identifier.
func (*Namespace) UnmarshalHex ¶
UnmarshalHex deserializes a hexadecimal text string into the given type.
func (*Namespace) UnmarshalText ¶
UnmarshalText decodes a text marshaled namespace identifier.
Directories ¶
Path | Synopsis |
---|---|
Package accessctl implements access control for an Oasis node.
|
Package accessctl implements access control for an Oasis node. |
Package backoff contains helpers for dealing with backoffs.
|
Package backoff contains helpers for dealing with backoffs. |
Package badger contains convenience helpers for integrating BadgerDB.
|
Package badger contains convenience helpers for integrating BadgerDB. |
cache
|
|
lru
Package LRU implements an in-memory Least-Recently-Used cache.
|
Package LRU implements an in-memory Least-Recently-Used cache. |
Package cbor provides helpers for encoding and decoding canonical CBOR.
|
Package cbor provides helpers for encoding and decoding canonical CBOR. |
Package crash provides a framework for adding probabilistic crash points.
|
Package crash provides a framework for adding probabilistic crash points. |
crypto
|
|
address
Package address implements a generic cryptographic address with versioning and context separation.
|
Package address implements a generic cryptographic address with versioning and context separation. |
drbg
Package drbg implements the HMAC_DRBG construct as per NIST Special Publication 800-90A Revision 1.
|
Package drbg implements the HMAC_DRBG construct as per NIST Special Publication 800-90A Revision 1. |
hash
Package hash implements a cryptographic hash over arbitrary binary data.
|
Package hash implements a cryptographic hash over arbitrary binary data. |
mathrand
Package mathrand implements an adapter from a cryptographically secure entropy source that implements an io.Reader to a math/rand.Source64.
|
Package mathrand implements an adapter from a cryptographically secure entropy source that implements an io.Reader to a math/rand.Source64. |
mrae/api
Package api implements the MRAE API and common helpers.
|
Package api implements the MRAE API and common helpers. |
mrae/deoxysii
Package deoxysii implements the Deoxys-II-256-128 based MRAE boxes.
|
Package deoxysii implements the Deoxys-II-256-128 based MRAE boxes. |
sakg
Package sakg implements ADR 0008: Standard Account Key Generation.
|
Package sakg implements ADR 0008: Standard Account Key Generation. |
signature
Package signature provides wrapper types around public key signatures.
|
Package signature provides wrapper types around public key signatures. |
signature/signers/composite
Package composite provides a composite signer.
|
Package composite provides a composite signer. |
signature/signers/file
Package file provides a PEM file backed signer.
|
Package file provides a PEM file backed signer. |
signature/signers/memory
Package memory provides a memory backed Signer, primarily for use in testing.
|
Package memory provides a memory backed Signer, primarily for use in testing. |
signature/signers/plugin
Package plugin implements the Go plugin signature signer.
|
Package plugin implements the Go plugin signature signer. |
signature/signers/remote
Package remote provides a gRPC backed signer (both client and server).
|
Package remote provides a gRPC backed signer (both client and server). |
slip10
Package slip10 implements the SLIP-0010 private key derivation scheme for Ed25519.
|
Package slip10 implements the SLIP-0010 private key derivation scheme for Ed25519. |
tls
Package tls implements helpful wrappers for dealing with TLS certificates.
|
Package tls implements helpful wrappers for dealing with TLS certificates. |
tuplehash
Package tuplehash implements TupleHash from NIST SP 800-15.
|
Package tuplehash implements TupleHash from NIST SP 800-15. |
Package ctxsync contains some synchronization primitvies that are aware of a context becoming done and can bail on waits in that case.
|
Package ctxsync contains some synchronization primitvies that are aware of a context becoming done and can bail on waits in that case. |
Package diff implements helpers for comparing objects.
|
Package diff implements helpers for comparing objects. |
Package dynlib provides routines for interacting with the glibc ld.so dynamic linker/loader.
|
Package dynlib provides routines for interacting with the glibc ld.so dynamic linker/loader. |
encoding
|
|
bech32
Package bech32 provides implementation of Bech32 encoding specified in BIP 173: https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki.
|
Package bech32 provides implementation of Bech32 encoding specified in BIP 173: https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki. |
Package entity implements common entity routines.
|
Package entity implements common entity routines. |
Package errors implements errors that can be easily sent across the wire and reconstructed at the other end.
|
Package errors implements errors that can be easily sent across the wire and reconstructed at the other end. |
Package grpc implements common gRPC related services and utilities.
|
Package grpc implements common gRPC related services and utilities. |
auth
Package auth implements gRPC authentication server interceptors.
|
Package auth implements gRPC authentication server interceptors. |
policy/api
Package api defines the common gRPC policy service and data structures.
|
Package api defines the common gRPC policy service and data structures. |
proxy
Package proxy implements service agnostic gRPC reverse proxy.
|
Package proxy implements service agnostic gRPC reverse proxy. |
testing
Package testing implements common grpc testing helpers.
|
Package testing implements common grpc testing helpers. |
Package identity encapsulates the node identity.
|
Package identity encapsulates the node identity. |
Package logging implements support for structured logging.
|
Package logging implements support for structured logging. |
Package node implements common node identity routines.
|
Package node implements common node identity routines. |
Package pem provides handy wrappers for dealing with PEM files.
|
Package pem provides handy wrappers for dealing with PEM files. |
Package persistent provides a wrapper around a key-value database for use as general node-wide storage.
|
Package persistent provides a wrapper around a key-value database for use as general node-wide storage. |
Package pubsub implements a generic publish-subscribe interface.
|
Package pubsub implements a generic publish-subscribe interface. |
Package random provides a concurrency safe https://golang.org/pkg/math/rand/#Rand object.
|
Package random provides a concurrency safe https://golang.org/pkg/math/rand/#Rand object. |
Package service provides service primitives.
|
Package service provides service primitives. |
Package SGX provides common Intel SGX datatypes and utilities.
|
Package SGX provides common Intel SGX datatypes and utilities. |
aesm
Package aesm provides a client for AESMD.
|
Package aesm provides a client for AESMD. |
ias
Package ias provides routines for interacting with the Intel Attestation Service.
|
Package ias provides routines for interacting with the Intel Attestation Service. |
Package syscall defines OS-specific syscall parameters.
|
Package syscall defines OS-specific syscall parameters. |
Package version implements Oasis protocol and runtime versioning.
|
Package version implements Oasis protocol and runtime versioning. |
Package workerpool implements a simple goroutine-based workerpool with a configurable number of workers.
|
Package workerpool implements a simple goroutine-based workerpool with a configurable number of workers. |