Specify and solidify usage modes

This commit is contained in:
2025-05-08 20:18:31 +00:00
parent 9d7417e26d
commit d324e62474
4 changed files with 32 additions and 5 deletions
+2 -2
View File
@@ -6,9 +6,9 @@ import (
var binPath, _ = os.Executable() // store binary path
// daemonIsOpen checks if the socket/named pipe for the rcw
// IsOpen checks if the socket/named pipe for the rcw
// daemon exists and returns a boolean indicator.
func daemonIsOpen() bool {
func IsOpen() bool {
fileInfo, err := os.Stat(socketPath)
if err != nil {
return false
+2 -2
View File
@@ -9,7 +9,7 @@ import (
// DecryptWithDaemonIfOpen uses the RCW daemon (if one is available) to
// decrypt and return data. If no RCW daemon is accessible, nil is returned.
func DecryptWithDaemonIfOpen(encBytes []byte) []byte {
if daemonIsOpen() {
if IsOpen() {
return getDecFromDaemon(encBytes)
}
return nil
@@ -18,7 +18,7 @@ func DecryptWithDaemonIfOpen(encBytes []byte) []byte {
// EncryptWithDaemonIfOpen uses the RCW daemon (if one is available) to
// encrypt and return data. If no RCW daemon is accessible, nil is returned.
func EncryptWithDaemonIfOpen(decBytes []byte) []byte {
if daemonIsOpen() {
if IsOpen() {
return getEncFromDaemon(decBytes)
}
return nil