Would it be valuable to refactor aes.go into leveraging structs and methods? This could potentially have the nice effect of encapsulating and separating encoding and decoding concerns from encryption and decryption and provide an interface for those.
We could eventually go one step further and extract the encoding and decoding (base64, hex) into their own structs and pass and provide an AESEncoderDecoder interface and then pass that to the AESEncryptDecrypt struct.
The call sites would have to change to accommodate initializing the new struct.
Would it be valuable to refactor
aes.go
into leveraging structs and methods? This could potentially have the nice effect of encapsulating and separating encoding and decoding concerns from encryption and decryption and provide an interface for those.We could eventually go one step further and extract the encoding and decoding (base64, hex) into their own structs and pass and provide an
AESEncoderDecoder
interface and then pass that to theAESEncryptDecrypt
struct.The call sites would have to change to accommodate initializing the new struct.
Here's a loose initial example.