helper

package
v0.0.0-...-cbfa0ec Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 License: GPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByteToProto

func ByteToProto(m protoreflect.ProtoMessage, js []byte) error

func CheckData

func CheckData(obj interface{}, group *pb.Group, location *string) error

func CheckDataForPatch

func CheckDataForPatch(obj interface{}, group *pb.Group, location *string) error

func CheckField

func CheckField(data map[string]interface{}, group *pb.Group, location *string) error

func CheckFieldForPatch

func CheckFieldForPatch(data map[string]interface{}, group *pb.Group, location *string) error

func CheckOnlyOneField

func CheckOnlyOneField(data map[string]interface{}, v *pb.Field, location *string, field string) error

func CheckValidationFunc

func CheckValidationFunc(funcName string, value interface{}, valueType string) bool

func CheckValidationFunction

func CheckValidationFunction(name string) bool

func CheckVariable

func CheckVariable(value interface{}, field *pb.Field) bool

func DateNow

func DateNow() string

func DateNowWithLocation

func DateNowWithLocation(location string) string

func EmptyValue

func EmptyValue(filedType *string) interface{}

func GenerateID

func GenerateID() primitive.ObjectID

func GenerateIdWithTime

func GenerateIdWithTime(date, location string) (primitive.ObjectID, error)

func GenerateUUID

func GenerateUUID() string

func GenerateUUIDWithTime

func GenerateUUIDWithTime(date, location string) (string, error)

func GetDefaultValue

func GetDefaultValue(fieldType, location *string, defaultValue string) interface{}

func GetIP

func GetIP(c *fiber.Ctx, signIp string) string

func HandleError

func HandleError(log logger.LoggerI, err error, message string, req interface{}, code codes.Code) error

func IsValidDate

func IsValidDate(value interface{}) bool

func IsValidEmail

func IsValidEmail(email interface{}) bool

func IsValidObjectId

func IsValidObjectId(value interface{}) bool

func IsValidPhone

func IsValidPhone(phone interface{}) bool

func IsValidTime

func IsValidTime(value interface{}) bool

func IsValidUUID

func IsValidUUID(id interface{}) bool

func JsonToJson

func JsonToJson(data interface{}, js interface{}) error

func ProtoToString

func ProtoToString(m protoreflect.ProtoMessage) (string, error)

func ProtoToStruct

func ProtoToStruct(data interface{}, m protoreflect.ProtoMessage) error

func RegexValidate

func RegexValidate(regex string, value interface{}) bool

func ReplaceQueryParams

func ReplaceQueryParams(namedQuery string, params map[string]interface{}) (string, []interface{})

func ReplaceSQL

func ReplaceSQL(old, searchPattern string) string

func SendEmail

func SendEmail(subject, to, link, token string) error

func SendFileTelegram

func SendFileTelegram(cfg config.Config, fileName string, data []byte) error

func SendTelegramMessage

func SendTelegramMessage(message string) error

func StringToProto

func StringToProto(m protoreflect.ProtoMessage, s string) error

func StringToStruct

func StringToStruct(data interface{}, js string) error

func StringToStructPb

func StringToStructPb(js string) (entity *structpb.Struct, err error)

func StructPbToString

func StructPbToString(entity *structpb.Struct) (string, error)

func StructToProto

func StructToProto(m protoreflect.ProtoMessage, data interface{}) error

func TimeNow

func TimeNow() string

func TimeNowWithLocation

func TimeNowWithLocation(location string) string

func ToLocationTime

func ToLocationTime(date, location string) (string, error)

func ToNullString

func ToNullString(s *wrappers.StringValue) (res sql.NullString)

func ToObjectID

func ToObjectID(id interface{}) (primitive.ObjectID, error)

func ToProtoStruct

func ToProtoStruct(body interface{}) (entity *structpb.Struct, err error)

func ToStringValue

func ToStringValue(s sql.NullString) *wrappers.StringValue

func ToUTC

func ToUTC(date, location string) (string, error)

func TotalSumma

func TotalSumma(totalsum *float64, s string) error

func ValidateRegex

func ValidateRegex(regex string) error

func WriteNumOz

func WriteNumOz(n int, str string) string

func WriteNumRu

func WriteNumRu(n int, str string) string

func WriteNumUz

func WriteNumUz(n int, str string) string

func WriteOz

func WriteOz(n string) string

func WriteRu

func WriteRu(n string) string

func WriteUz

func WriteUz(n string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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