Documentation ¶
Index ¶
Constants ¶
const ( KeyColor = "color" // string KeyDebug = "debug" // bool KeyOutput = "output" // string KeyTty = "tty-encode" // string KeyServerAddress = "server-address" // string KeyTimeout = "timeout" // duration KeyRetries = "retries" // int KeyNamespace = "namespace" // string KeyLogLevel = "loglevel" // string )
Variables ¶
Functions ¶
func CliRunErr ¶
func CliRunErr(fn func(ctx context.Context, cli tetragon.FineGuidanceSensorsClient), fnErr func(err error))
func HumanizeByteCount ¶ added in v1.2.1
HumanizeByteCount transforms bytes count into a quickly-readable version, for example it transforms 4458824 into "4.46 MB". I copied this code from https://yourbasic.org/golang/formatting-byte-size-to-human-readable-format/
func ResolveServerAddress ¶ added in v1.2.0
func ResolveServerAddress() string
ResolveServerAdress returns the server address given by the user from the command line flag, if not set, try to read from tetragon-info.json, and, if the file doesn't exist, returns the default value.
Types ¶
type ClientWithContext ¶ added in v1.2.0
type ClientWithContext struct { Client tetragon.FineGuidanceSensorsClient // Ctx is a combination of the signal context and the timeout context Ctx context.Context // SignalCtx is only the signal context, you might want to use that context // when the command should never timeout (like a stream command) SignalCtx context.Context // contains filtered or unexported fields }
func NewClientWithDefaultContextAndAddress ¶ added in v1.2.0
func NewClientWithDefaultContextAndAddress() (*ClientWithContext, error)
NewClientWithDefaultContextAndAddress returns a client to a tetragon server after resolving the server address using helpers, accompanied with an initialized context that can be used for the RPC call, caller must call Close() on the client.
func (ClientWithContext) Close ¶ added in v1.2.0
func (c ClientWithContext) Close()
Close cleanup resources, it closes the connection and cancel the context