Last active
September 14, 2017 03:16
-
-
Save browny/433b0be681e1539cb95cd0361a27b07d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func (e *Encryptor) Run(srcType, dstType string) error { | |
| var src []byte | |
| switch srcType { | |
| case "file": | |
| src = e.readFromFile(...) | |
| case "database": | |
| src = e.readFromDatabase(...) | |
| } | |
| // encrypt | |
| r := e.encrypt(dat) | |
| switch dstType { | |
| case "file": | |
| src = e.writeToFile(r) | |
| case "webservice": | |
| src = e.writeToWebservice(r) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment