Documentation
¶
Index ¶
- Constants
- Variables
- 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) Equal(cmp *Namespace) bool
- 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) 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 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) 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) 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. |
pvss
Package pvss implements a PVSS backed commit-reveal scheme loosely based on the Scalable Randomness Attested by Public Entities protocol by Casudo and David.
|
Package pvss implements a PVSS backed commit-reveal scheme loosely based on the Scalable Randomness Attested by Public Entities protocol by Casudo and David. |
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. |
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. |
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. |