aboutsummaryrefslogtreecommitdiff
path: root/ctlsock
diff options
context:
space:
mode:
authorJakob Unterwurzacher2020-05-09 17:36:41 +0200
committerJakob Unterwurzacher2020-05-09 17:36:41 +0200
commit16221facb9066ccf03015ccfe9e7ca784b0d2099 (patch)
tree46abce23a8592542563deb463a98d4318deb24af /ctlsock
parent3ef563493a9d0774513ec0d6aab4cfbc0f6334e5 (diff)
ctlsock: create exported ctlsock client library
The former interal ctlsock server package is renamed to ctlsocksrv.
Diffstat (limited to 'ctlsock')
-rw-r--r--ctlsock/ctlsock.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/ctlsock/ctlsock.go b/ctlsock/ctlsock.go
new file mode 100644
index 0000000..893b3b0
--- /dev/null
+++ b/ctlsock/ctlsock.go
@@ -0,0 +1,26 @@
+// Package ctlsock is a Go library that can be used to query the
+// gocryptfs control socket interface. This interface can be
+// activated by passing `-ctlsock /tmp/my.sock` to gocryptfs on the
+// command line.
+package ctlsock
+
+// RequestStruct is sent by a client
+type RequestStruct struct {
+ EncryptPath string
+ DecryptPath string
+}
+
+// ResponseStruct is sent by the server in response to a request
+type ResponseStruct struct {
+ // Result is the resulting decrypted or encrypted path. Empty on error.
+ Result string
+ // ErrNo is the error number as defined in errno.h.
+ // 0 means success and -1 means that the error number is not known
+ // (look at ErrText in this case).
+ ErrNo int32
+ // ErrText is a detailed error message.
+ ErrText string
+ // WarnText contains warnings that may have been encountered while
+ // processing the message.
+ WarnText string
+}