Documentation ¶
Index ¶
- Constants
- func AddOneMonthFallbackToLastDayOfMonth(date time.Time) time.Time
- func AddToListIfNotExists(arr []string, valueToAdd string) []string
- func AnySliceToStringSlice(input []any) ([]string, error)
- func BackOffConfig(initialInterval time.Duration, multiplier float64, maxInterval time.Duration, ...) backoff.BackOff
- func BackOffExponentialDelay(attempt int) time.Duration
- func BackOffForInvokingEventsPlatformGrpcClient() backoff.BackOff
- func BackOffIncrementalDelay(attempt int) time.Duration
- func BoolPtr(b bool) *bool
- func CallEventsPlatformGRPCWithRetry[T any](operation func() (T, error)) (T, error)
- func CapitalizeAllParts(str string, delimiters []string) string
- func Contains(slice []string, value string) bool
- func ContainsAll(sourceSlice, itemsToCheck []string) bool
- func ContainsElement[T comparable](slice []T, value T) bool
- func ConvertTimeToTimestampPtr(input *time.Time) *timestamppb.Timestamp
- func EndOfDayInUTC(t time.Time) time.Time
- func EnforceSingleValue(slice []string, value string)
- func EnsureEmailRfcId(id string) string
- func EnsureEmailRfcIds(to []string) []string
- func ExecuteQuery(ctx context.Context, driver neo4j.DriverWithContext, database, cypher string, ...) (*neo4j.EagerResult, error)
- func ExecuteQueryInTx(ctx context.Context, tx neo4j.ManagedTransaction, query string, ...) error
- func ExecuteWriteQuery(ctx context.Context, driver neo4j.DriverWithContext, cypher string, ...) error
- func ExecuteWriteQueryOnDb(ctx context.Context, driver neo4j.DriverWithContext, database, cypher string, ...) error
- func ExtractAfterColon(s string) string
- func ExtractAllRecordsAsString(ctx context.Context, result neo4j.ResultWithContext, err error) ([]string, error)
- func ExtractAllRecordsFirstValueAsDbNodePtrs(ctx context.Context, result neo4j.ResultWithContext, err error) ([]*dbtype.Node, error)
- func ExtractDomain(input string) string
- func ExtractFirstPart(str, delimiter string) string
- func ExtractFirstRecordFirstValueAsDbNodePtr(ctx context.Context, result neo4j.ResultWithContext, err error) (*dbtype.Node, error)
- func ExtractJsonFromString(str string) (string, error)
- func ExtractName(email string) string
- func ExtractSingleRecordAsNodeFromEagerResult(result *neo4j.EagerResult) (*dbtype.Node, error)
- func ExtractSingleRecordFirstValue(ctx context.Context, result neo4j.ResultWithContext, err error) (any, error)
- func ExtractSingleRecordFirstValueAsNode(ctx context.Context, result neo4j.ResultWithContext, err error) (*dbtype.Node, error)
- func ExtractSingleRecordFirstValueAsString(ctx context.Context, result neo4j.ResultWithContext, err error) (string, error)
- func ExtractSingleRecordFirstValueAsType[T any](ctx context.Context, result neo4j.ResultWithContext, err error) (T, error)
- func ExtractSingleRecordNodeAndRelationship(ctx context.Context, result neo4j.ResultWithContext, err error) (*dbtype.Node, *dbtype.Relationship, error)
- func FirstNotEmpty(input ...string) *string
- func FirstTimeOfMonth(year, month int) time.Time
- func Float64Ptr(f float64) *float64
- func Float64PtrEquals(a, b *float64) bool
- func FloatToString(num *float64) string
- func FormatAmount(amount float64, decimals int) string
- func GenerateRandomStringFromCharset(length int, charset string) string
- func GenerateUUID() (string, error)
- func GetBoolPropOrFalse(props map[string]any, key string) bool
- func GetBoolPropOrNil(props map[string]any, key string) *bool
- func GetEpochStart() time.Time
- func GetFileType(head []byte) (types.Type, error)
- func GetFileTypeHeadFromBytes(bytes *[]byte) ([]byte, error)
- func GetFileTypeHeadFromMultipart(file multipart.File) ([]byte, error)
- func GetFloatPropOrNil(props map[string]any, key string) *float64
- func GetFloatPropOrZero(props map[string]any, key string) float64
- func GetFunctionName() string
- func GetInt64PropOrDefault(props map[string]any, key string, defaultVal int64) int64
- func GetInt64PropOrNil(props map[string]any, key string) *int64
- func GetInt64PropOrZero(props map[string]any, key string) int64
- func GetIntPropOrMinusOne(props map[string]any, key string) int64
- func GetListStringPropOrEmpty(props map[string]any, key string) []string
- func GetLongLivedContext(ctx context.Context) (context.Context, context.CancelFunc)
- func GetMediumLivedContext(ctx context.Context) (context.Context, context.CancelFunc)
- func GetPropertyDetailsByLookupName(T reflect.Type, lookupName string) (map[string]string, error)
- func GetPropsFromNode(node dbtype.Node) map[string]any
- func GetPropsFromRelationship(rel dbtype.Relationship) map[string]any
- func GetShortLivedContext(ctx context.Context) (context.Context, context.CancelFunc)
- func GetStringPropOrEmpty(props map[string]any, key string) string
- func GetStringPropOrNil(props map[string]any, key string) *string
- func GetTimePropFromNeo4jOrZeroTime(valueToExtract any) time.Time
- func GetTimePropOrEpochStart(props map[string]any, key string) time.Time
- func GetTimePropOrNil(props map[string]any, key string) *time.Time
- func GetTimePropOrNow(props map[string]any, key string) time.Time
- func GetTimePropOrZeroTime(props map[string]any, key string) time.Time
- func Hmac(body []byte, key []byte) *string
- func IfNotNilBool(check any, valueExtractor ...func() bool) bool
- func IfNotNilFloat64(check any, valueExtractor ...func() float64) float64
- func IfNotNilInt64(check any, valueExtractor ...func() int64) int64
- func IfNotNilString(check any, valueExtractor ...func() string) string
- func IfNotNilStringWithDefault(check any, defaultValue string) string
- func IfNotNilTimeWithDefault(check any, defaultValue time.Time) time.Time
- func Int64Ptr(i int64) *int64
- func Int64PtrToIntPtr(v *int64) *int
- func IntPtr(i int) *int
- func IntPtrToInt64Ptr(v *int) *int64
- func IsEmptyString(s *string) bool
- func IsEndOfMonth(t time.Time) bool
- func IsEqualTimePtr(t1, t2 *time.Time) bool
- func IsValidTLD(input string) bool
- func JoinNonEmpty(delimiter string, strs ...string) string
- func LastDayOfMonth(year, month int) time.Time
- func LastTimeOfMonth(year, month int) time.Time
- func LowercaseSliceOfStrings(arr []string) []string
- func LowercaseStrings(arr []string)deprecated
- func MergeMapToMap(src, dst map[string]any)
- func MiddleTimeOfMonth(year, month int) time.Time
- func NewNeo4jReadSession(ctx context.Context, driver neo4j.DriverWithContext, ...) neo4j.SessionWithContext
- func NewNeo4jWriteSession(ctx context.Context, driver neo4j.DriverWithContext, ...) neo4j.SessionWithContext
- func NewUUIDIfEmpty(str string) string
- func NodePtr(node dbtype.Node) *dbtype.Node
- func Now() time.Time
- func NowPtr() *time.Time
- func ParseStringToFloat(input string) *float64
- func Ptr[T any](obj T) *T
- func RelationshipPtr(relationship dbtype.Relationship) *dbtype.Relationship
- func RemoveDuplicates(arr []string) []string
- func RemoveEmpties(arr []string) []string
- func RemoveFromList(arr []string, valueToRemove string) []string
- func ReverseMap[K comparable, V comparable](in map[K]V) map[V]K
- func RoundHalfUpFloat64(input float64, decimals int) float64
- func StringFirstNonEmpty(strs ...string) string
- func StringPtr(str string) *string
- func StringPtrFirstNonEmpty(strs ...*string) string
- func StringPtrFirstNonEmptyNillable(strs ...string) *string
- func StringPtrNillable(str string) *string
- func SurroundWith(src, surround string) string
- func SurroundWithRoundParentheses(src string) string
- func SurroundWithSpaces(src string) string
- func TimePtr(t time.Time) *time.Time
- func TimePtrAsAny(times ...*time.Time) interface{}
- func TimestampProtoToTime(pbTime *timestamppb.Timestamp) time.Time
- func TimestampProtoToTimePtr(pbTime *timestamppb.Timestamp) *time.Time
- func ToDate(t time.Time) time.Time
- func ToDateAsAny(t *time.Time) interface{}
- func ToDatePtr(t *time.Time) *time.Time
- func ToJson(obj any) (string, error)
- func ToNeo4jDateAsAny(t *time.Time) any
- func ToPtr[T any](obj T) *T
- func Today() time.Time
- func TruncateFloat64(input float64, decimals int) float64
- func UnmarshalDateTime(input string) (*time.Time, error)
- func ZeroTime() time.Time
- type BoltLogger
- type ComparisonOperator
- type ConsoleBoltNoLogger
- type Cypher
- type CypherFilter
- func CreateCypherFilter(propertyName string, searchTerm any, comparator ComparisonOperator) *CypherFilter
- func CreateCypherFilterEq(propertyName string, value any) *CypherFilter
- func CreateCypherFilterIn(propertyName string, arrayValues any) *CypherFilter
- func CreateCypherFilterIsNotNull(propertyName string) *CypherFilter
- func CreateCypherFilterIsNull(propertyName string) *CypherFilter
- func CreateCypherFilterNotEq(propertyName string, value any) *CypherFilter
- func CreateStringCypherFilter(propertyName string, searchTerm any, comparator ComparisonOperator) *CypherFilter
- func (f *CypherFilter) BuildCypherFilterFragment(nodeAlias string) (string, map[string]any)
- func (f *CypherFilter) BuildCypherFilterFragmentWithParamName(nodeAlias string, customParamPrefix string) (string, map[string]any)
- func (f *CypherFilter) CypherFilterFragment(nodeAlias string) (Cypher, map[string]any)
- func (f CypherFilter) String() string
- type CypherFilterItem
- type CypherSort
- type DbNodeAndId
- type DbNodeAndRelation
- type DbNodeAndTenant
- type DbNodePairAndId
- type DbNodeWithRelationAndId
- type DbNodeWithRelationIdAndTenant
- type DbNodesWithTotalCount
- type DbPropsAndId
- type LogicalOperator
- type OrderBy
- type Pagination
- type Pair
- type PairDbNodesWithTotalCount
- type RecordsWithTotalCount
- type SessionConfigurationOption
- type YearMonth
Constants ¶
View Source
const ( ShortDuration = 500 * time.Millisecond MediumDuration = 2 * time.Second LongDuration = 20 * time.Second )
View Source
const ( TagKey = "neo4jDb" TagLookupName = "lookupName" TagProperty = "property" TagSupportCaseSensitive = "supportCaseSensitive" )
Variables ¶
This section is empty.
Functions ¶
func AddToListIfNotExists ¶
func AnySliceToStringSlice ¶
func BackOffConfig ¶
func BackOffExponentialDelay ¶
Implement a backoffDelay function that calculates the delay before the next retry.
func BackOffForInvokingEventsPlatformGrpcClient ¶
func BackOffForInvokingEventsPlatformGrpcClient() backoff.BackOff
func BackOffIncrementalDelay ¶
func CapitalizeAllParts ¶
func ContainsAll ¶
func ContainsElement ¶
func ContainsElement[T comparable](slice []T, value T) bool
func ConvertTimeToTimestampPtr ¶
func ConvertTimeToTimestampPtr(input *time.Time) *timestamppb.Timestamp
func EnforceSingleValue ¶
func EnsureEmailRfcId ¶
func EnsureEmailRfcIds ¶
func ExecuteQuery ¶
func ExecuteQueryInTx ¶
func ExecuteWriteQuery ¶
func ExecuteWriteQueryOnDb ¶
func ExtractAfterColon ¶
func ExtractDomain ¶
func ExtractFirstPart ¶
func ExtractJsonFromString ¶
func ExtractName ¶
func ExtractSingleRecordAsNodeFromEagerResult ¶
func ExtractSingleRecordAsNodeFromEagerResult(result *neo4j.EagerResult) (*dbtype.Node, error)
func ExtractSingleRecordNodeAndRelationship ¶
func ExtractSingleRecordNodeAndRelationship(ctx context.Context, result neo4j.ResultWithContext, err error) (*dbtype.Node, *dbtype.Relationship, error)
func FirstNotEmpty ¶
func FirstTimeOfMonth ¶
func Float64Ptr ¶
func Float64PtrEquals ¶
func FloatToString ¶
func FormatAmount ¶
func GenerateUUID ¶
func GetEpochStart ¶
func GetFunctionName ¶
func GetFunctionName() string
func GetInt64PropOrDefault ¶
func GetLongLivedContext ¶
func GetMediumLivedContext ¶
func GetPropsFromRelationship ¶
func GetPropsFromRelationship(rel dbtype.Relationship) map[string]any
func GetShortLivedContext ¶
func GetTimePropOrEpochStart ¶
func IfNotNilBool ¶
func IfNotNilFloat64 ¶
func IfNotNilInt64 ¶
func IfNotNilString ¶
func IfNotNilTimeWithDefault ¶
func Int64PtrToIntPtr ¶
func IntPtrToInt64Ptr ¶
func IsEmptyString ¶
func IsEndOfMonth ¶
func IsEqualTimePtr ¶
IsEqualTimePtr compares two *time.Time values and returns true if both are nil or if both point to the same time.
func IsValidTLD ¶
func JoinNonEmpty ¶
func LastDayOfMonth ¶
func LastTimeOfMonth ¶
func LowercaseSliceOfStrings ¶
func LowercaseStrings
deprecated
func LowercaseStrings(arr []string)
Deprecated: use LowercaseSliceOfStrings instead
func MergeMapToMap ¶
func MiddleTimeOfMonth ¶
func NewNeo4jReadSession ¶
func NewNeo4jReadSession(ctx context.Context, driver neo4j.DriverWithContext, options ...SessionConfigurationOption) neo4j.SessionWithContext
func NewNeo4jWriteSession ¶
func NewNeo4jWriteSession(ctx context.Context, driver neo4j.DriverWithContext, options ...SessionConfigurationOption) neo4j.SessionWithContext
func NewUUIDIfEmpty ¶
func ParseStringToFloat ¶
func RelationshipPtr ¶
func RelationshipPtr(relationship dbtype.Relationship) *dbtype.Relationship
func RemoveDuplicates ¶
func RemoveEmpties ¶
func RemoveFromList ¶
func ReverseMap ¶
func ReverseMap[K comparable, V comparable](in map[K]V) map[V]K
func RoundHalfUpFloat64 ¶
func StringFirstNonEmpty ¶
func StringPtrFirstNonEmpty ¶
func StringPtrNillable ¶
func SurroundWith ¶
func SurroundWithSpaces ¶
func TimePtrAsAny ¶
func TimestampProtoToTime ¶
func TimestampProtoToTime(pbTime *timestamppb.Timestamp) time.Time
func TimestampProtoToTimePtr ¶
func TimestampProtoToTimePtr(pbTime *timestamppb.Timestamp) *time.Time
func ToDateAsAny ¶
func ToNeo4jDateAsAny ¶
func TruncateFloat64 ¶
Types ¶
type BoltLogger ¶
type ComparisonOperator ¶
type ComparisonOperator int
const ( C_NONE ComparisonOperator = iota IS_NULL IS_NOT_NULL EQUALS NOT_EQUALS CONTAINS STARTS_WITH LTE GTE IN BETWEEN IS_EMPTY )
func (ComparisonOperator) CypherString ¶
func (c ComparisonOperator) CypherString() string
func (ComparisonOperator) String ¶
func (c ComparisonOperator) String() string
type ConsoleBoltNoLogger ¶
type ConsoleBoltNoLogger struct { }
func ConsoleBoltNoLoggerrr ¶
func ConsoleBoltNoLoggerrr() *ConsoleBoltNoLogger
func (*ConsoleBoltNoLogger) LogClientMessage ¶
func (cbl *ConsoleBoltNoLogger) LogClientMessage(id, msg string, args ...any)
func (*ConsoleBoltNoLogger) LogServerMessage ¶
func (cbl *ConsoleBoltNoLogger) LogServerMessage(id, msg string, args ...any)
type CypherFilter ¶
type CypherFilter struct { Negate bool LogicalOperator LogicalOperator Filters []*CypherFilter Details *CypherFilterItem // contains filtered or unexported fields }
func CreateCypherFilter ¶
func CreateCypherFilter(propertyName string, searchTerm any, comparator ComparisonOperator) *CypherFilter
func CreateCypherFilterEq ¶
func CreateCypherFilterEq(propertyName string, value any) *CypherFilter
func CreateCypherFilterIn ¶
func CreateCypherFilterIn(propertyName string, arrayValues any) *CypherFilter
func CreateCypherFilterIsNotNull ¶
func CreateCypherFilterIsNotNull(propertyName string) *CypherFilter
func CreateCypherFilterIsNull ¶
func CreateCypherFilterIsNull(propertyName string) *CypherFilter
func CreateCypherFilterNotEq ¶
func CreateCypherFilterNotEq(propertyName string, value any) *CypherFilter
func CreateStringCypherFilter ¶
func CreateStringCypherFilter(propertyName string, searchTerm any, comparator ComparisonOperator) *CypherFilter
func (*CypherFilter) BuildCypherFilterFragment ¶
func (f *CypherFilter) BuildCypherFilterFragment(nodeAlias string) (string, map[string]any)
func (*CypherFilter) BuildCypherFilterFragmentWithParamName ¶
func (*CypherFilter) CypherFilterFragment ¶
func (f *CypherFilter) CypherFilterFragment(nodeAlias string) (Cypher, map[string]any)
func (CypherFilter) String ¶
func (f CypherFilter) String() string
type CypherFilterItem ¶
type CypherFilterItem struct { NodeProperty string SupportCaseSensitive bool CaseSensitive bool Value any DbNodePropertyProps map[string]string ComparisonOperator ComparisonOperator }
func (CypherFilterItem) String ¶
func (f CypherFilterItem) String() string
type CypherSort ¶
type CypherSort struct {
// contains filtered or unexported fields
}
func (*CypherSort) NewSortRule ¶
func (*CypherSort) SortingCypherFragment ¶
func (s *CypherSort) SortingCypherFragment(nodeAlias string) Cypher
func (*CypherSort) SortingCypherFragmentWithDefaultIfNil ¶
func (s *CypherSort) SortingCypherFragmentWithDefaultIfNil(aliases, nodeAlias string, defaultValueIfNil string) Cypher
type DbNodeAndId ¶
func ExtractAllRecordsAsDbNodeAndId ¶
func ExtractAllRecordsAsDbNodeAndId(ctx context.Context, result neo4j.ResultWithContext, err error) ([]*DbNodeAndId, error)
func ExtractAllRecordsAsDbNodeAndIdFromEagerResult ¶
func ExtractAllRecordsAsDbNodeAndIdFromEagerResult(result *neo4j.EagerResult) []*DbNodeAndId
type DbNodeAndRelation ¶
type DbNodeAndRelation struct { Node *dbtype.Node Relationship *dbtype.Relationship }
func ExtractAllRecordsAsDbNodeAndRelation ¶
func ExtractAllRecordsAsDbNodeAndRelation(ctx context.Context, result neo4j.ResultWithContext, err error) ([]*DbNodeAndRelation, error)
type DbNodeAndTenant ¶
func ExtractAllRecordsAsDbNodeAndTenant ¶
func ExtractAllRecordsAsDbNodeAndTenant(ctx context.Context, result neo4j.ResultWithContext, err error) ([]*DbNodeAndTenant, error)
type DbNodePairAndId ¶
func ExtractAllRecordsAsDbNodePairAndId ¶
func ExtractAllRecordsAsDbNodePairAndId(ctx context.Context, result neo4j.ResultWithContext, err error) ([]*DbNodePairAndId, error)
type DbNodeWithRelationAndId ¶
type DbNodeWithRelationAndId struct { Node *dbtype.Node Relationship *dbtype.Relationship LinkedNodeId string }
func ExtractAllRecordsAsDbNodeWithRelationAndId ¶
func ExtractAllRecordsAsDbNodeWithRelationAndId(ctx context.Context, result neo4j.ResultWithContext, err error) ([]*DbNodeWithRelationAndId, error)
type DbNodeWithRelationIdAndTenant ¶
type DbNodeWithRelationIdAndTenant struct { Node *dbtype.Node Relationship *dbtype.Relationship LinkedNodeId string Tenant string }
func ExtractAllRecordsAsDbNodeWithRelationIdAndTenant ¶
func ExtractAllRecordsAsDbNodeWithRelationIdAndTenant(ctx context.Context, result neo4j.ResultWithContext, err error) ([]*DbNodeWithRelationIdAndTenant, error)
type DbNodesWithTotalCount ¶
type DbPropsAndId ¶
func ExtractAllRecordsAsDbPropsAndId ¶
func ExtractAllRecordsAsDbPropsAndId(ctx context.Context, result neo4j.ResultWithContext, err error) ([]*DbPropsAndId, error)
type LogicalOperator ¶
type LogicalOperator int
const ( L_NONE LogicalOperator = iota AND OR )
func (LogicalOperator) String ¶
func (l LogicalOperator) String() string
type OrderBy ¶
type OrderBy struct {
// contains filtered or unexported fields
}
func (*OrderBy) WithCoalesce ¶
func (*OrderBy) WithDescending ¶
type Pagination ¶
func (*Pagination) GetLimit ¶
func (p *Pagination) GetLimit() int
func (*Pagination) GetPage ¶
func (p *Pagination) GetPage() int
func (*Pagination) GetSkip ¶
func (p *Pagination) GetSkip() int
func (*Pagination) SetRows ¶
func (p *Pagination) SetRows(rows interface{})
func (*Pagination) SetTotalRows ¶
func (p *Pagination) SetTotalRows(totalRows int64)
type RecordsWithTotalCount ¶
type SessionConfigurationOption ¶
type SessionConfigurationOption func(config *neo4j.SessionConfig)
func WithBoltLogger ¶
func WithBoltLogger(logger log.BoltLogger) SessionConfigurationOption
func WithDatabaseName ¶
func WithDatabaseName(databaseName string) SessionConfigurationOption
func WithFetchSize ¶
func WithFetchSize(fetchSize int) SessionConfigurationOption
Click to show internal directories.
Click to hide internal directories.