Documentation ¶
Overview ¶
Package defines helpers structs to store credentials
Index ¶
- type DB
- type EncryptedID
- type Encrypter
- func (key Encrypter) DecryptID(enc EncryptedID) (int64, error)
- func (pass Encrypter) DecryptJSON(data string, dst interface{}) error
- func (key Encrypter) DecryptPassword(crypted []byte) string
- func (key Encrypter) EncryptID(ID int64) EncryptedID
- func (pass Encrypter) EncryptJSON(data interface{}) (string, error)
- func (key Encrypter) EncryptPassword(pass string) []byte
- type SMTP
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct { Host string User string Password string Name string // of the database Port int // default to 5432 }
DB provides access to a database
type EncryptedID ¶
type EncryptedID string
EncryptedID is the public version of the DB id of record. In particular, it is suitable to be included in URLs
type Encrypter ¶
type Encrypter [16]byte
Encrypter is used to encrypt exposed data, such as students IDs.
func NewEncrypter ¶
NewEncrypter read the given ENV variable to build an encrypter.
func NewEncrypterFromKey ¶
func (Encrypter) DecryptJSON ¶
DecryptJSON performs the reverse operation of EncryptJSON, storing the data into `dst`
func (Encrypter) DecryptPassword ¶
DecryptPassword returns the clear user password.
func (Encrypter) EncryptID ¶
func (key Encrypter) EncryptID(ID int64) EncryptedID
func (Encrypter) EncryptJSON ¶
EncryptJSON marshals `data`, encrypts and espace using `base64.RawURLEncoding`
func (Encrypter) EncryptPassword ¶
EncryptPassword crypt the user provided password
Click to show internal directories.
Click to hide internal directories.