encrypt

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 7, 2014 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EncryptedField

type EncryptedField struct {
	Cipher cipher.Block
}

EncryptedField handles encrypted and decryption of values to and from database columns.

func (*EncryptedField) PostRead

func (e *EncryptedField) PostRead(fieldAddr interface{}, scanTarget interface{}) error

PostRead is called after a Scan operation. It is given the value returned by PreRead and a pointer to the raw struct field. It is expected to fill in the struct field if the two are different.

func (*EncryptedField) PreRead

func (e *EncryptedField) PreRead(fieldAddr interface{}) (scanTarget interface{}, err error)

PreRead is called before a Scan operation. It is given a pointer to the raw struct field, and returns the value that will be given to the database driver.

func (*EncryptedField) PreWrite

func (e *EncryptedField) PreWrite(field interface{}) (saveValue interface{}, err error)

PreWrite is called before an Insert or Update operation. It is given a pointer to the raw struct field, and returns the value that will be given to the database driver.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL