Documentation ¶
Index ¶
- func CheckPasswordHash(password, hash string) bool
- func ConnectDB(...) (*sql.DB, error)
- func ConvertNullStringToNullTime(s null.String, timezone string, nowWhenIsZero bool) (null.Time, error)
- func ConvertNullStringToTime(s null.String, timezone string, nowWhenIsZero bool) (time.Time, error)
- func ConvertPGAdminTimeStringToTime(dateTimeString string) (time.Time, error)
- func DownloadS3ObjToTmpDir(s3Client *s3.S3, bucketName string, s3key string, uuid string) (string, error)
- func FindMatchingObjectKeyInS3Bucket(s3Objects *s3.ListObjectsOutput, partialKey string) string
- func GenerateJWTTokenPair(hmacSecret []byte, uuid string, d time.Duration) (string, string, error)
- func GetBinFromBase64String(b64s string) ([]byte, error)
- func GetS3Obj(s3Client *s3.S3, bucketName string, s3key string) (*s3.GetObjectOutput, error)
- func GetS3ObjBin(s3Client *s3.S3, bucketName string, s3key string) (io.ReadCloser, error)
- func HashPassword(password string) (string, error)
- func HashPasswordAlgorithm() string
- func HeaderSize(h http.Header) int64
- func IPFromHostPort(hp string) string
- func JsonPrettyPrint(in string) string
- func ListAllS3ObjectsInBucket(s3Client *s3.S3, bucketName string) *s3.ListObjectsOutput
- func NewS3Client(key, secret, endpoint, region string) *s3.S3
- func NowTimestampString() string
- func ProcessJWTToken(hmacSecret []byte, reqToken string) (string, error)
- func UploadBinToS3(s3Client *s3.S3, bucketName string, s3key string, body string, acl string) error
- type LogEntry
- type S3Util
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckPasswordHash ¶
Function checks the plaintext string and hash string and returns either true or false depending.
func ConvertNullStringToTime ¶
func ConvertPGAdminTimeStringToTime ¶
Function will convert the timestamp string that `PgAdmin` exports (when you export as CSV format) into a Golang `time` data-format. TODO: Implement matching of timezones!
func DownloadS3ObjToTmpDir ¶
func DownloadS3ObjToTmpDir(s3Client *s3.S3, bucketName string, s3key string, uuid string) (string, error)
Function will download the s3 file to the `/tmp` folder on the system and return the local filepath address of the downloaded file.
func FindMatchingObjectKeyInS3Bucket ¶
func FindMatchingObjectKeyInS3Bucket(s3Objects *s3.ListObjectsOutput, partialKey string) string
Function will iterate over all the s3 objects to match the partial key with the actual key found in the S3 bucket.
func GenerateJWTTokenPair ¶
GenerateJWTTokenPair Generate the `access token` and `refresh token` for the secret key.
func GetBinFromBase64String ¶
GetBinFromBase64String will convert the string parameter and return a `[]byte` object.
Special thanks: (1) https://github.com/tomchristie/django-rest-framework/pull/1268 (2) https://stackoverflow.com/a/39587386
func GetS3ObjBin ¶
Function will get the s3 file and return the file binary.
func HashPassword ¶
Function takes the plaintext string and returns a hash string.
func HashPasswordAlgorithm ¶
func HashPasswordAlgorithm() string
Function returns the algorithm used for hashing.
func HeaderSize ¶
func IPFromHostPort ¶
func JsonPrettyPrint ¶
Utility function nicely prints string data of JSON formatted contents. SOURCE: https://stackoverflow.com/a/36544455
func ListAllS3ObjectsInBucket ¶
func ListAllS3ObjectsInBucket(s3Client *s3.S3, bucketName string) *s3.ListObjectsOutput
Function returns a list of all the S3 stored objects sin a specific bucket.
func NewS3Client ¶
Function connects to a specific S3 bucket instance and returns a connected instance structure.
func NowTimestampString ¶
func NowTimestampString() string
func ProcessJWTToken ¶
ProcessJWTToken validates either the `access token` or `refresh token` and returns either the `uuid` if success or error on failure.
Types ¶
type S3Util ¶
func (*S3Util) GetURL ¶
GetURL will return a URL string for a link to the access of the file for the key. https://github.com/aws/aws-sdk-go/blob/e2d6cb448883e4f4fcc5246650f89bde349041ec/aws/request/request.go#L315