package
1.12.8
Repository: https://github.com/enix/banana.git
Documentation: pkg.go.dev

# Functions

DbGet : Convenience function to avoid JSON unmarshalling.
DbMGet : Get given keys.
DbSet : Convenience function to avoid JSON marshalling.
DbZAdd : Add given value to sorted set with the given score.
DbZRevRange : Get given keys.
GetCertificatePublicKey : Extracts the pubkey from a given url-escaped PEM cert.
GetDNFieldValue : Read value from distinguished name in X-Client-Subject-DN header.
GetHTTPClient : Returns the TLS-configured http client for sending requests to the Monitor.
GetTLSConfig : Returns the TLS config for sending requests to the Monitor.
OpenDatabaseConnection : Connect to redis databae Calls such as DbGet and DbSet will crash if called before this.
OpenStorageConnection : Initialize and test connection with object storage.
OpenVaultConnection : Etablish connection with vault Other calls will crash if used before this.
ParseJSONFromStream : Consume all bytes in the ReadCloser to a buffer and returns it parsed as JSON.
ReadBytesFromStream : Consume all bytes in the ReadCloser to a buffer.
SendAlert : Send an email the address in config with the given message.
VerifySha256Signature : Check if data's signature was issued using an agent's private key.

# Variables

Credentials : Used to sign messages and authenticate with Vault/Monitor API from client-side.
Db : Can be used to interact with redis.
Storage : Use this API to interact with object storage.
Vault : Use this API to interact with Vault.

# Structs

APICredentials : Wrapper struct that contains the required certs and key to authenticate with the monitor API and sign messages.
ObjectStorage : Wrapper of AWS S3 client.
VaultClient : Convenience wrapper of vault client.
VaultConfig : Configuration for vault API access.