Refactored for testability.

Factored out storage into a separate package, and added tests.
This commit is contained in:
2020-12-03 21:09:07 -08:00
parent 3aad2b6a87
commit fdb04c90f1
5 changed files with 457 additions and 216 deletions
+35 -5
View File
@@ -12,18 +12,48 @@
#:backplane-connect
#:make-error
#:make-success
#:start-listening
#:with-backplane)
(:import-from #:backplane-dns-store
#:invalid-sshfp
#:missing-domain
#:invalid-ip
#:domain-name-missing
#:error-msg)
(:export #:start-listener-with-env
#:backplane-dns-listen
#:parse-message
#:handle-message
#:unknown-dns-request
#:request-change-ipv4
#:request-change-ipv6
#:request-change-sshfp
#:*dns-store*))
(defpackage #:backplane-dns-store
(:use #:cl)
(:import-from #:arrows #:->)
(:import-from #:alexandria #:if-let)
(:import-from #:ip-utils
#:ipv4-p
#:ipv6-p)
(:import-from #:postmodern
#:get-dao
#:select-dao
#:update-dao
#:insert-dao
#:delete-dao
#:with-transaction)
(:export #:start-listener-with-env
#:backplane-dns-listen
#:parse-message))
(:export #:set-ipv4
#:set-ipv6
#:set-sshfp
#:postgres-dns-store
#:invalid-ip
#:invalid-sshfp
#:domain-name-missing
#:missing-domain
#:dns-store
#:sshfp-p
#:error-msg))