package
2.1.0-alpha.2+incompatible
Repository: https://github.com/tatsushid/teleport.git
Documentation: pkg.go.dev

# Functions

Consolef prints the same message to a 'ui console' (if defined) and also to the logger with INFO priority.
No description provided by the author
CreateTLSConfiguration sets up default TLS configuration.
CryptoRandomHex returns hex encoded random string generated with crypto-strong pseudo random generator of the given bytes.
Deduplicate deduplicates list of strings.
FatalError is for CLI front-ends: it detects gravitational/trace debugging information, sends it to the logger, strips it off and prints a clean message to stderr.
GenerateOTPURL returns a OTP Key URL that can be used to construct a HOTP or TOTP key.
GenerateQRCode takes in a OTP Key URL and returns a PNG-encoded QR code.
GenerateSelfSignedCert generates a self signed certificate that is valid for given domain names and ips, returns PEM-encoded bytes with key and cert.
GetFreeTCPPorts returns a lit of available ports on localhost used for testing.
GuessIP tries to guess an IP address this machine is reachable at on the internal network, always picking IPv4 from the internal address space If no internal IPs are found, it returns 127.0.0.1 but it never returns an address from the public IP space.
HumanTimeFormat formats time as recognized by humans.
InitCLIParser configures kingpin command line args parser with some defaults common for all Teleport CLI tools.
InitLogger configures the global logger for a given purpose / verbosity level.
No description provided by the author
IsDir is a helper function to quickly check if a given path is a valid directory.
IsFile returns true if a given file path points to an existing file.
IsHandshakeFailedError specifies whether this error indicates failed handshake.
IsLocalhost returns true if this is a local hostname or ip.
IsLoopback returns 'true' if a given hostname resolves to local host's loopback interface.
IsShellFailedError specifies whether this error indicates failed attempt to start shell.
ListenTLS sets up TLS listener for the http handler, starts listening on a TCP socket and returns the socket which is ready to be used for http.Serve.
MinTTL finds min non 0 TTL duration, if both durations are 0, fails.
MultiCloser implements io.Close, it sequentially calls Close() on each object.
MustParseAddr parses the provided string into NetAddr or panics on an error.
No description provided by the author
NewCloseBroadcaster returns new instance of close broadcaster.
NewFileAddrStorage returns new instance of file-based address storage.
No description provided by the author
No description provided by the author
No description provided by the author
NormalizePath normalises path, evaluating symlinks and converting local paths to absolute.
ObeyIdleTimeout wraps an existing network connection with timeout-obeying Write() and Read() - it will drop the connection after 'timeout' on idle Example: ObeyIdletimeout(conn, time.Second * 60, "api server").
ObjectToStruct is converts any structure into JSON and then unmarshalls it into another structure.
OpenFile opens file and returns file handle.
ParseAddr takes strings like "tcp://host:port/path" and returns *NetAddr or an error.
ParseHostPortAddr takes strings like "host:port" and returns *NetAddr or an error If defaultPort == -1 it expects 'hostport' string to have it.
PrintVersion prints human readable version.
RandomDuration returns a duration in a range [0, max).
ReadAll is similarl to ioutil.ReadAll, except it doesn't use ever-increasing internal buffer, instead asking for the exact buffer size.
ReadHostUUID reads host UUID from the file in the data dir.
ReadOrMakeHostUUID looks for a hostid file in the data dir.
No description provided by the author
ReplaceLocalhost checks if a given address is link-local (like 0.0.0.0 or 127.0.0.1) and replaces it with the IP taken from replaceWith, preserving the original port Both addresses are in "host:port" format The function returns the original value if it encounters any problems with parsing.
SliceContainsStr returns 'true' if the slice contains the given value.
No description provided by the author
No description provided by the author
StatDir stats directory, returns error if file exists, but not a directory.
SwitchLoggingtoSyslog tells the logger to send the output to syslog.
ToJSON converts a single YAML document into a JSON document or returns an error.
ToTTL converts expiration time to TTL duration relative to current time as provided by clock.
UnmarshalWithSchema processes YAML or JSON encoded object with JSON schema, sets defaults and unmarshals resulting object into given struct.
UserMessageFromError returns user friendly error message from error.
UTC converts time to UTC timezone.
WriteHostUUID writes host UUID into a file.

# Constants

CertExtensionAuthority specifies teleport authority's name that signed this domain.
CertExtensionRole specifies teleport role.
CertTeleportClusterName is a name of the teleport cluster.
CertTeleportUser specifies teleport user.
CertTeleportUserCA specifies teleport certificate authority.
DefaultCertTTL sets the TTL of the self-signed certificate (1 year).
DefaultLRUCapacity is a capacity for LRU session cache.
HostUUIDFile is the file name where the host UUID file is stored.
HumanTimeFormatString is a human readable date formatting.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

CloseBroadcaster is a helper struct that implements io.Closer and uses channel to broadcast it's closed state once called.
FileAddrStorage is a file based address storage.
No description provided by the author
NetAddr is network address that includes network, optional path and host port.
PipeNetConn implemetns net.Conn from io.Reader,io.Writer and io.Closer.
TimeoutConn wraps an existing net.Conn and adds read/write timeouts for it, allowing to implement "disconnect after XX of idle time" policy Usage example: tc := utils.ObeyIdleTimeout(conn, time.Second * 30, "ssh connection") io.Copy(tc, xxx) .
TLSCredentials keeps the typical 3 components of a proper HTTPS configuration.
WebSockWrapper wraps the raw websocket and converts Write() calls to proper websocket.Send() working in binary or text mode.

# Interfaces

AddrStorage is used to store information locally for every client that connects in the cluster, so it can always have up-to-date info about auth servers.

# Type aliases

No description provided by the author
No description provided by the author
NetAddrList is a list of NetAddrs that supports helper methods for parsing from CLI tools.
NetAddrVal can be used with flag package.
PortList is a list of TCP port.
WebSocketMode allows to create WebSocket wrappers working in text or binary mode.