sqlprotector

package module
v0.0.0-...-6d9fec3 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2022 License: ISC Imports: 12 Imported by: 0

README

sqlprotector

GoDoc Go Report Card

A go package to add support for data at rest encryption to Golang's standard library database/sql.

Installation

In your Golang project, please run:

go get github.com/bartmika/sqlprotector

Documentation

All documentation can be found here.

Contributing

Found a bug? Want a feature to improve your developer experience? Please create an issue.

License

Made with ❤️ by Bartlomiej Mika.
The project is licensed under the ISC License.

Resource used:

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSQLProtectorPassphrase

func GetSQLProtectorPassphrase() []byte

GetSQLProtectorPassphrase returns the password used for encryption.

func MarshalJSONNullString

func MarshalJSONNullString(ns sql.NullString) ([]byte, error)

func SetSQLProtectorPassphrase

func SetSQLProtectorPassphrase(passphrase []byte) error

SetSQLProtectorPassphrase sets the password to use for encryption.

func UnmarshalJSONNullString

func UnmarshalJSONNullString(data []byte) (sql.NullString, error)

Types

type NullString

type NullString struct {
	sql.NullString
}

Nullable String that overrides sql.NullString

type ProtectBool

type ProtectBool struct {
	// Plaintext data in use when your application fetches the data from the database; in addition, plaintext data gets encrypted when saved to the database.
	Plaintext bool
}

ProtectBool represents the uint64 value that will get encrypted when the data is stored in the database and when we want to decrypt data from a database.

func (*ProtectBool) Scan

func (ls *ProtectBool) Scan(value interface{}) error

Scan implements sql.Scanner interface from the database/sql package and decryptes incoming sql column data.

func (ProtectBool) Value

func (ls ProtectBool) Value() (driver.Value, error)

Value implementing the driver.Valuer interface from the database/sql package and encrypts the outgoing sql column data.

type ProtectFloat64

type ProtectFloat64 struct {
	// Plaintext data in use when your application fetches the data from the database; in addition, plaintext data gets encrypted when saved to the database.
	Plaintext float64
}

ProtectFloat64 represents the uint64 value that will get encrypted when the data is stored in the database and when we want to decrypt data from a database.

func (*ProtectFloat64) Scan

func (ls *ProtectFloat64) Scan(value interface{}) error

Scan implements sql.Scanner interface from the database/sql package and decryptes incoming sql column data.

func (ProtectFloat64) Value

func (ls ProtectFloat64) Value() (driver.Value, error)

Value implementing the driver.Valuer interface from the database/sql package and encrypts the outgoing sql column data.

type ProtectInt64

type ProtectInt64 struct {
	// Plaintext data in use when your application fetches the data from the database; in addition, plaintext data gets encrypted when saved to the database.
	Plaintext int64
}

ProtectInt64 represents the int64 value that will get encrypted when the data is stored in the database and when we want to decrypt data from a database.

func (*ProtectInt64) Scan

func (ls *ProtectInt64) Scan(value interface{}) error

Scan implements sql.Scanner interface from the database/sql package and decryptes incoming sql column data.

func (ProtectInt64) Value

func (ls ProtectInt64) Value() (driver.Value, error)

Value implementing the driver.Valuer interface from the database/sql package and encrypts the outgoing sql column data.

type ProtectInt8

type ProtectInt8 struct {
	// Plaintext data in use when your application fetches the data from the database; in addition, plaintext data gets encrypted when saved to the database.
	Plaintext int8
}

ProtectInt8 represents the int8 value that will get encrypted when the data is stored in the database and when we want to decrypt data from a database.

func (*ProtectInt8) Scan

func (ls *ProtectInt8) Scan(value interface{}) error

Scan implements sql.Scanner interface from the database/sql package and decryptes incoming sql column data.

func (ProtectInt8) Value

func (ls ProtectInt8) Value() (driver.Value, error)

Value implementing the driver.Valuer interface from the database/sql package and encrypts the outgoing sql column data.

type ProtectNullString

type ProtectNullString struct {
	// Plaintext data in use when your application fetches the data from the database; in addition, plaintext data gets encrypted when saved to the database.
	Plaintext sql.NullString
}

ProtectNullString represents the string value that will get encrypted when the data is stored in the database and when we want to decrypt data from a database.

func (*ProtectNullString) Scan

func (ls *ProtectNullString) Scan(value interface{}) error

Scan implements sql.Scanner interface from the database/sql package and decryptes incoming sql column data.

func (ProtectNullString) Value

func (ls ProtectNullString) Value() (driver.Value, error)

Value implementing the driver.Valuer interface from the database/sql package and encrypts the outgoing sql column data.

type ProtectString

type ProtectString struct {
	// Plaintext data in use when your application fetches the data from the database; in addition, plaintext data gets encrypted when saved to the database.
	Plaintext string
}

ProtectString represents the string value that will get encrypted when the data is stored in the database and when we want to decrypt data from a database.

func (*ProtectString) Scan

func (ls *ProtectString) Scan(value interface{}) error

Scan implements sql.Scanner interface from the database/sql package and decryptes incoming sql column data.

func (ProtectString) Value

func (ls ProtectString) Value() (driver.Value, error)

Value implementing the driver.Valuer interface from the database/sql package and encrypts the outgoing sql column data.

type ProtectUint64

type ProtectUint64 struct {
	// Plaintext data in use when your application fetches the data from the database; in addition, plaintext data gets encrypted when saved to the database.
	Plaintext uint64
}

ProtectUint64 represents the uint64 value that will get encrypted when the data is stored in the database and when we want to decrypt data from a database.

func (*ProtectUint64) Scan

func (ls *ProtectUint64) Scan(value interface{}) error

Scan implements sql.Scanner interface from the database/sql package and decryptes incoming sql column data.

func (ProtectUint64) Value

func (ls ProtectUint64) Value() (driver.Value, error)

Value implementing the driver.Valuer interface from the database/sql package and encrypts the outgoing sql column data.

Jump to

Keyboard shortcuts

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