Documentation ¶
Index ¶
- Constants
- func ComparePassword(hashedPassword string, password string) (bool, error)
- func Contains[T any](arr []T, x T) bool
- func ContainsFunc[T any](arr []T, predicate func(T) bool) bool
- func ConvertArStringToArNullUUID(strings []string) ([]uuid.NullUUID, error)
- func ConvertArStringToArUUID(strings []string) ([]uuid.UUID, error)
- func ConvertArUUIDToArString(uuids []uuid.UUID) []string
- func FormatInt(n int32) string
- func GenerateRandomBytes(length int) ([]byte, error)
- func GenerateRandomHexBytes(length int) (string, error)
- func GetIP(r *http.Request) string
- func GetKeyMetadata(ctx context.Context, key string) (string, error)
- func GetUserAgent(r *http.Request) string
- func HandleHitCache(model interface{}, redis redis.RedisEngine, key string) error
- func HandleInterfaceToArrayString(value interface{}) []string
- func HandleNullString(value interface{}) string
- func HashPassword(password string, options ...func(*hashOptions)) (string, error)
- func JsonRawMessageToArrayString(rawJson json.RawMessage) ([]string, error)
- func LoadFileEnvOnLocal() error
- func MapToProtobufStruct(m map[string]interface{}) (*structpb.Struct, error)
- func Mapping(in, out interface{}) error
- func OutgoingContext(ctx context.Context) (context.Context, error)
- func ProtobufStructToMap(s *structpb.Struct) (map[string]interface{}, error)
- func ProtobufStructToStruct(s *structpb.Struct) (interface{}, error)
- func RandomEmail() string
- func RandomEmailCompany() string
- func RandomInt(min, max int64) int64
- func RandomOwner() string
- func RandomString(n int) string
- func RandomUUID() uuid.UUID
- func RemoveSlice[T comparable](inputSlice *[]T, removeItems ...T) []T
- func String(n int32) string
- func StringToNullUUID(uuidString string) (uuid.NullUUID, error)
- func StringToNullUUIDNormal(uuidString string) uuid.NullUUID
- func StringToUUID(uuidString string) (uuid.UUID, error)
- func StringToUUIDNormal(uuidString string) uuid.UUID
- func StructToProtobufStruct(s interface{}) (*structpb.Struct, error)
- func ToStruct(v map[string]interface{}) *st.Struct
- func ToValue(v interface{}) *st.Value
- func UniqueSlice[T comparable](inputSlice []T) []T
Constants ¶
View Source
const ( MinCost int = 4 MaxCost int = 31 DefaultCost int = 10 )
View Source
const ( User = "user" Admin = "admin" )
Variables ¶
This section is empty.
Functions ¶
func ComparePassword ¶
Compare Bcrypt.
func ContainsFunc ¶
func ConvertArUUIDToArString ¶
func GenerateRandomBytes ¶
func GenerateRandomHexBytes ¶
func GetUserAgent ¶
GetUserAgent helps in getting the user agent from the request
func HandleHitCache ¶
func HandleHitCache(model interface{}, redis redis.RedisEngine, key string) error
func HandleInterfaceToArrayString ¶
func HandleInterfaceToArrayString(value interface{}) []string
func HandleNullString ¶
func HandleNullString(value interface{}) string
func HashPassword ¶
Hash Bcrypt.
func JsonRawMessageToArrayString ¶
func JsonRawMessageToArrayString(rawJson json.RawMessage) ([]string, error)
func LoadFileEnvOnLocal ¶
func LoadFileEnvOnLocal() error
func MapToProtobufStruct ¶
func ProtobufStructToMap ¶
func ProtobufStructToStruct ¶
func RandomString ¶
RandomString generates a random string of length n
func RandomUUID ¶
func RemoveSlice ¶
func RemoveSlice[T comparable](inputSlice *[]T, removeItems ...T) []T
func StringToNullUUIDNormal ¶
func StringToUUIDNormal ¶
func StructToProtobufStruct ¶
func UniqueSlice ¶
func UniqueSlice[T comparable](inputSlice []T) []T
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.