Optional and Encrypted
The extended fields can be configured using the Go field tag: torpedo.field
.
Entity model
The tag must be added only at the Entity model, the file named entity.go
Setting it as Optional
The new field can be set as optional adding the tag: torpedo.field:"optional"
. For instance:
Setting it as Encrypted
Also the field can be set as encrypted, so each time that a storage adapter saves the entity, the equivalent field in the DMO
will be encrypted. Note that the field must be of type string
Setting it as Optional and Encrypted, is possible ?
The answer is yes! ... the tag supports both values (comma separated). For instance: