Documentation ¶
Overview ¶
Package tool TODO.
Package tool TODO.
Package tool TODO.
Package tool TODO.
Package tool TODO.
Package tool TODO.
Package tool TODO.
Package tool TODO.
Package tool TODO.
Package tool TODO.
Package tool TODO.
Package tool TODO.
Index ¶
- Constants
- Variables
- func ConvertBoolPointerToNullBool(b *bool) sql.NullBool
- func ConvertNullBoolToBoolPointer(b sql.NullBool) *bool
- func ConvertNullTimeToTimePointer(t sql.NullTime) *time.Time
- func ConvertTimePointerToNullTime(t *time.Time) sql.NullTime
- func DBConnect(dsn string) *pgxpool.Pool
- func DecryptAES(secretKey, bytes []byte) ([]byte, error)
- func DecryptRSA(rsaPrivateKey *rsa.PrivateKey, bytes []byte) ([]byte, error)
- func EncryptAES(secretKey, plain []byte) ([]byte, error)
- func EncryptRSA(rsaPublicKey *rsa.PublicKey, plain []byte) ([]byte, error)
- func FileClose(file *os.File)
- func FileCloseAndLog(file *os.File)
- func GetCollection(conn *mongo.Client, dbname, collection string) *mongo.Collection
- func IfErrorThenPanic(e error)
- func IsUpperBound(index int, duration time.Duration) bool
- func IsUpperBoundWithSleep(index, sleep int, duration time.Duration) bool
- func LoadClientTLSCredentials(caCertFile string) (credentials.TransportCredentials, error)
- func LoadPrivateKey(fileName string) *rsa.PrivateKey
- func LoadPublicKey(fileName string) *rsa.PublicKey
- func LoadServerTLSCredentials(certFile, keyFile string) (credentials.TransportCredentials, error)
- func NoRowsInResultSet(err error) bool
- func RandStringBytes(n int) string
- func TraceInOut(ctx context.Context, name, format string, values ...any) func()
- type MongoPool
Constants ¶
View Source
const MSG = "go-favorites.tool "
Variables ¶
Functions ¶
func DecryptAES ¶
func DecryptRSA ¶
func DecryptRSA(rsaPrivateKey *rsa.PrivateKey, bytes []byte) ([]byte, error)
func EncryptAES ¶
func FileCloseAndLog ¶
func GetCollection ¶
func GetCollection(conn *mongo.Client, dbname, collection string) *mongo.Collection
func IfErrorThenPanic ¶
func IfErrorThenPanic(e error)
func IsUpperBoundWithSleep ¶
func LoadClientTLSCredentials ¶
func LoadClientTLSCredentials(caCertFile string) (credentials.TransportCredentials, error)
func LoadPrivateKey ¶
func LoadPrivateKey(fileName string) *rsa.PrivateKey
func LoadPublicKey ¶
func LoadServerTLSCredentials ¶
func LoadServerTLSCredentials(certFile, keyFile string) (credentials.TransportCredentials, error)
func NoRowsInResultSet ¶
func RandStringBytes ¶
Types ¶
type MongoPool ¶
type MongoPool struct {
// contains filtered or unexported fields
}
func MongodbConnect ¶
Click to show internal directories.
Click to hide internal directories.