From cd04d4f483c5ea084133e08960a45e585dba56dc Mon Sep 17 00:00:00 2001 From: Matthew McNeely Date: Mon, 14 Jul 2025 16:27:56 -0400 Subject: [PATCH 01/20] Remove deprecated files --- api.go | 227 ----------------------- api/apiutils/apiutils.go | 25 --- api/dgraphtypes/dgraphtypes.go | 184 ------------------- api/mutations/mutations.go | 77 -------- api/querygen/dql_query.go | 195 -------------------- api/structreflect/keyval.go | 19 -- api/structreflect/structreflect.go | 259 --------------------------- api/structreflect/tagparser.go | 55 ------ api/structreflect/tags.go | 16 -- api/structreflect/value_extractor.go | 24 --- api/types.go | 34 ---- api/types_test.go | 51 ------ api_mutation_gen.go | 152 ---------------- api_mutation_helpers.go | 133 -------------- api_query_execution.go | 210 ---------------------- api_types.go | 205 --------------------- 16 files changed, 1866 deletions(-) delete mode 100644 api.go delete mode 100644 api/apiutils/apiutils.go delete mode 100644 api/dgraphtypes/dgraphtypes.go delete mode 100644 api/mutations/mutations.go delete mode 100644 api/querygen/dql_query.go delete mode 100644 api/structreflect/keyval.go delete mode 100644 api/structreflect/structreflect.go delete mode 100644 api/structreflect/tagparser.go delete mode 100644 api/structreflect/tags.go delete mode 100644 api/structreflect/value_extractor.go delete mode 100644 api/types.go delete mode 100644 api/types_test.go delete mode 100644 api_mutation_gen.go delete mode 100644 api_mutation_helpers.go delete mode 100644 api_query_execution.go delete mode 100644 api_types.go diff --git a/api.go b/api.go deleted file mode 100644 index df9db12..0000000 --- a/api.go +++ /dev/null @@ -1,227 +0,0 @@ -/* - * SPDX-FileCopyrightText: © Hypermode Inc. - * SPDX-License-Identifier: Apache-2.0 - */ - -package modusgraph - -import ( - "context" - "errors" - "reflect" - - "github.com/hypermodeinc/dgraph/v25/dql" - "github.com/hypermodeinc/dgraph/v25/schema" - "github.com/hypermodeinc/modusgraph/api/apiutils" - "github.com/hypermodeinc/modusgraph/api/structreflect" -) - -// Deprecated: Use NewClient and client.Insert instead. -func Create[T any](ctx context.Context, engine *Engine, object T, - nsId ...uint64) (uint64, T, error) { - engine.mutex.Lock() - defer engine.mutex.Unlock() - if len(nsId) > 1 { - return 0, object, errors.New("only one namespace is allowed") - } - ctx, ns, err := getDefaultNamespace(ctx, engine, nsId...) - if err != nil { - return 0, object, err - } - - gid, err := engine.z.nextUID() - if err != nil { - return 0, object, err - } - - dms := make([]*dql.Mutation, 0) - sch := &schema.ParsedSchema{} - err = generateSetDqlMutationsAndSchema[T](ctx, ns, object, gid, &dms, sch) - if err != nil { - return 0, object, err - } - - err = engine.alterSchemaWithParsed(ctx, sch) - if err != nil { - return 0, object, err - } - - err = applyDqlMutations(ctx, engine, dms) - if err != nil { - return 0, object, err - } - - return getByGid[T](ctx, ns, gid) -} - -// Deprecated -func Upsert[T any](ctx context.Context, engine *Engine, object T, - nsId ...uint64) (uint64, T, bool, error) { - - var wasFound bool - engine.mutex.Lock() - defer engine.mutex.Unlock() - if len(nsId) > 1 { - return 0, object, false, errors.New("only one namespace is allowed") - } - - ctx, ns, err := getDefaultNamespace(ctx, engine, nsId...) - if err != nil { - return 0, object, false, err - } - - gid, cfKeyValue, err := structreflect.GetUniqueConstraint[T](object) - if err != nil { - return 0, object, false, err - } - var cf *ConstrainedField - if cfKeyValue != nil { - cf = &ConstrainedField{ - Key: cfKeyValue.Key(), - Value: cfKeyValue.Value(), - } - } - - dms := make([]*dql.Mutation, 0) - sch := &schema.ParsedSchema{} - err = generateSetDqlMutationsAndSchema[T](ctx, ns, object, gid, &dms, sch) - if err != nil { - return 0, object, false, err - } - - err = ns.engine.alterSchemaWithParsed(ctx, sch) - if err != nil { - return 0, object, false, err - } - - if gid != 0 || cf != nil { - gid, err = getExistingObject[T](ctx, ns, gid, cf, object) - if err != nil && err != apiutils.ErrNoObjFound { - return 0, object, false, err - } - wasFound = err == nil - } - - if gid == 0 { - gid, err = engine.z.nextUID() - if err != nil { - return 0, object, false, err - } - } - - dms = make([]*dql.Mutation, 0) - err = generateSetDqlMutationsAndSchema[T](ctx, ns, object, gid, &dms, sch) - if err != nil { - return 0, object, false, err - } - - err = applyDqlMutations(ctx, engine, dms) - if err != nil { - return 0, object, false, err - } - - gid, object, err = getByGid[T](ctx, ns, gid) - if err != nil { - return 0, object, false, err - } - - return gid, object, wasFound, nil -} - -// Deprecated: Use NewClient and client.Get instead. -func Get[T any, R UniqueField](ctx context.Context, engine *Engine, uniqueField R, - nsId ...uint64) (uint64, T, error) { - engine.mutex.Lock() - defer engine.mutex.Unlock() - var obj T - if len(nsId) > 1 { - return 0, obj, errors.New("only one namespace is allowed") - } - ctx, ns, err := getDefaultNamespace(ctx, engine, nsId...) - if err != nil { - return 0, obj, err - } - if uid, ok := any(uniqueField).(uint64); ok { - return getByGid[T](ctx, ns, uid) - } - - if cf, ok := any(uniqueField).(ConstrainedField); ok { - objType := reflect.TypeOf(obj) - sch, err := getSchema(ctx, ns) - if err != nil { - return 0, obj, err - } - for _, t := range sch.Types { - if t.Name == objType.Name() { - return getByConstrainedField[T](ctx, ns, cf) - } - } - return 0, obj, errors.New("type not found") - } - - return 0, obj, errors.New("invalid unique field type") -} - -// Deprecated: Use NewClient and client.Query instead. -func Query[T any](ctx context.Context, engine *Engine, queryParams QueryParams, - nsId ...uint64) ([]uint64, []T, error) { - engine.mutex.Lock() - defer engine.mutex.Unlock() - if len(nsId) > 1 { - return nil, nil, errors.New("only one namespace is allowed") - } - ctx, ns, err := getDefaultNamespace(ctx, engine, nsId...) - if err != nil { - return nil, nil, err - } - - return executeQuery[T](ctx, ns, queryParams, true) -} - -// Deprecated: Use NewClient and client.Delete instead. -func Delete[T any, R UniqueField](ctx context.Context, engine *Engine, uniqueField R, - nsId ...uint64) (uint64, T, error) { - engine.mutex.Lock() - defer engine.mutex.Unlock() - var zeroObj T - if len(nsId) > 1 { - return 0, zeroObj, errors.New("only one namespace is allowed") - } - ctx, ns, err := getDefaultNamespace(ctx, engine, nsId...) - if err != nil { - return 0, zeroObj, err - } - if uid, ok := any(uniqueField).(uint64); ok { - uid, obj, err := getByGid[T](ctx, ns, uid) - if err != nil { - return 0, zeroObj, err - } - - dms := generateDeleteDqlMutations(ns, uid) - - err = applyDqlMutations(ctx, engine, dms) - if err != nil { - return 0, zeroObj, err - } - - return uid, obj, nil - } - - if cf, ok := any(uniqueField).(ConstrainedField); ok { - uid, obj, err := getByConstrainedField[T](ctx, ns, cf) - if err != nil { - return 0, zeroObj, err - } - - dms := generateDeleteDqlMutations(ns, uid) - - err = applyDqlMutations(ctx, engine, dms) - if err != nil { - return 0, zeroObj, err - } - - return uid, obj, nil - } - - return 0, zeroObj, errors.New("invalid unique field type") -} diff --git a/api/apiutils/apiutils.go b/api/apiutils/apiutils.go deleted file mode 100644 index abc70e6..0000000 --- a/api/apiutils/apiutils.go +++ /dev/null @@ -1,25 +0,0 @@ -/* - * SPDX-FileCopyrightText: © Hypermode Inc. - * SPDX-License-Identifier: Apache-2.0 - */ - -package apiutils - -import ( - "fmt" - - "github.com/hypermodeinc/dgraph/v25/x" -) - -var ( - ErrNoObjFound = fmt.Errorf("no object found") - NoUniqueConstr = "unique constraint not defined for any field on type %s" -) - -func GetPredicateName(typeName, fieldName string) string { - return fmt.Sprint(typeName, ".", fieldName) -} - -func AddNamespace(ns uint64, pred string) string { - return x.NamespaceAttr(ns, pred) -} diff --git a/api/dgraphtypes/dgraphtypes.go b/api/dgraphtypes/dgraphtypes.go deleted file mode 100644 index 1a5b215..0000000 --- a/api/dgraphtypes/dgraphtypes.go +++ /dev/null @@ -1,184 +0,0 @@ -/* - * SPDX-FileCopyrightText: © Hypermode Inc. - * SPDX-License-Identifier: Apache-2.0 - */ - -package dgraphtypes - -import ( - "encoding/binary" - "fmt" - "time" - - "github.com/dgraph-io/dgo/v250/protos/api" - "github.com/hypermodeinc/dgraph/v25/protos/pb" - "github.com/hypermodeinc/dgraph/v25/types" - "github.com/pkg/errors" - "github.com/twpayne/go-geom" - "github.com/twpayne/go-geom/encoding/wkb" - - modusapi "github.com/hypermodeinc/modusgraph/api" - "github.com/hypermodeinc/modusgraph/api/structreflect" -) - -func addIndex(u *pb.SchemaUpdate, index string, uniqueConstraintExists bool) bool { - u.Directive = pb.SchemaUpdate_INDEX - switch index { - case "exact": - u.Tokenizer = []string{"exact"} - case "term": - u.Tokenizer = []string{"term"} - case "hash": - u.Tokenizer = []string{"hash"} - case "unique": - u.Tokenizer = []string{"exact"} - u.Unique = true - u.Upsert = true - uniqueConstraintExists = true - case "fulltext": - u.Tokenizer = []string{"fulltext"} - case "trigram": - u.Tokenizer = []string{"trigram"} - case "vector": - u.IndexSpecs = []*pb.VectorIndexSpec{ - { - Name: "hnsw", - Options: []*pb.OptionPair{ - { - Key: "metric", - Value: "cosine", - }, - }, - }, - } - default: - return uniqueConstraintExists - } - return uniqueConstraintExists -} - -func ValueToPosting_ValType(v any) (pb.Posting_ValType, error) { - switch v.(type) { - case string: - return pb.Posting_STRING, nil - case int, int8, int16, int32, int64, uint, uint8, uint16, uint32: - return pb.Posting_INT, nil - case uint64: - return pb.Posting_UID, nil - case bool: - return pb.Posting_BOOL, nil - case float32, float64: - return pb.Posting_FLOAT, nil - case []byte: - return pb.Posting_BINARY, nil - case time.Time: - return pb.Posting_DATETIME, nil - case modusapi.Point, modusapi.Polygon: - return pb.Posting_GEO, nil - case []float32, []float64: - return pb.Posting_VFLOAT, nil - default: - return pb.Posting_DEFAULT, fmt.Errorf("value to posting, unsupported type %T", v) - } -} - -// ValueToApiVal converts a value to an api.Value. Note the result can be nil for empty non-scalar types -func ValueToApiVal(v any) (*api.Value, error) { - switch val := v.(type) { - case string: - return &api.Value{Val: &api.Value_StrVal{StrVal: val}}, nil - case int: - return &api.Value{Val: &api.Value_IntVal{IntVal: int64(val)}}, nil - case int8: - return &api.Value{Val: &api.Value_IntVal{IntVal: int64(val)}}, nil - case int16: - return &api.Value{Val: &api.Value_IntVal{IntVal: int64(val)}}, nil - case int32: - return &api.Value{Val: &api.Value_IntVal{IntVal: int64(val)}}, nil - case int64: - return &api.Value{Val: &api.Value_IntVal{IntVal: val}}, nil - case uint8: - return &api.Value{Val: &api.Value_IntVal{IntVal: int64(val)}}, nil - case uint16: - return &api.Value{Val: &api.Value_IntVal{IntVal: int64(val)}}, nil - case uint32: - return &api.Value{Val: &api.Value_IntVal{IntVal: int64(val)}}, nil - case uint64: - return &api.Value{Val: &api.Value_UidVal{UidVal: val}}, nil - case bool: - return &api.Value{Val: &api.Value_BoolVal{BoolVal: val}}, nil - case float32: - return &api.Value{Val: &api.Value_DoubleVal{DoubleVal: float64(val)}}, nil - case float64: - return &api.Value{Val: &api.Value_DoubleVal{DoubleVal: val}}, nil - case []float32: - return &api.Value{Val: &api.Value_Vfloat32Val{ - Vfloat32Val: types.FloatArrayAsBytes(val)}}, nil - case []float64: - float32Slice := make([]float32, len(val)) - for i, v := range val { - float32Slice[i] = float32(v) - } - return &api.Value{Val: &api.Value_Vfloat32Val{ - Vfloat32Val: types.FloatArrayAsBytes(float32Slice)}}, nil - case []byte: - return &api.Value{Val: &api.Value_BytesVal{BytesVal: val}}, nil - case time.Time: - bytes, err := val.MarshalBinary() - if err != nil { - return nil, err - } - return &api.Value{Val: &api.Value_DatetimeVal{DatetimeVal: bytes}}, nil - case modusapi.Point: - if len(val.Coordinates) == 0 { - return nil, nil - } - point, err := geom.NewPoint(geom.XY).SetCoords(val.Coordinates) - if err != nil { - return nil, errors.Wrap(err, "converting point to api value") - } - bytes, err := wkb.Marshal(point, binary.LittleEndian) - if err != nil { - return nil, errors.Wrap(err, "marshalling point to wkb") - } - return &api.Value{Val: &api.Value_GeoVal{GeoVal: bytes}}, nil - case modusapi.Polygon: - if len(val.Coordinates) == 0 { - return nil, nil - } - coords := make([][]geom.Coord, len(val.Coordinates)) - for i, polygon := range val.Coordinates { - coords[i] = make([]geom.Coord, len(polygon)) - for j, point := range polygon { - coords[i][j] = geom.Coord{point[0], point[1]} - } - } - polygon, err := geom.NewPolygon(geom.XY).SetCoords(coords) - if err != nil { - return nil, errors.Wrap(err, "converting polygon to api value") - } - bytes, err := wkb.Marshal(polygon, binary.LittleEndian) - if err != nil { - return nil, errors.Wrap(err, "marshalling polygon to wkb") - } - return &api.Value{Val: &api.Value_GeoVal{GeoVal: bytes}}, nil - case uint: - return &api.Value{Val: &api.Value_DefaultVal{DefaultVal: fmt.Sprint(v)}}, nil - default: - return nil, fmt.Errorf("convert value to api value, unsupported type %T", v) - } -} - -func HandleConstraints(u *pb.SchemaUpdate, jsonToDbTags map[string]*structreflect.DbTag, jsonName string, - valType pb.Posting_ValType, uniqueConstraintFound bool) (bool, error) { - if jsonToDbTags[jsonName] == nil { - return uniqueConstraintFound, nil - } - - constraint := jsonToDbTags[jsonName].Constraint - if constraint == "vector" && valType != pb.Posting_VFLOAT { - return false, fmt.Errorf("vector index can only be applied to []float values") - } - - return addIndex(u, constraint, uniqueConstraintFound), nil -} diff --git a/api/mutations/mutations.go b/api/mutations/mutations.go deleted file mode 100644 index 6265000..0000000 --- a/api/mutations/mutations.go +++ /dev/null @@ -1,77 +0,0 @@ -/* - * SPDX-FileCopyrightText: © Hypermode Inc. - * SPDX-License-Identifier: Apache-2.0 - */ - -package mutations - -import ( - "fmt" - "reflect" - "strings" - - "github.com/dgraph-io/dgo/v250/protos/api" - "github.com/hypermodeinc/dgraph/v25/protos/pb" - "github.com/hypermodeinc/dgraph/v25/schema" - "github.com/hypermodeinc/modusgraph/api/apiutils" - "github.com/hypermodeinc/modusgraph/api/dgraphtypes" -) - -func HandleReverseEdge(jsonName string, value reflect.Type, nsId uint64, sch *schema.ParsedSchema, - reverseEdgeStr string) error { - if reverseEdgeStr == "" { - return nil - } - - if value.Kind() != reflect.Slice || value.Elem().Kind() != reflect.Struct { - return fmt.Errorf("reverse edge %s should be a slice of structs", jsonName) - } - - typeName := strings.Split(reverseEdgeStr, ".")[0] - u := &pb.SchemaUpdate{ - Predicate: apiutils.AddNamespace(nsId, reverseEdgeStr), - ValueType: pb.Posting_UID, - Directive: pb.SchemaUpdate_REVERSE, - } - - sch.Preds = append(sch.Preds, u) - sch.Types = append(sch.Types, &pb.TypeUpdate{ - TypeName: apiutils.AddNamespace(nsId, typeName), - Fields: []*pb.SchemaUpdate{u}, - }) - return nil -} - -func CreateNQuadAndSchema(value any, gid uint64, jsonName string, t reflect.Type, - nsId uint64) (*api.NQuad, *pb.SchemaUpdate, error) { - valType, err := dgraphtypes.ValueToPosting_ValType(value) - if err != nil { - return nil, nil, err - } - - // val can be null here for "empty" no-scalar types - val, err := dgraphtypes.ValueToApiVal(value) - if err != nil { - return nil, nil, err - } - - nquad := &api.NQuad{ - Namespace: nsId, - Subject: fmt.Sprint(gid), - Predicate: apiutils.GetPredicateName(t.Name(), jsonName), - } - - u := &pb.SchemaUpdate{ - Predicate: apiutils.AddNamespace(nsId, apiutils.GetPredicateName(t.Name(), jsonName)), - ValueType: valType, - } - - if valType == pb.Posting_UID { - nquad.ObjectId = fmt.Sprint(value) - u.Directive = pb.SchemaUpdate_REVERSE - } else if val != nil { - nquad.ObjectValue = val - } - - return nquad, u, nil -} diff --git a/api/querygen/dql_query.go b/api/querygen/dql_query.go deleted file mode 100644 index 42d09b8..0000000 --- a/api/querygen/dql_query.go +++ /dev/null @@ -1,195 +0,0 @@ -/* - * SPDX-FileCopyrightText: © Hypermode Inc. - * SPDX-License-Identifier: Apache-2.0 - */ - -package querygen - -import ( - "fmt" - "strconv" - "strings" -) - -type SchemaField struct { - Name string `json:"name"` -} - -type SchemaType struct { - Name string `json:"name,omitempty"` - Fields []SchemaField `json:"fields,omitempty"` -} - -type SchemaResponse struct { - Types []SchemaType `json:"types,omitempty"` -} - -type QueryFunc func() string - -const ( - ObjQuery = ` - { - obj(func: %s) { - gid: uid - expand(_all_) { - gid: uid - expand(_all_) - dgraph.type - } - dgraph.type - %s - } - } - ` - - ObjsQuery = ` - { - objs(func: type("%s")%s) @filter(%s) { - gid: uid - expand(_all_) { - gid: uid - expand(_all_) - dgraph.type - } - dgraph.type - %s - } - } - ` - - ReverseEdgeQuery = ` - %s: ~%s { - gid: uid - expand(_all_) - dgraph.type - } - ` - - SchemaQuery = ` - schema{} - ` - - FuncUid = `uid(%d)` - FuncEq = `eq(%s, %s)` - FuncSimilarTo = `similar_to(%s, %d, "[%s]")` - FuncAllOfTerms = `allofterms(%s, "%s")` - FuncAnyOfTerms = `anyofterms(%s, "%s")` - FuncAllOfText = `alloftext(%s, "%s")` - FuncAnyOfText = `anyoftext(%s, "%s")` - FuncRegExp = `regexp(%s, /%s/)` - FuncLe = `le(%s, %s)` - FuncGe = `ge(%s, %s)` - FuncGt = `gt(%s, %s)` - FuncLt = `lt(%s, %s)` -) - -func BuildUidQuery(gid uint64) QueryFunc { - return func() string { - return fmt.Sprintf(FuncUid, gid) - } -} - -func BuildEqQuery(key string, value any) QueryFunc { - return func() string { - return fmt.Sprintf(FuncEq, key, value) - } -} - -func BuildSimilarToQuery(indexAttr string, topK int64, vec []float32) QueryFunc { - vecStrArr := make([]string, len(vec)) - for i := range vec { - vecStrArr[i] = strconv.FormatFloat(float64(vec[i]), 'f', -1, 32) - } - vecStr := strings.Join(vecStrArr, ",") - return func() string { - return fmt.Sprintf(FuncSimilarTo, indexAttr, topK, vecStr) - } -} - -func BuildAllOfTermsQuery(attr string, terms string) QueryFunc { - return func() string { - return fmt.Sprintf(FuncAllOfTerms, attr, terms) - } -} - -func BuildAnyOfTermsQuery(attr string, terms string) QueryFunc { - return func() string { - return fmt.Sprintf(FuncAnyOfTerms, attr, terms) - } -} - -func BuildAllOfTextQuery(attr, text string) QueryFunc { - return func() string { - return fmt.Sprintf(FuncAllOfText, attr, text) - } -} - -func BuildAnyOfTextQuery(attr, text string) QueryFunc { - return func() string { - return fmt.Sprintf(FuncAnyOfText, attr, text) - } -} - -func BuildRegExpQuery(attr, pattern string) QueryFunc { - return func() string { - return fmt.Sprintf(FuncRegExp, attr, pattern) - } -} - -func BuildLeQuery(attr, value string) QueryFunc { - return func() string { - return fmt.Sprintf(FuncLe, attr, value) - } -} - -func BuildGeQuery(attr, value string) QueryFunc { - return func() string { - return fmt.Sprintf(FuncGe, attr, value) - } -} - -func BuildGtQuery(attr, value string) QueryFunc { - return func() string { - return fmt.Sprintf(FuncGt, attr, value) - } -} - -func BuildLtQuery(attr, value string) QueryFunc { - return func() string { - return fmt.Sprintf(FuncLt, attr, value) - } -} - -func And(qfs ...QueryFunc) QueryFunc { - return func() string { - qs := make([]string, len(qfs)) - for i, qf := range qfs { - qs[i] = qf() - } - return strings.Join(qs, " AND ") - } -} - -func Or(qfs ...QueryFunc) QueryFunc { - return func() string { - qs := make([]string, len(qfs)) - for i, qf := range qfs { - qs[i] = qf() - } - return strings.Join(qs, " OR ") - } -} - -func Not(qf QueryFunc) QueryFunc { - return func() string { - return "NOT " + qf() - } -} - -func FormatObjQuery(qf QueryFunc, extraFields string) string { - return fmt.Sprintf(ObjQuery, qf(), extraFields) -} - -func FormatObjsQuery(typeName string, qf QueryFunc, paginationAndSorting string, extraFields string) string { - return fmt.Sprintf(ObjsQuery, typeName, paginationAndSorting, qf(), extraFields) -} diff --git a/api/structreflect/keyval.go b/api/structreflect/keyval.go deleted file mode 100644 index 765f852..0000000 --- a/api/structreflect/keyval.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * SPDX-FileCopyrightText: © Hypermode Inc. - * SPDX-License-Identifier: Apache-2.0 - */ - -package structreflect - -type keyValue struct { - key string - value any -} - -func (kv *keyValue) Key() string { - return kv.key -} - -func (kv *keyValue) Value() any { - return kv.value -} diff --git a/api/structreflect/structreflect.go b/api/structreflect/structreflect.go deleted file mode 100644 index 1f0fe41..0000000 --- a/api/structreflect/structreflect.go +++ /dev/null @@ -1,259 +0,0 @@ -/* - * SPDX-FileCopyrightText: © Hypermode Inc. - * SPDX-License-Identifier: Apache-2.0 - */ - -package structreflect - -import ( - "fmt" - "reflect" - "strconv" - "time" - - "github.com/hypermodeinc/modusgraph/api" - "github.com/hypermodeinc/modusgraph/api/apiutils" -) - -func GetFieldTags(t reflect.Type) (*TagMaps, error) { - tags := &TagMaps{ - FieldToJson: make(map[string]string), - JsonToDb: make(map[string]*DbTag), - JsonToReverseEdge: make(map[string]string), - } - - for i := 0; i < t.NumField(); i++ { - field := t.Field(i) - - jsonName, err := parseJsonTag(field) - if err != nil { - return nil, err - } - tags.FieldToJson[field.Name] = jsonName - - if reverseEdge, err := parseReverseEdgeTag(field); err != nil { - return nil, err - } else if reverseEdge != "" { - tags.JsonToReverseEdge[jsonName] = reverseEdge - } - - if dbTag := parseDbTag(field); dbTag != nil { - tags.JsonToDb[jsonName] = dbTag - } - } - - return tags, nil -} - -var skipProcessStructTypes = []reflect.Type{ - reflect.TypeOf(api.Point{}), - reflect.TypeOf(api.Polygon{}), - reflect.TypeOf(api.MultiPolygon{}), - reflect.TypeOf(time.Time{}), -} - -func IsDgraphType(value any) bool { - valueType := reflect.TypeOf(value) - if valueType.Kind() == reflect.Ptr { - valueType = valueType.Elem() - } - for _, t := range skipProcessStructTypes { - if valueType == t { - return true - } - } - return false -} - -func IsStructAndNotDgraphType(field reflect.StructField) bool { - fieldType := field.Type - if fieldType.Kind() == reflect.Ptr { - fieldType = fieldType.Elem() - } - if fieldType.Kind() != reflect.Struct { - return false - } - for _, t := range skipProcessStructTypes { - if fieldType == t { - return false - } - } - return true -} - -func CreateDynamicStruct(t reflect.Type, fieldToJson map[string]string, depth int) reflect.Type { - fields := make([]reflect.StructField, 0, len(fieldToJson)) - for fieldName, jsonName := range fieldToJson { - field, _ := t.FieldByName(fieldName) - if fieldName != "Gid" { - if IsStructAndNotDgraphType(field) { - if depth <= 1 { - tagMaps, _ := GetFieldTags(field.Type) - nestedType := CreateDynamicStruct(field.Type, tagMaps.FieldToJson, depth+1) - fields = append(fields, reflect.StructField{ - Name: field.Name, - Type: nestedType, - Tag: reflect.StructTag(fmt.Sprintf(`json:"%s.%s"`, t.Name(), jsonName)), - }) - } - } else if field.Type.Kind() == reflect.Ptr && - IsStructAndNotDgraphType(field) { - tagMaps, _ := GetFieldTags(field.Type.Elem()) - nestedType := CreateDynamicStruct(field.Type.Elem(), tagMaps.FieldToJson, depth+1) - fields = append(fields, reflect.StructField{ - Name: field.Name, - Type: reflect.PointerTo(nestedType), - Tag: reflect.StructTag(fmt.Sprintf(`json:"%s.%s"`, t.Name(), jsonName)), - }) - } else if field.Type.Kind() == reflect.Slice && - field.Type.Elem().Kind() == reflect.Struct { - tagMaps, _ := GetFieldTags(field.Type.Elem()) - nestedType := CreateDynamicStruct(field.Type.Elem(), tagMaps.FieldToJson, depth+1) - fields = append(fields, reflect.StructField{ - Name: field.Name, - Type: reflect.SliceOf(nestedType), - Tag: reflect.StructTag(fmt.Sprintf(`json:"%s.%s"`, t.Name(), jsonName)), - }) - } else { - fields = append(fields, reflect.StructField{ - Name: field.Name, - Type: field.Type, - Tag: reflect.StructTag(fmt.Sprintf(`json:"%s.%s"`, t.Name(), jsonName)), - }) - } - - } - } - fields = append(fields, reflect.StructField{ - Name: "Gid", - Type: reflect.TypeOf(""), - Tag: reflect.StructTag(`json:"gid"`), - }, reflect.StructField{ - Name: "DgraphType", - Type: reflect.TypeOf([]string{}), - Tag: reflect.StructTag(`json:"dgraph.type"`), - }) - return reflect.StructOf(fields) -} - -func MapDynamicToFinal(dynamic any, final any, isNested bool) (uint64, error) { - vFinal := reflect.ValueOf(final).Elem() - vDynamic := reflect.ValueOf(dynamic).Elem() - - gid := uint64(0) - - for i := 0; i < vDynamic.NumField(); i++ { - - dynamicField := vDynamic.Type().Field(i) - dynamicFieldType := dynamicField.Type - dynamicValue := vDynamic.Field(i) - - var finalField reflect.Value - if dynamicField.Name == "Gid" { - finalField = vFinal.FieldByName("Gid") - gidStr := dynamicValue.String() - gid, _ = strconv.ParseUint(gidStr, 0, 64) - } else if dynamicField.Name == "DgraphType" { - fieldArrInterface := dynamicValue.Interface() - fieldArr, ok := fieldArrInterface.([]string) - if ok { - if len(fieldArr) == 0 { - if !isNested { - return 0, apiutils.ErrNoObjFound - } else { - continue - } - } - } else { - return 0, fmt.Errorf("DgraphType field should be an array of strings") - } - } else { - finalField = vFinal.FieldByName(dynamicField.Name) - } - //if dynamicFieldType.Kind() == reflect.Struct { - if IsStructAndNotDgraphType(dynamicField) { - _, err := MapDynamicToFinal(dynamicValue.Addr().Interface(), finalField.Addr().Interface(), true) - if err != nil { - return 0, err - } - } else if dynamicFieldType.Kind() == reflect.Ptr && - IsStructAndNotDgraphType(dynamicField) { - // if field is a pointer, find if the underlying is a struct - _, err := MapDynamicToFinal(dynamicValue.Interface(), finalField.Interface(), true) - if err != nil { - return 0, err - } - } else if dynamicFieldType.Kind() == reflect.Slice && - dynamicFieldType.Elem().Kind() == reflect.Struct { - for j := 0; j < dynamicValue.Len(); j++ { - sliceElem := dynamicValue.Index(j).Addr().Interface() - finalSliceElem := reflect.New(finalField.Type().Elem()).Elem() - _, err := MapDynamicToFinal(sliceElem, finalSliceElem.Addr().Interface(), true) - if err != nil { - return 0, err - } - finalField.Set(reflect.Append(finalField, finalSliceElem)) - } - } else { - if finalField.IsValid() && finalField.CanSet() { - // if field name is gid, convert it to uint64 - if dynamicField.Name == "Gid" { - finalField.SetUint(gid) - } else { - finalField.Set(dynamicValue) - } - } - } - } - return gid, nil -} - -func ConvertDynamicToTyped[T any](obj any, t reflect.Type) (uint64, T, error) { - var result T - finalObject := reflect.New(t).Interface() - gid, err := MapDynamicToFinal(obj, finalObject, false) - if err != nil { - return 0, result, err - } - - if typedPtr, ok := finalObject.(*T); ok { - return gid, *typedPtr, nil - } else if dirType, ok := finalObject.(T); ok { - return gid, dirType, nil - } - return 0, result, fmt.Errorf("failed to convert type %T to %T", finalObject, obj) -} - -func GetUniqueConstraint[T any](object T) (uint64, *keyValue, error) { - t := reflect.TypeOf(object) - tagMaps, err := GetFieldTags(t) - if err != nil { - return 0, nil, err - } - jsonTagToValue := GetJsonTagToValues(object, tagMaps.FieldToJson) - - for jsonName, value := range jsonTagToValue { - if jsonName == "gid" { - gid, ok := value.(uint64) - if !ok { - continue - } - if gid != 0 { - return gid, nil, nil - } - } - if tagMaps.JsonToDb[jsonName] != nil && IsValidUniqueIndex(tagMaps.JsonToDb[jsonName].Constraint) { - // check if value is zero or nil - if value == reflect.Zero(reflect.TypeOf(value)).Interface() || value == nil { - continue - } - return 0, &keyValue{key: jsonName, value: value}, nil - } - } - - return 0, nil, fmt.Errorf(apiutils.NoUniqueConstr, t.Name()) -} - -func IsValidUniqueIndex(name string) bool { - return name == "unique" -} diff --git a/api/structreflect/tagparser.go b/api/structreflect/tagparser.go deleted file mode 100644 index 7a30066..0000000 --- a/api/structreflect/tagparser.go +++ /dev/null @@ -1,55 +0,0 @@ -/* - * SPDX-FileCopyrightText: © Hypermode Inc. - * SPDX-License-Identifier: Apache-2.0 - */ - -package structreflect - -import ( - "fmt" - "reflect" - "strings" - - "github.com/hypermodeinc/modusgraph/api/apiutils" -) - -func parseJsonTag(field reflect.StructField) (string, error) { - jsonTag := field.Tag.Get("json") - if jsonTag == "" { - return "", fmt.Errorf("field %s has no json tag", field.Name) - } - return strings.Split(jsonTag, ",")[0], nil -} - -func parseDbTag(field reflect.StructField) *DbTag { - dbConstraintsTag := field.Tag.Get("db") - if dbConstraintsTag == "" { - return nil - } - - dbTag := &DbTag{} - dbTagsSplit := strings.Split(dbConstraintsTag, ",") - for _, tag := range dbTagsSplit { - split := strings.Split(tag, "=") - if split[0] == "constraint" { - dbTag.Constraint = split[1] - } - } - return dbTag -} - -func parseReverseEdgeTag(field reflect.StructField) (string, error) { - reverseEdgeTag := field.Tag.Get("readFrom") - if reverseEdgeTag == "" { - return "", nil - } - - typeAndField := strings.Split(reverseEdgeTag, ",") - if len(typeAndField) != 2 { - return "", fmt.Errorf(`field %s has invalid readFrom tag, expected format is type=,field=`, field.Name) - } - - t := strings.Split(typeAndField[0], "=")[1] - f := strings.Split(typeAndField[1], "=")[1] - return apiutils.GetPredicateName(t, f), nil -} diff --git a/api/structreflect/tags.go b/api/structreflect/tags.go deleted file mode 100644 index 5f36868..0000000 --- a/api/structreflect/tags.go +++ /dev/null @@ -1,16 +0,0 @@ -/* - * SPDX-FileCopyrightText: © Hypermode Inc. - * SPDX-License-Identifier: Apache-2.0 - */ - -package structreflect - -type DbTag struct { - Constraint string -} - -type TagMaps struct { - FieldToJson map[string]string - JsonToDb map[string]*DbTag - JsonToReverseEdge map[string]string -} diff --git a/api/structreflect/value_extractor.go b/api/structreflect/value_extractor.go deleted file mode 100644 index d7cf621..0000000 --- a/api/structreflect/value_extractor.go +++ /dev/null @@ -1,24 +0,0 @@ -/* - * SPDX-FileCopyrightText: © Hypermode Inc. - * SPDX-License-Identifier: Apache-2.0 - */ - -package structreflect - -import ( - "reflect" -) - -func GetJsonTagToValues(object any, fieldToJsonTags map[string]string) map[string]any { - values := make(map[string]any) - v := reflect.ValueOf(object) - for v.Kind() == reflect.Ptr { - v = v.Elem() - } - - for fieldName, jsonName := range fieldToJsonTags { - fieldValue := v.FieldByName(fieldName) - values[jsonName] = fieldValue.Interface() - } - return values -} diff --git a/api/types.go b/api/types.go deleted file mode 100644 index 6d4c8cb..0000000 --- a/api/types.go +++ /dev/null @@ -1,34 +0,0 @@ -/* - * SPDX-FileCopyrightText: © Hypermode Inc. - * SPDX-License-Identifier: Apache-2.0 - */ - -package api - -type Point struct { - Type string `json:"type,omitempty"` - Coordinates []float64 `json:"coordinates,omitempty"` -} - -type Polygon struct { - Type string `json:"type,omitempty"` - Coordinates [][][]float64 `json:"coordinates,omitempty"` -} - -type MultiPolygon = Polygon - -func NewPolygon(coordinates [][]float64) *Polygon { - polygon := &Polygon{ - Type: "Polygon", - Coordinates: [][][]float64{coordinates}, - } - return polygon -} - -func NewMultiPolygon(coordinates [][][]float64) *MultiPolygon { - multiPolygon := &MultiPolygon{ - Type: "MultiPolygon", - Coordinates: coordinates, - } - return multiPolygon -} diff --git a/api/types_test.go b/api/types_test.go deleted file mode 100644 index 7b199cb..0000000 --- a/api/types_test.go +++ /dev/null @@ -1,51 +0,0 @@ -/* - * SPDX-FileCopyrightText: © Hypermode Inc. - * SPDX-License-Identifier: Apache-2.0 - */ - -package api - -import ( - "testing" - - "github.com/stretchr/testify/require" -) - -func TestNewPolygon(t *testing.T) { - coordinates := [][]float64{ - {-122.083506, 37.4259518}, // Northwest - {-122.081506, 37.4259518}, // Northeast - {-122.081506, 37.4239518}, // Southeast - {-122.083506, 37.4239518}, // Southwest - {-122.083506, 37.4259518}, // Close the polygon - } - - polygon := NewPolygon(coordinates) - require.NotNil(t, polygon) - require.Len(t, polygon.Coordinates, 1) - require.Equal(t, coordinates, polygon.Coordinates[0]) -} - -func TestNewMultiPolygon(t *testing.T) { - coordinates := [][][]float64{ - { - {-122.083506, 37.4259518}, - {-122.081506, 37.4259518}, - {-122.081506, 37.4239518}, - {-122.083506, 37.4239518}, - {-122.083506, 37.4259518}, - }, - { - {-122.073506, 37.4359518}, - {-122.071506, 37.4359518}, - {-122.071506, 37.4339518}, - {-122.073506, 37.4339518}, - {-122.073506, 37.4359518}, - }, - } - - multiPolygon := NewMultiPolygon(coordinates) - require.NotNil(t, multiPolygon) - require.Equal(t, "MultiPolygon", multiPolygon.Type) - require.Equal(t, coordinates, multiPolygon.Coordinates) -} diff --git a/api_mutation_gen.go b/api_mutation_gen.go deleted file mode 100644 index c2cc482..0000000 --- a/api_mutation_gen.go +++ /dev/null @@ -1,152 +0,0 @@ -/* - * SPDX-FileCopyrightText: © Hypermode Inc. - * SPDX-License-Identifier: Apache-2.0 - */ - -package modusgraph - -import ( - "context" - "fmt" - "reflect" - "strings" - - "github.com/dgraph-io/dgo/v250/protos/api" - "github.com/hypermodeinc/dgraph/v25/dql" - "github.com/hypermodeinc/dgraph/v25/protos/pb" - "github.com/hypermodeinc/dgraph/v25/schema" - "github.com/hypermodeinc/dgraph/v25/x" - "github.com/hypermodeinc/modusgraph/api/apiutils" - "github.com/hypermodeinc/modusgraph/api/dgraphtypes" - "github.com/hypermodeinc/modusgraph/api/mutations" - "github.com/hypermodeinc/modusgraph/api/structreflect" -) - -func generateSetDqlMutationsAndSchema[T any](ctx context.Context, n *Namespace, object T, - gid uint64, dms *[]*dql.Mutation, sch *schema.ParsedSchema) error { - t := reflect.TypeOf(object) - if t.Kind() != reflect.Struct { - return fmt.Errorf("expected struct, got %s", t.Kind()) - } - - tagMaps, err := structreflect.GetFieldTags(t) - if err != nil { - return err - } - jsonTagToValue := structreflect.GetJsonTagToValues(object, tagMaps.FieldToJson) - - nquads := make([]*api.NQuad, 0) - uniqueConstraintFound := false - for jsonName, value := range jsonTagToValue { - - reflectValueType := reflect.TypeOf(value) - var nquad *api.NQuad - - if tagMaps.JsonToReverseEdge[jsonName] != "" { - reverseEdgeStr := tagMaps.JsonToReverseEdge[jsonName] - typeName := strings.Split(reverseEdgeStr, ".")[0] - currSchema, err := getSchema(ctx, n) - if err != nil { - return err - } - - typeFound := false - predicateFound := false - for _, t := range currSchema.Types { - if t.Name == typeName { - typeFound = true - for _, f := range t.Fields { - if f.Name == reverseEdgeStr { - predicateFound = true - break - } - } - break - } - } - - if !(typeFound && predicateFound) { - if err := mutations.HandleReverseEdge(jsonName, reflectValueType, n.ID(), sch, - reverseEdgeStr); err != nil { - return err - } - } - continue - } - if jsonName == "gid" { - uniqueConstraintFound = true - continue - } - - value, err = processStructValue(ctx, value, n) - if err != nil { - return err - } - - value, err = processPointerValue(ctx, value, n) - if err != nil { - return err - } - - nquad, u, err := mutations.CreateNQuadAndSchema(value, gid, jsonName, t, n.ID()) - if err != nil { - return err - } - - uniqueConstraintFound, err = dgraphtypes.HandleConstraints(u, tagMaps.JsonToDb, - jsonName, u.ValueType, uniqueConstraintFound) - if err != nil { - return err - } - - sch.Preds = append(sch.Preds, u) - // Handle nil object values - only skip geo types with nil values - if nquad.ObjectValue == nil && (strings.Contains(nquad.Predicate, ".multiArea") || - strings.Contains(nquad.Predicate, ".area") || - strings.Contains(nquad.Predicate, ".loc")) { - continue - } - nquads = append(nquads, nquad) - } - if !uniqueConstraintFound { - return fmt.Errorf(apiutils.NoUniqueConstr, t.Name()) - } - - sch.Types = append(sch.Types, &pb.TypeUpdate{ - TypeName: apiutils.AddNamespace(n.ID(), t.Name()), - Fields: sch.Preds, - }) - - val, err := dgraphtypes.ValueToApiVal(t.Name()) - if err != nil { - return err - } - typeNquad := &api.NQuad{ - Namespace: n.ID(), - Subject: fmt.Sprint(gid), - Predicate: "dgraph.type", - ObjectValue: val, - } - nquads = append(nquads, typeNquad) - - *dms = append(*dms, &dql.Mutation{ - Set: nquads, - }) - - return nil -} - -func generateDeleteDqlMutations(n *Namespace, gid uint64) []*dql.Mutation { - return []*dql.Mutation{{ - Del: []*api.NQuad{ - { - Namespace: n.ID(), - Subject: fmt.Sprint(gid), - Predicate: x.Star, - ObjectValue: &api.Value{ - Val: &api.Value_DefaultVal{DefaultVal: x.Star}, - }, - }, - }, - }} -} diff --git a/api_mutation_helpers.go b/api_mutation_helpers.go deleted file mode 100644 index 1760f18..0000000 --- a/api_mutation_helpers.go +++ /dev/null @@ -1,133 +0,0 @@ -/* - * SPDX-FileCopyrightText: © Hypermode Inc. - * SPDX-License-Identifier: Apache-2.0 - */ - -package modusgraph - -import ( - "context" - "fmt" - "reflect" - - "github.com/hypermodeinc/dgraph/v25/dql" - "github.com/hypermodeinc/dgraph/v25/protos/pb" - "github.com/hypermodeinc/dgraph/v25/query" - "github.com/hypermodeinc/dgraph/v25/schema" - "github.com/hypermodeinc/dgraph/v25/worker" - "github.com/hypermodeinc/modusgraph/api/apiutils" - "github.com/hypermodeinc/modusgraph/api/structreflect" -) - -func processStructValue(ctx context.Context, value any, ns *Namespace) (any, error) { - if !structreflect.IsDgraphType(value) && reflect.TypeOf(value).Kind() == reflect.Struct { - value = reflect.ValueOf(value).Interface() - newGid, err := getUidOrMutate(ctx, ns.engine, ns, value) - if err != nil { - return nil, err - } - return newGid, nil - } - return value, nil -} - -func processPointerValue(ctx context.Context, value any, ns *Namespace) (any, error) { - reflectValueType := reflect.TypeOf(value) - if reflectValueType.Kind() == reflect.Pointer { - reflectValueType = reflectValueType.Elem() - if reflectValueType.Kind() == reflect.Struct { - value = reflect.ValueOf(value).Elem().Interface() - return processStructValue(ctx, value, ns) - } - } - return value, nil -} - -func getUidOrMutate[T any](ctx context.Context, engine *Engine, ns *Namespace, object T) (uint64, error) { - gid, cfKeyValue, err := structreflect.GetUniqueConstraint[T](object) - if err != nil { - return 0, err - } - var cf *ConstrainedField - if cfKeyValue != nil { - cf = &ConstrainedField{Key: cfKeyValue.Key(), Value: cfKeyValue.Value()} - } - - dms := make([]*dql.Mutation, 0) - sch := &schema.ParsedSchema{} - err = generateSetDqlMutationsAndSchema(ctx, ns, object, gid, &dms, sch) - if err != nil { - return 0, err - } - - err = engine.alterSchemaWithParsed(ctx, sch) - if err != nil { - return 0, err - } - if gid != 0 || cf != nil { - gid, err = getExistingObject(ctx, ns, gid, cf, object) - if err != nil && err != apiutils.ErrNoObjFound { - return 0, err - } - if err == nil { - return gid, nil - } - } - - gid, err = engine.z.nextUID() - if err != nil { - return 0, err - } - - dms = make([]*dql.Mutation, 0) - err = generateSetDqlMutationsAndSchema(ctx, ns, object, gid, &dms, sch) - if err != nil { - return 0, err - } - - err = applyDqlMutations(ctx, engine, dms) - if err != nil { - return 0, err - } - - return gid, nil -} - -func applyDqlMutations(ctx context.Context, engine *Engine, dms []*dql.Mutation) error { - edges, err := query.ToDirectedEdges(dms, nil) - if err != nil { - return err - } - - if !engine.isOpen.Load() { - return ErrClosedEngine - } - - startTs, err := engine.z.nextTs() - if err != nil { - return err - } - commitTs, err := engine.z.nextTs() - if err != nil { - return err - } - - m := &pb.Mutations{ - GroupId: 1, - StartTs: startTs, - Edges: edges, - } - m.Edges, err = query.ExpandEdges(ctx, m) - if err != nil { - return fmt.Errorf("error expanding edges: %w", err) - } - - p := &pb.Proposal{Mutations: m, StartTs: startTs} - if err := worker.ApplyMutations(ctx, p); err != nil { - return err - } - - return worker.ApplyCommited(ctx, &pb.OracleDelta{ - Txns: []*pb.TxnStatus{{StartTs: startTs, CommitTs: commitTs}}, - }) -} diff --git a/api_query_execution.go b/api_query_execution.go deleted file mode 100644 index d69be53..0000000 --- a/api_query_execution.go +++ /dev/null @@ -1,210 +0,0 @@ -/* - * SPDX-FileCopyrightText: © Hypermode Inc. - * SPDX-License-Identifier: Apache-2.0 - */ - -package modusgraph - -import ( - "context" - "encoding/json" - "fmt" - "reflect" - - "github.com/hypermodeinc/modusgraph/api/apiutils" - "github.com/hypermodeinc/modusgraph/api/querygen" - "github.com/hypermodeinc/modusgraph/api/structreflect" -) - -func getByGid[T any](ctx context.Context, ns *Namespace, gid uint64) (uint64, T, error) { - return executeGet[T](ctx, ns, gid) -} - -func getByGidWithObject[T any](ctx context.Context, ns *Namespace, gid uint64, obj T) (uint64, T, error) { - return executeGetWithObject[T](ctx, ns, obj, false, gid) -} - -func getByConstrainedField[T any](ctx context.Context, ns *Namespace, cf ConstrainedField) (uint64, T, error) { - return executeGet[T](ctx, ns, cf) -} - -func getByConstrainedFieldWithObject[T any](ctx context.Context, ns *Namespace, - cf ConstrainedField, obj T) (uint64, T, error) { - - return executeGetWithObject[T](ctx, ns, obj, false, cf) -} - -func executeGet[T any, R UniqueField](ctx context.Context, ns *Namespace, args ...R) (uint64, T, error) { - var obj T - if len(args) != 1 { - return 0, obj, fmt.Errorf("expected 1 argument, got %ds", len(args)) - } - - return executeGetWithObject(ctx, ns, obj, true, args...) -} - -func executeGetWithObject[T any, R UniqueField](ctx context.Context, ns *Namespace, - obj T, withReverse bool, args ...R) (uint64, T, error) { - t := reflect.TypeOf(obj) - - tagMaps, err := structreflect.GetFieldTags(t) - if err != nil { - return 0, obj, err - } - readFromQuery := "" - if withReverse { - for jsonTag, reverseEdgeTag := range tagMaps.JsonToReverseEdge { - readFromQuery += fmt.Sprintf(querygen.ReverseEdgeQuery, - apiutils.GetPredicateName(t.Name(), jsonTag), reverseEdgeTag) - } - } - - var cf ConstrainedField - var query string - gid, ok := any(args[0]).(uint64) - if ok { - query = querygen.FormatObjQuery(querygen.BuildUidQuery(gid), readFromQuery) - } else if cf, ok = any(args[0]).(ConstrainedField); ok { - query = querygen.FormatObjQuery(querygen.BuildEqQuery(apiutils.GetPredicateName(t.Name(), - cf.Key), cf.Value), readFromQuery) - } else { - return 0, obj, fmt.Errorf("invalid unique field type") - } - - if tagMaps.JsonToDb[cf.Key] != nil && tagMaps.JsonToDb[cf.Key].Constraint == "" { - return 0, obj, fmt.Errorf("constraint not defined for field %s", cf.Key) - } - - resp, err := ns.engine.queryWithLock(ctx, ns, query, nil) - if err != nil { - return 0, obj, err - } - - dynamicType := structreflect.CreateDynamicStruct(t, tagMaps.FieldToJson, 1) - - dynamicInstance := reflect.New(dynamicType).Interface() - - var result struct { - Obj []any `json:"obj"` - } - - result.Obj = append(result.Obj, dynamicInstance) - - // Unmarshal the JSON response into the dynamic struct - if err := json.Unmarshal(resp.Json, &result); err != nil { - return 0, obj, err - } - - // Check if we have at least one object in the response - if len(result.Obj) == 0 { - return 0, obj, apiutils.ErrNoObjFound - } - - return structreflect.ConvertDynamicToTyped[T](result.Obj[0], t) -} - -func executeQuery[T any](ctx context.Context, ns *Namespace, queryParams QueryParams, - withReverse bool) ([]uint64, []T, error) { - var obj T - t := reflect.TypeOf(obj) - tagMaps, err := structreflect.GetFieldTags(t) - if err != nil { - return nil, nil, err - } - - var filterQueryFunc querygen.QueryFunc = func() string { - return "" - } - var paginationAndSorting string - if queryParams.Filter != nil { - filterQueryFunc = filtersToQueryFunc(t.Name(), *queryParams.Filter) - } - if queryParams.Pagination != nil || queryParams.Sorting != nil { - var pagination, sorting string - if queryParams.Pagination != nil { - pagination = paginationToQueryString(*queryParams.Pagination) - } - if queryParams.Sorting != nil { - sorting = sortingToQueryString(t.Name(), *queryParams.Sorting) - } - paginationAndSorting = fmt.Sprintf("%s %s", pagination, sorting) - } - - readFromQuery := "" - if withReverse { - for jsonTag, reverseEdgeTag := range tagMaps.JsonToReverseEdge { - readFromQuery += fmt.Sprintf(querygen.ReverseEdgeQuery, apiutils.GetPredicateName(t.Name(), jsonTag), reverseEdgeTag) - } - } - - query := querygen.FormatObjsQuery(t.Name(), filterQueryFunc, paginationAndSorting, readFromQuery) - - resp, err := ns.engine.queryWithLock(ctx, ns, query, nil) - if err != nil { - return nil, nil, err - } - - dynamicType := structreflect.CreateDynamicStruct(t, tagMaps.FieldToJson, 1) - - var result struct { - Objs []any `json:"objs"` - } - - var tempMap map[string][]any - if err := json.Unmarshal(resp.Json, &tempMap); err != nil { - return nil, nil, err - } - - // Determine the number of elements - numElements := len(tempMap["objs"]) - - // Append the interface the correct number of times - for i := 0; i < numElements; i++ { - result.Objs = append(result.Objs, reflect.New(dynamicType).Interface()) - } - - // Unmarshal the JSON response into the dynamic struct - if err := json.Unmarshal(resp.Json, &result); err != nil { - return nil, nil, err - } - - gids := make([]uint64, len(result.Objs)) - objs := make([]T, len(result.Objs)) - for i, obj := range result.Objs { - gid, typedObj, err := structreflect.ConvertDynamicToTyped[T](obj, t) - if err != nil { - return nil, nil, err - } - gids[i] = gid - objs[i] = typedObj - } - - return gids, objs, nil -} - -func getExistingObject[T any](ctx context.Context, ns *Namespace, gid uint64, cf *ConstrainedField, - object T) (uint64, error) { - var err error - if gid != 0 { - gid, _, err = getByGidWithObject[T](ctx, ns, gid, object) - } else if cf != nil { - gid, _, err = getByConstrainedFieldWithObject[T](ctx, ns, *cf, object) - } - if err != nil { - return 0, err - } - return gid, nil -} - -func getSchema(ctx context.Context, ns *Namespace) (*querygen.SchemaResponse, error) { - resp, err := ns.engine.queryWithLock(ctx, ns, querygen.SchemaQuery, nil) - if err != nil { - return nil, err - } - - var schema querygen.SchemaResponse - if err := json.Unmarshal(resp.Json, &schema); err != nil { - return nil, err - } - return &schema, nil -} diff --git a/api_types.go b/api_types.go deleted file mode 100644 index ec87a33..0000000 --- a/api_types.go +++ /dev/null @@ -1,205 +0,0 @@ -/* - * SPDX-FileCopyrightText: © Hypermode Inc. - * SPDX-License-Identifier: Apache-2.0 - */ - -package modusgraph - -import ( - "context" - "fmt" - "strings" - - "github.com/hypermodeinc/dgraph/v25/x" - "github.com/hypermodeinc/modusgraph/api/apiutils" - "github.com/hypermodeinc/modusgraph/api/querygen" -) - -type UniqueField interface { - uint64 | ConstrainedField -} -type ConstrainedField struct { - Key string - Value any -} - -type QueryParams struct { - Filter *Filter - Pagination *Pagination - Sorting *Sorting -} - -type Filter struct { - Field string - String StringPredicate - Vector VectorPredicate - And *Filter - Or *Filter - Not *Filter -} - -type Pagination struct { - Limit int64 - Offset int64 - After string -} - -type Sorting struct { - OrderAscField string - OrderDescField string - OrderDescFirst bool -} - -type StringPredicate struct { - Equals string - LessThan string - LessOrEqual string - GreaterThan string - GreaterOrEqual string - AllOfTerms []string - AnyOfTerms []string - AllOfText []string - AnyOfText []string - RegExp string -} - -type VectorPredicate struct { - SimilarTo []float32 - TopK int64 -} - -type ModusDbOption func(*modusDbOptions) - -type modusDbOptions struct { - ns uint64 -} - -func WithNamespaceOLD(ns uint64) ModusDbOption { - return func(o *modusDbOptions) { - o.ns = ns - } -} - -func getDefaultNamespace(ctx context.Context, engine *Engine, nsId ...uint64) (context.Context, *Namespace, error) { - dbOpts := &modusDbOptions{ - ns: engine.db0.ID(), - } - for _, ns := range nsId { - WithNamespaceOLD(ns)(dbOpts) - } - - d, err := engine.getNamespaceWithLock(dbOpts.ns) - if err != nil { - return nil, nil, err - } - - ctx = x.AttachNamespace(ctx, d.ID()) - - return ctx, d, nil -} - -func filterToQueryFunc(typeName string, f Filter) querygen.QueryFunc { - // Handle logical operators first - if f.And != nil { - return querygen.And(filterToQueryFunc(typeName, *f.And)) - } - if f.Or != nil { - return querygen.Or(filterToQueryFunc(typeName, *f.Or)) - } - if f.Not != nil { - return querygen.Not(filterToQueryFunc(typeName, *f.Not)) - } - - // Handle field predicates - if f.String.Equals != "" { - return querygen.BuildEqQuery(apiutils.GetPredicateName(typeName, f.Field), f.String.Equals) - } - if len(f.String.AllOfTerms) != 0 { - return querygen.BuildAllOfTermsQuery(apiutils.GetPredicateName(typeName, - f.Field), strings.Join(f.String.AllOfTerms, " ")) - } - if len(f.String.AnyOfTerms) != 0 { - return querygen.BuildAnyOfTermsQuery(apiutils.GetPredicateName(typeName, - f.Field), strings.Join(f.String.AnyOfTerms, " ")) - } - if len(f.String.AllOfText) != 0 { - return querygen.BuildAllOfTextQuery(apiutils.GetPredicateName(typeName, - f.Field), strings.Join(f.String.AllOfText, " ")) - } - if len(f.String.AnyOfText) != 0 { - return querygen.BuildAnyOfTextQuery(apiutils.GetPredicateName(typeName, - f.Field), strings.Join(f.String.AnyOfText, " ")) - } - if f.String.RegExp != "" { - return querygen.BuildRegExpQuery(apiutils.GetPredicateName(typeName, - f.Field), f.String.RegExp) - } - if f.String.LessThan != "" { - return querygen.BuildLtQuery(apiutils.GetPredicateName(typeName, - f.Field), f.String.LessThan) - } - if f.String.LessOrEqual != "" { - return querygen.BuildLeQuery(apiutils.GetPredicateName(typeName, - f.Field), f.String.LessOrEqual) - } - if f.String.GreaterThan != "" { - return querygen.BuildGtQuery(apiutils.GetPredicateName(typeName, - f.Field), f.String.GreaterThan) - } - if f.String.GreaterOrEqual != "" { - return querygen.BuildGeQuery(apiutils.GetPredicateName(typeName, - f.Field), f.String.GreaterOrEqual) - } - if f.Vector.SimilarTo != nil { - return querygen.BuildSimilarToQuery(apiutils.GetPredicateName(typeName, - f.Field), f.Vector.TopK, f.Vector.SimilarTo) - } - - // Return empty query if no conditions match - return func() string { return "" } -} - -// Helper function to combine multiple filters -func filtersToQueryFunc(typeName string, filter Filter) querygen.QueryFunc { - return filterToQueryFunc(typeName, filter) -} - -func paginationToQueryString(p Pagination) string { - paginationStr := "" - if p.Limit > 0 { - paginationStr += ", " + fmt.Sprintf("first: %d", p.Limit) - } - if p.Offset > 0 { - paginationStr += ", " + fmt.Sprintf("offset: %d", p.Offset) - } else if p.After != "" { - paginationStr += ", " + fmt.Sprintf("after: %s", p.After) - } - if paginationStr == "" { - return "" - } - return paginationStr -} - -func sortingToQueryString(typeName string, s Sorting) string { - if s.OrderAscField == "" && s.OrderDescField == "" { - return "" - } - - var parts []string - first, second := s.OrderDescField, s.OrderAscField - firstOp, secondOp := "orderdesc", "orderasc" - - if !s.OrderDescFirst { - first, second = s.OrderAscField, s.OrderDescField - firstOp, secondOp = "orderasc", "orderdesc" - } - - if first != "" { - parts = append(parts, fmt.Sprintf("%s: %s", firstOp, apiutils.GetPredicateName(typeName, first))) - } - if second != "" { - parts = append(parts, fmt.Sprintf("%s: %s", secondOp, apiutils.GetPredicateName(typeName, second))) - } - - return ", " + strings.Join(parts, ", ") -} From 2b87cee0afdb9751bc31e164c20a09207e9491e3 Mon Sep 17 00:00:00 2001 From: Matthew McNeely Date: Mon, 14 Jul 2025 16:28:22 -0400 Subject: [PATCH 02/20] Remove deprecated tests --- unit_test/api_test.go | 1104 ---------------------------------------- unit_test/conn_test.go | 100 ---- 2 files changed, 1204 deletions(-) delete mode 100644 unit_test/api_test.go delete mode 100644 unit_test/conn_test.go diff --git a/unit_test/api_test.go b/unit_test/api_test.go deleted file mode 100644 index 8cf7cdb..0000000 --- a/unit_test/api_test.go +++ /dev/null @@ -1,1104 +0,0 @@ -/* - * SPDX-FileCopyrightText: © Hypermode Inc. - * SPDX-License-Identifier: Apache-2.0 - */ - -package unit_test - -import ( - "context" - "fmt" - "testing" - "time" - - "github.com/stretchr/testify/require" - - "github.com/hypermodeinc/modusgraph" - "github.com/hypermodeinc/modusgraph/api" - "github.com/hypermodeinc/modusgraph/api/apiutils" -) - -type User struct { - Gid uint64 `json:"gid,omitempty"` - Name string `json:"name,omitempty"` - Age int `json:"age,omitempty"` - ClerkId string `json:"clerk_id,omitempty" db:"constraint=unique"` -} - -func TestFirstTimeUser(t *testing.T) { - engine, err := modusgraph.NewEngine(modusgraph.NewDefaultConfig(t.TempDir())) - require.NoError(t, err) - defer engine.Close() - - gid, user, err := modusgraph.Create(context.Background(), engine, User{ - Name: "A", - Age: 10, - ClerkId: "123", - }) - - require.NoError(t, err) - require.Equal(t, user.Gid, gid) - require.Equal(t, "A", user.Name) - require.Equal(t, 10, user.Age) - require.Equal(t, "123", user.ClerkId) - - gid, queriedUser, err := modusgraph.Get[User](context.Background(), engine, gid) - - require.NoError(t, err) - require.Equal(t, queriedUser.Gid, gid) - require.Equal(t, 10, queriedUser.Age) - require.Equal(t, "A", queriedUser.Name) - require.Equal(t, "123", queriedUser.ClerkId) - - gid, queriedUser2, err := modusgraph.Get[User](context.Background(), engine, modusgraph.ConstrainedField{ - Key: "clerk_id", - Value: "123", - }) - - require.NoError(t, err) - require.Equal(t, queriedUser.Gid, gid) - require.Equal(t, 10, queriedUser2.Age) - require.Equal(t, "A", queriedUser2.Name) - require.Equal(t, "123", queriedUser2.ClerkId) - - _, _, err = modusgraph.Delete[User](context.Background(), engine, gid) - require.NoError(t, err) - - _, queriedUser3, err := modusgraph.Get[User](context.Background(), engine, gid) - require.Error(t, err) - require.Equal(t, "no object found", err.Error()) - require.Equal(t, queriedUser3, User{}) -} - -func TestGetBeforeObjectWrite(t *testing.T) { - ctx := context.Background() - engine, err := modusgraph.NewEngine(modusgraph.NewDefaultConfig(t.TempDir())) - require.NoError(t, err) - defer engine.Close() - ns, err := engine.CreateNamespace() - require.NoError(t, err) - - _, _, err = modusgraph.Get[User](ctx, engine, uint64(1), ns.ID()) - require.Error(t, err) - - _, _, err = modusgraph.Get[User](ctx, engine, modusgraph.ConstrainedField{ - Key: "name", - Value: "test", - }, ns.ID()) - require.Error(t, err) - require.Equal(t, "type not found", err.Error()) -} - -func TestCreateApi(t *testing.T) { - ctx := context.Background() - engine, err := modusgraph.NewEngine(modusgraph.NewDefaultConfig(t.TempDir())) - require.NoError(t, err) - defer engine.Close() - - ns1, err := engine.CreateNamespace() - require.NoError(t, err) - - require.NoError(t, ns1.DropData(ctx)) - - user := User{ - Name: "B", - Age: 20, - ClerkId: "123", - } - - gid, user, err := modusgraph.Create(context.Background(), engine, user, ns1.ID()) - require.NoError(t, err) - - require.Equal(t, "B", user.Name) - require.Equal(t, user.Gid, gid) - - query := `{ - me(func: has(User.name)) { - uid - User.name - User.age - User.clerk_id - } - }` - resp, err := ns1.Query(ctx, query) - require.NoError(t, err) - require.JSONEq(t, `{"me":[{"uid":"0x2","User.name":"B","User.age":20,"User.clerk_id":"123"}]}`, - string(resp.GetJson())) -} - -func TestCreateApiWithNonStruct(t *testing.T) { - ctx := context.Background() - engine, err := modusgraph.NewEngine(modusgraph.NewDefaultConfig(t.TempDir())) - require.NoError(t, err) - defer engine.Close() - - ns1, err := engine.CreateNamespace() - require.NoError(t, err) - - require.NoError(t, ns1.DropData(ctx)) - - user := User{ - Name: "B", - Age: 20, - } - - _, _, err = modusgraph.Create[*User](context.Background(), engine, &user, ns1.ID()) - require.Error(t, err) - require.Equal(t, "expected struct, got ptr", err.Error()) - - _, _, err = modusgraph.Create[[]string](context.Background(), engine, []string{"foo", "bar"}, ns1.ID()) - require.Error(t, err) - require.Equal(t, "expected struct, got slice", err.Error()) - - _, _, err = modusgraph.Create[float32](context.Background(), engine, 3.1415, ns1.ID()) - require.Error(t, err) - require.Equal(t, "expected struct, got float32", err.Error()) -} - -func TestGetApi(t *testing.T) { - ctx := context.Background() - engine, err := modusgraph.NewEngine(modusgraph.NewDefaultConfig(t.TempDir())) - require.NoError(t, err) - defer engine.Close() - - ns1, err := engine.CreateNamespace() - require.NoError(t, err) - - require.NoError(t, ns1.DropData(ctx)) - - user := User{ - Name: "B", - Age: 20, - ClerkId: "123", - } - - gid, _, err := modusgraph.Create(context.Background(), engine, user, ns1.ID()) - require.NoError(t, err) - - gid, queriedUser, err := modusgraph.Get[User](context.Background(), engine, gid, ns1.ID()) - - require.NoError(t, err) - require.Equal(t, queriedUser.Gid, gid) - require.Equal(t, 20, queriedUser.Age) - require.Equal(t, "B", queriedUser.Name) - require.Equal(t, "123", queriedUser.ClerkId) -} - -func TestGetApiWithConstrainedField(t *testing.T) { - ctx := context.Background() - engine, err := modusgraph.NewEngine(modusgraph.NewDefaultConfig(t.TempDir())) - require.NoError(t, err) - defer engine.Close() - - ns1, err := engine.CreateNamespace() - require.NoError(t, err) - - require.NoError(t, ns1.DropData(ctx)) - - user := User{ - Name: "B", - Age: 20, - ClerkId: "123", - } - - _, _, err = modusgraph.Create(context.Background(), engine, user, ns1.ID()) - require.NoError(t, err) - - gid, queriedUser, err := modusgraph.Get[User](context.Background(), engine, modusgraph.ConstrainedField{ - Key: "clerk_id", - Value: "123", - }, ns1.ID()) - - require.NoError(t, err) - require.Equal(t, queriedUser.Gid, gid) - require.Equal(t, 20, queriedUser.Age) - require.Equal(t, "B", queriedUser.Name) - require.Equal(t, "123", queriedUser.ClerkId) -} - -func TestDeleteApi(t *testing.T) { - ctx := context.Background() - engine, err := modusgraph.NewEngine(modusgraph.NewDefaultConfig(t.TempDir())) - require.NoError(t, err) - defer engine.Close() - - ns1, err := engine.CreateNamespace() - require.NoError(t, err) - - require.NoError(t, ns1.DropData(ctx)) - - user := User{ - Name: "B", - Age: 20, - ClerkId: "123", - } - - gid, _, err := modusgraph.Create(context.Background(), engine, user, ns1.ID()) - require.NoError(t, err) - - _, _, err = modusgraph.Delete[User](context.Background(), engine, gid, ns1.ID()) - require.NoError(t, err) - - _, queriedUser, err := modusgraph.Get[User](context.Background(), engine, gid, ns1.ID()) - require.Error(t, err) - require.Equal(t, "no object found", err.Error()) - require.Equal(t, queriedUser, User{}) - - _, queriedUser, err = modusgraph.Get[User](context.Background(), engine, modusgraph.ConstrainedField{ - Key: "clerk_id", - Value: "123", - }, ns1.ID()) - require.Error(t, err) - require.Equal(t, "no object found", err.Error()) - require.Equal(t, queriedUser, User{}) -} - -func TestUpsertApi(t *testing.T) { - ctx := context.Background() - engine, err := modusgraph.NewEngine(modusgraph.NewDefaultConfig(t.TempDir())) - require.NoError(t, err) - defer engine.Close() - - ns1, err := engine.CreateNamespace() - require.NoError(t, err) - - require.NoError(t, ns1.DropData(ctx)) - - user := User{ - Name: "B", - Age: 20, - ClerkId: "123", - } - - gid, user, _, err := modusgraph.Upsert(context.Background(), engine, user, ns1.ID()) - require.NoError(t, err) - require.Equal(t, user.Gid, gid) - - user.Age = 21 - gid, _, _, err = modusgraph.Upsert(context.Background(), engine, user, ns1.ID()) - require.NoError(t, err) - require.Equal(t, user.Gid, gid) - - _, queriedUser, err := modusgraph.Get[User](context.Background(), engine, gid, ns1.ID()) - require.NoError(t, err) - require.Equal(t, user.Gid, queriedUser.Gid) - require.Equal(t, 21, queriedUser.Age) - require.Equal(t, "B", queriedUser.Name) - require.Equal(t, "123", queriedUser.ClerkId) -} - -func TestQueryApi(t *testing.T) { - ctx := context.Background() - engine, err := modusgraph.NewEngine(modusgraph.NewDefaultConfig(t.TempDir())) - require.NoError(t, err) - defer engine.Close() - - ns1, err := engine.CreateNamespace() - require.NoError(t, err) - - require.NoError(t, ns1.DropData(ctx)) - - users := []User{ - {Name: "A", Age: 10, ClerkId: "123"}, - {Name: "B", Age: 20, ClerkId: "123"}, - {Name: "C", Age: 30, ClerkId: "123"}, - {Name: "D", Age: 40, ClerkId: "123"}, - {Name: "E", Age: 50, ClerkId: "123"}, - } - - for _, user := range users { - _, _, err = modusgraph.Create(context.Background(), engine, user, ns1.ID()) - require.NoError(t, err) - } - - gids, queriedUsers, err := modusgraph.Query[User](context.Background(), engine, modusgraph.QueryParams{}, ns1.ID()) - require.NoError(t, err) - require.Len(t, queriedUsers, 5) - require.Len(t, gids, 5) - require.Equal(t, "A", queriedUsers[0].Name) - require.Equal(t, "B", queriedUsers[1].Name) - require.Equal(t, "C", queriedUsers[2].Name) - require.Equal(t, "D", queriedUsers[3].Name) - require.Equal(t, "E", queriedUsers[4].Name) - - gids, queriedUsers, err = modusgraph.Query[User](context.Background(), engine, modusgraph.QueryParams{ - Filter: &modusgraph.Filter{ - Field: "age", - String: modusgraph.StringPredicate{ - // The reason its a string even for int is bc i cant tell if - // user wants to compare with 0 the number or didn't provide a value - // TODO: fix this - GreaterOrEqual: fmt.Sprintf("%d", 20), - }, - }, - }, ns1.ID()) - - require.NoError(t, err) - require.Len(t, queriedUsers, 4) - require.Len(t, gids, 4) - require.Equal(t, "B", queriedUsers[0].Name) - require.Equal(t, "C", queriedUsers[1].Name) - require.Equal(t, "D", queriedUsers[2].Name) - require.Equal(t, "E", queriedUsers[3].Name) -} - -func TestQueryApiWithPaginiationAndSorting(t *testing.T) { - ctx := context.Background() - engine, err := modusgraph.NewEngine(modusgraph.NewDefaultConfig(t.TempDir())) - require.NoError(t, err) - defer engine.Close() - - ns1, err := engine.CreateNamespace() - require.NoError(t, err) - - require.NoError(t, ns1.DropData(ctx)) - - users := []User{ - {Name: "A", Age: 10, ClerkId: "123"}, - {Name: "B", Age: 20, ClerkId: "123"}, - {Name: "C", Age: 30, ClerkId: "123"}, - {Name: "D", Age: 40, ClerkId: "123"}, - {Name: "E", Age: 50, ClerkId: "123"}, - } - - for _, user := range users { - _, _, err = modusgraph.Create(context.Background(), engine, user, ns1.ID()) - require.NoError(t, err) - } - - gids, queriedUsers, err := modusgraph.Query[User](context.Background(), engine, modusgraph.QueryParams{ - Filter: &modusgraph.Filter{ - Field: "age", - String: modusgraph.StringPredicate{ - GreaterOrEqual: fmt.Sprintf("%d", 20), - }, - }, - Pagination: &modusgraph.Pagination{ - Limit: 3, - Offset: 1, - }, - }, ns1.ID()) - - require.NoError(t, err) - require.Len(t, queriedUsers, 3) - require.Len(t, gids, 3) - require.Equal(t, "C", queriedUsers[0].Name) - require.Equal(t, "D", queriedUsers[1].Name) - require.Equal(t, "E", queriedUsers[2].Name) - - gids, queriedUsers, err = modusgraph.Query[User](context.Background(), engine, modusgraph.QueryParams{ - Pagination: &modusgraph.Pagination{ - Limit: 3, - Offset: 1, - }, - Sorting: &modusgraph.Sorting{ - OrderAscField: "age", - }, - }, ns1.ID()) - - require.NoError(t, err) - require.Len(t, queriedUsers, 3) - require.Len(t, gids, 3) - require.Equal(t, "B", queriedUsers[0].Name) - require.Equal(t, "C", queriedUsers[1].Name) - require.Equal(t, "D", queriedUsers[2].Name) -} - -type Project struct { - Gid uint64 `json:"gid,omitempty"` - Name string `json:"name,omitempty"` - ClerkId string `json:"clerk_id,omitempty" db:"constraint=unique"` - Branches []Branch `json:"branches,omitempty" readFrom:"type=Branch,field=proj"` -} - -type Branch struct { - Gid uint64 `json:"gid,omitempty"` - Name string `json:"name,omitempty"` - ClerkId string `json:"clerk_id,omitempty" db:"constraint=unique"` - Proj Project `json:"proj,omitempty"` -} - -func TestReverseEdgeGet(t *testing.T) { - ctx := context.Background() - engine, err := modusgraph.NewEngine(modusgraph.NewDefaultConfig(t.TempDir())) - require.NoError(t, err) - defer engine.Close() - - ns1, err := engine.CreateNamespace() - require.NoError(t, err) - - require.NoError(t, ns1.DropData(ctx)) - - projGid, project, err := modusgraph.Create(context.Background(), engine, Project{ - Name: "P", - ClerkId: "456", - Branches: []Branch{ - {Name: "B", ClerkId: "123"}, - {Name: "B2", ClerkId: "456"}, - }, - }, ns1.ID()) - require.NoError(t, err) - - require.Equal(t, "P", project.Name) - require.Equal(t, project.Gid, projGid) - - // modifying a read-only field will be a no-op - require.Len(t, project.Branches, 0) - - branch1 := Branch{ - Name: "B", - ClerkId: "123", - Proj: Project{ - Gid: projGid, - }, - } - - branch1Gid, branch1, err := modusgraph.Create(context.Background(), engine, branch1, ns1.ID()) - require.NoError(t, err) - - require.Equal(t, "B", branch1.Name) - require.Equal(t, branch1.Gid, branch1Gid) - require.Equal(t, projGid, branch1.Proj.Gid) - require.Equal(t, "P", branch1.Proj.Name) - - branch2 := Branch{ - Name: "B2", - ClerkId: "456", - Proj: Project{ - Gid: projGid, - }, - } - - branch2Gid, branch2, err := modusgraph.Create(context.Background(), engine, branch2, ns1.ID()) - require.NoError(t, err) - require.Equal(t, "B2", branch2.Name) - require.Equal(t, branch2.Gid, branch2Gid) - require.Equal(t, projGid, branch2.Proj.Gid) - - getProjGid, queriedProject, err := modusgraph.Get[Project](context.Background(), engine, projGid, ns1.ID()) - require.NoError(t, err) - require.Equal(t, projGid, getProjGid) - require.Equal(t, "P", queriedProject.Name) - require.Len(t, queriedProject.Branches, 2) - require.Equal(t, "B", queriedProject.Branches[0].Name) - require.Equal(t, "B2", queriedProject.Branches[1].Name) - - queryBranchesGids, queriedBranches, err := modusgraph.Query[Branch](context.Background(), engine, - modusgraph.QueryParams{}, ns1.ID()) - require.NoError(t, err) - require.Len(t, queriedBranches, 2) - require.Len(t, queryBranchesGids, 2) - require.Equal(t, "B", queriedBranches[0].Name) - require.Equal(t, "B2", queriedBranches[1].Name) - - // max depth is 2, so we should not see the branches within project - require.Len(t, queriedBranches[0].Proj.Branches, 0) - - _, _, err = modusgraph.Delete[Project](context.Background(), engine, projGid, ns1.ID()) - require.NoError(t, err) - - queryBranchesGids, queriedBranches, err = modusgraph.Query[Branch](context.Background(), engine, - modusgraph.QueryParams{}, ns1.ID()) - require.NoError(t, err) - require.Len(t, queriedBranches, 2) - require.Len(t, queryBranchesGids, 2) - require.Equal(t, "B", queriedBranches[0].Name) - require.Equal(t, "B2", queriedBranches[1].Name) -} - -func TestReverseEdgeQuery(t *testing.T) { - ctx := context.Background() - engine, err := modusgraph.NewEngine(modusgraph.NewDefaultConfig(t.TempDir())) - require.NoError(t, err) - defer engine.Close() - - ns1, err := engine.CreateNamespace() - require.NoError(t, err) - - require.NoError(t, ns1.DropData(ctx)) - - projects := []Project{ - {Name: "P1", ClerkId: "456"}, - {Name: "P2", ClerkId: "789"}, - } - - branchCounter := 1 - clerkCounter := 100 - - for _, project := range projects { - projGid, project, err := modusgraph.Create(context.Background(), engine, project, ns1.ID()) - require.NoError(t, err) - require.Equal(t, project.Name, project.Name) - require.Equal(t, project.Gid, projGid) - - branches := []Branch{ - {Name: fmt.Sprintf("B%d", branchCounter), ClerkId: fmt.Sprintf("%d", clerkCounter), Proj: Project{Gid: projGid}}, - {Name: fmt.Sprintf("B%d", branchCounter+1), ClerkId: fmt.Sprintf("%d", clerkCounter+1), Proj: Project{Gid: projGid}}, - } - branchCounter += 2 - clerkCounter += 2 - - for _, branch := range branches { - branchGid, branch, err := modusgraph.Create(context.Background(), engine, branch, ns1.ID()) - require.NoError(t, err) - require.Equal(t, branch.Name, branch.Name) - require.Equal(t, branch.Gid, branchGid) - require.Equal(t, projGid, branch.Proj.Gid) - } - } - - queriedProjectsGids, queriedProjects, err := modusgraph.Query[Project](context.Background(), - engine, modusgraph.QueryParams{}, ns1.ID()) - require.NoError(t, err) - require.Len(t, queriedProjects, 2) - require.Len(t, queriedProjectsGids, 2) - require.Equal(t, "P1", queriedProjects[0].Name) - require.Equal(t, "P2", queriedProjects[1].Name) - require.Len(t, queriedProjects[0].Branches, 2) - require.Len(t, queriedProjects[1].Branches, 2) - require.Equal(t, "B1", queriedProjects[0].Branches[0].Name) - require.Equal(t, "B2", queriedProjects[0].Branches[1].Name) - require.Equal(t, "B3", queriedProjects[1].Branches[0].Name) - require.Equal(t, "B4", queriedProjects[1].Branches[1].Name) -} - -func TestNestedObjectMutation(t *testing.T) { - ctx := context.Background() - engine, err := modusgraph.NewEngine(modusgraph.NewDefaultConfig(t.TempDir())) - require.NoError(t, err) - defer engine.Close() - - ns1, err := engine.CreateNamespace() - require.NoError(t, err) - - require.NoError(t, ns1.DropData(ctx)) - - branch := Branch{ - Name: "B", - ClerkId: "123", - Proj: Project{ - Name: "P", - ClerkId: "456", - }, - } - - gid, branch, err := modusgraph.Create(context.Background(), engine, branch, ns1.ID()) - require.NoError(t, err) - - require.Equal(t, "B", branch.Name) - require.Equal(t, branch.Gid, gid) - require.NotEqual(t, uint64(0), branch.Proj.Gid) - require.Equal(t, "P", branch.Proj.Name) - - query := `{ - me(func: has(Branch.name)) { - uid - Branch.name - Branch.clerk_id - Branch.proj { - uid - Project.name - Project.clerk_id - } - } - }` - resp, err := ns1.Query(ctx, query) - require.NoError(t, err) - require.JSONEq(t, - `{"me":[{"uid":"0x2","Branch.name":"B","Branch.clerk_id":"123","Branch.proj": - {"uid":"0x3","Project.name":"P","Project.clerk_id":"456"}}]}`, - string(resp.GetJson())) - - gid, queriedBranch, err := modusgraph.Get[Branch](context.Background(), engine, gid, ns1.ID()) - require.NoError(t, err) - require.Equal(t, queriedBranch.Gid, gid) - require.Equal(t, "B", queriedBranch.Name) - -} - -func TestLinkingObjectsByConstrainedFields(t *testing.T) { - ctx := context.Background() - engine, err := modusgraph.NewEngine(modusgraph.NewDefaultConfig(t.TempDir())) - require.NoError(t, err) - defer engine.Close() - - ns1, err := engine.CreateNamespace() - require.NoError(t, err) - - require.NoError(t, ns1.DropData(ctx)) - - projGid, project, err := modusgraph.Create(context.Background(), engine, Project{ - Name: "P", - ClerkId: "456", - }, ns1.ID()) - require.NoError(t, err) - - require.Equal(t, "P", project.Name) - require.Equal(t, project.Gid, projGid) - - branch := Branch{ - Name: "B", - ClerkId: "123", - Proj: Project{ - Name: "P", - ClerkId: "456", - }, - } - - gid, branch, err := modusgraph.Create(context.Background(), engine, branch, ns1.ID()) - require.NoError(t, err) - - require.Equal(t, "B", branch.Name) - require.Equal(t, branch.Gid, gid) - require.Equal(t, projGid, branch.Proj.Gid) - require.Equal(t, "P", branch.Proj.Name) - - query := `{ - me(func: has(Branch.name)) { - uid - Branch.name - Branch.clerk_id - Branch.proj { - uid - Project.name - Project.clerk_id - } - } - }` - resp, err := ns1.Query(ctx, query) - require.NoError(t, err) - require.JSONEq(t, - `{"me":[{"uid":"0x3","Branch.name":"B","Branch.clerk_id":"123","Branch.proj": - {"uid":"0x2","Project.name":"P","Project.clerk_id":"456"}}]}`, - string(resp.GetJson())) - - gid, queriedBranch, err := modusgraph.Get[Branch](context.Background(), engine, gid, ns1.ID()) - require.NoError(t, err) - require.Equal(t, queriedBranch.Gid, gid) - require.Equal(t, "B", queriedBranch.Name) - -} - -func TestLinkingObjectsByGid(t *testing.T) { - ctx := context.Background() - engine, err := modusgraph.NewEngine(modusgraph.NewDefaultConfig(t.TempDir())) - require.NoError(t, err) - defer engine.Close() - - ns1, err := engine.CreateNamespace() - require.NoError(t, err) - - require.NoError(t, ns1.DropData(ctx)) - - projGid, project, err := modusgraph.Create(context.Background(), engine, Project{ - Name: "P", - ClerkId: "456", - }, ns1.ID()) - require.NoError(t, err) - - require.Equal(t, "P", project.Name) - require.Equal(t, project.Gid, projGid) - - branch := Branch{ - Name: "B", - ClerkId: "123", - Proj: Project{ - Gid: projGid, - }, - } - - gid, branch, err := modusgraph.Create(context.Background(), engine, branch, ns1.ID()) - require.NoError(t, err) - - require.Equal(t, "B", branch.Name) - require.Equal(t, branch.Gid, gid) - require.Equal(t, projGid, branch.Proj.Gid) - require.Equal(t, "P", branch.Proj.Name) - - query := `{ - me(func: has(Branch.name)) { - uid - Branch.name - Branch.clerk_id - Branch.proj { - uid - Project.name - Project.clerk_id - } - } - }` - resp, err := ns1.Query(ctx, query) - require.NoError(t, err) - require.JSONEq(t, - `{"me":[{"uid":"0x3","Branch.name":"B","Branch.clerk_id":"123", - "Branch.proj":{"uid":"0x2","Project.name":"P","Project.clerk_id":"456"}}]}`, - string(resp.GetJson())) - - gid, queriedBranch, err := modusgraph.Get[Branch](context.Background(), engine, gid, ns1.ID()) - require.NoError(t, err) - require.Equal(t, queriedBranch.Gid, gid) - require.Equal(t, "B", queriedBranch.Name) - -} - -type BadProject struct { - Name string `json:"name,omitempty"` - ClerkId string `json:"clerk_id,omitempty"` -} - -type BadBranch struct { - Gid uint64 `json:"gid,omitempty"` - Name string `json:"name,omitempty"` - ClerkId string `json:"clerk_id,omitempty" db:"constraint=unique"` - Proj BadProject `json:"proj,omitempty"` -} - -func TestNestedObjectMutationWithBadType(t *testing.T) { - ctx := context.Background() - engine, err := modusgraph.NewEngine(modusgraph.NewDefaultConfig(t.TempDir())) - require.NoError(t, err) - defer engine.Close() - - ns1, err := engine.CreateNamespace() - require.NoError(t, err) - - require.NoError(t, ns1.DropData(ctx)) - - branch := BadBranch{ - Name: "B", - ClerkId: "123", - Proj: BadProject{ - Name: "P", - ClerkId: "456", - }, - } - - _, _, err = modusgraph.Create(context.Background(), engine, branch, ns1.ID()) - require.Error(t, err) - require.Equal(t, fmt.Sprintf(apiutils.NoUniqueConstr, "BadProject"), err.Error()) - - proj := BadProject{ - Name: "P", - ClerkId: "456", - } - - _, _, err = modusgraph.Create(context.Background(), engine, proj, ns1.ID()) - require.Error(t, err) - require.Equal(t, fmt.Sprintf(apiutils.NoUniqueConstr, "BadProject"), err.Error()) - -} - -type Document struct { - Gid uint64 `json:"gid,omitempty"` - Text string `json:"text,omitempty"` - TextVec []float32 `json:"textVec,omitempty" db:"constraint=vector"` -} - -func TestVectorIndexSearchTyped(t *testing.T) { - ctx := context.Background() - engine, err := modusgraph.NewEngine(modusgraph.NewDefaultConfig(t.TempDir())) - require.NoError(t, err) - defer engine.Close() - - ns1, err := engine.CreateNamespace() - require.NoError(t, err) - - require.NoError(t, ns1.DropData(ctx)) - - documents := []Document{ - {Text: "apple", TextVec: []float32{0.1, 0.1, 0.0}}, - {Text: "banana", TextVec: []float32{0.0, 1.0, 0.0}}, - {Text: "carrot", TextVec: []float32{0.0, 0.0, 1.0}}, - {Text: "dog", TextVec: []float32{1.0, 1.0, 0.0}}, - {Text: "elephant", TextVec: []float32{0.0, 1.0, 1.0}}, - {Text: "fox", TextVec: []float32{1.0, 0.0, 1.0}}, - {Text: "gorilla", TextVec: []float32{1.0, 1.0, 1.0}}, - } - - for _, doc := range documents { - _, _, err = modusgraph.Create(context.Background(), engine, doc, ns1.ID()) - require.NoError(t, err) - } - - const query = ` - { - documents(func: similar_to(Document.textVec, 5, "[0.1,0.1,0.1]")) { - Document.text - } - }` - - resp, err := ns1.Query(ctx, query) - require.NoError(t, err) - require.JSONEq(t, `{ - "documents":[ - {"Document.text":"apple"}, - {"Document.text":"dog"}, - {"Document.text":"elephant"}, - {"Document.text":"fox"}, - {"Document.text":"gorilla"} - ] - }`, string(resp.GetJson())) - - const query2 = ` - { - documents(func: type("Document")) @filter(similar_to(Document.textVec, 5, "[0.1,0.1,0.1]")) { - Document.text - } - }` - - resp, err = ns1.Query(ctx, query2) - require.NoError(t, err) - require.JSONEq(t, `{ - "documents":[ - {"Document.text":"apple"}, - {"Document.text":"dog"}, - {"Document.text":"elephant"}, - {"Document.text":"fox"}, - {"Document.text":"gorilla"} - ] - }`, string(resp.GetJson())) -} - -func TestVectorIndexSearchWithQuery(t *testing.T) { - ctx := context.Background() - engine, err := modusgraph.NewEngine(modusgraph.NewDefaultConfig(t.TempDir())) - require.NoError(t, err) - defer engine.Close() - - ns1, err := engine.CreateNamespace() - require.NoError(t, err) - - require.NoError(t, ns1.DropData(ctx)) - - documents := []Document{ - {Text: "apple", TextVec: []float32{0.1, 0.1, 0.0}}, - {Text: "banana", TextVec: []float32{0.0, 1.0, 0.0}}, - {Text: "carrot", TextVec: []float32{0.0, 0.0, 1.0}}, - {Text: "dog", TextVec: []float32{1.0, 1.0, 0.0}}, - {Text: "elephant", TextVec: []float32{0.0, 1.0, 1.0}}, - {Text: "fox", TextVec: []float32{1.0, 0.0, 1.0}}, - {Text: "gorilla", TextVec: []float32{1.0, 1.0, 1.0}}, - } - - for _, doc := range documents { - _, _, err = modusgraph.Create(context.Background(), engine, doc, ns1.ID()) - require.NoError(t, err) - } - - gids, docs, err := modusgraph.Query[Document](context.Background(), engine, modusgraph.QueryParams{ - Filter: &modusgraph.Filter{ - Field: "textVec", - Vector: modusgraph.VectorPredicate{ - SimilarTo: []float32{0.1, 0.1, 0.1}, - TopK: 5, - }, - }, - }, ns1.ID()) - - require.NoError(t, err) - require.Len(t, docs, 5) - require.Len(t, gids, 5) - require.Equal(t, "apple", docs[0].Text) - require.Equal(t, "dog", docs[1].Text) - require.Equal(t, "elephant", docs[2].Text) - require.Equal(t, "fox", docs[3].Text) - require.Equal(t, "gorilla", docs[4].Text) -} - -type Alltypes struct { - Gid uint64 `json:"gid,omitempty"` - Name string `json:"name,omitempty"` - Age int `json:"age,omitempty"` - Count int64 `json:"count,omitempty"` - Married bool `json:"married,omitempty"` - FloatVal float32 `json:"floatVal,omitempty"` - Float64Val float64 `json:"float64Val,omitempty"` - //Loc geom.Point `json:"loc,omitempty"` - DoB time.Time `json:"dob,omitempty"` -} - -func TestAllSchemaTypes(t *testing.T) { - ctx := context.Background() - engine, err := modusgraph.NewEngine(modusgraph.NewDefaultConfig(t.TempDir())) - require.NoError(t, err) - defer engine.Close() - - require.NoError(t, engine.DropAll(ctx)) - - //loc := geom.NewPoint(geom.XY).MustSetCoords(geom.Coord{-122.082506, 37.4249518}) - dob := time.Date(1965, 6, 24, 0, 0, 0, 0, time.UTC) - _, omnibus, err := modusgraph.Create(context.Background(), engine, Alltypes{ - Name: "John Doe", - Age: 30, - Count: 100, - Married: true, - FloatVal: 3.14159, - Float64Val: 123.456789, - //Loc: *loc, - DoB: dob, - }) - - require.NoError(t, err) - require.NotZero(t, omnibus.Gid) - require.Equal(t, "John Doe", omnibus.Name) - require.Equal(t, 30, omnibus.Age) - require.Equal(t, true, omnibus.Married) - require.Equal(t, int64(100), omnibus.Count) - require.Equal(t, float32(3.14159), omnibus.FloatVal) - require.InDelta(t, 123.456789, omnibus.Float64Val, 0.000001) - //require.Equal(t, loc, omnibus.Loc) - require.Equal(t, dob, omnibus.DoB) -} - -type TimeStruct struct { - Name string `json:"name,omitempty" db:"constraint=unique"` - Time time.Time `json:"time,omitempty"` - TimePtr *time.Time `json:"timePtr,omitempty"` -} - -func TestTime(t *testing.T) { - ctx := context.Background() - engine, err := modusgraph.NewEngine(modusgraph.NewDefaultConfig(t.TempDir())) - require.NoError(t, err) - defer engine.Close() - - d := time.Date(1965, 6, 24, 12, 0, 0, 0, time.UTC) - gid, justTime, err := modusgraph.Create(ctx, engine, TimeStruct{ - Name: "John Doe", - Time: d, - TimePtr: &d, - }) - require.NoError(t, err) - - require.Equal(t, "John Doe", justTime.Name) - require.Equal(t, d, justTime.Time) - require.Equal(t, d, *justTime.TimePtr) - - _, justTime, err = modusgraph.Get[TimeStruct](ctx, engine, gid) - require.NoError(t, err) - require.Equal(t, "John Doe", justTime.Name) - require.Equal(t, d, justTime.Time) - require.Equal(t, d, *justTime.TimePtr) - - // Add another time entry - d2 := time.Date(1965, 6, 24, 11, 59, 59, 0, time.UTC) - _, _, err = modusgraph.Create(ctx, engine, TimeStruct{ - Name: "Jane Doe", - Time: d2, - TimePtr: &d2, - }) - require.NoError(t, err) - - _, entries, err := modusgraph.Query[TimeStruct](ctx, engine, modusgraph.QueryParams{ - Filter: &modusgraph.Filter{ - Field: "time", - String: modusgraph.StringPredicate{ - // TODO: Not too crazy about this. Thinking we should add XXXPredicate definitions for all scalars -MM - GreaterOrEqual: fmt.Sprintf("\"%s\"", d.Format(time.RFC3339)), - }, - }, - }) - require.NoError(t, err) - require.Len(t, entries, 1) - require.Equal(t, "John Doe", entries[0].Name) - require.Equal(t, d, entries[0].Time) - require.Equal(t, d, *entries[0].TimePtr) -} - -type GeomStruct struct { - Gid uint64 `json:"gid,omitempty"` - Name string `json:"name,omitempty" db:"constraint=unique"` - Point api.Point `json:"loc,omitempty"` - Area api.Polygon `json:"area,omitempty"` - MultiArea api.MultiPolygon `json:"multiArea,omitempty"` -} - -func TestPoint(t *testing.T) { - ctx := context.Background() - engine, err := modusgraph.NewEngine(modusgraph.NewDefaultConfig(t.TempDir())) - require.NoError(t, err) - defer engine.Close() - - loc := api.Point{ - Coordinates: []float64{-122.082506, 37.4249518}, - } - gid, geomStruct, err := modusgraph.Create(ctx, engine, GeomStruct{ - Name: "John Doe", - Point: loc, - }) - require.NoError(t, err) - require.Equal(t, "John Doe", geomStruct.Name) - require.Equal(t, loc.Coordinates, geomStruct.Point.Coordinates) - - _, geomStruct, err = modusgraph.Get[GeomStruct](ctx, engine, gid) - require.NoError(t, err) - require.Equal(t, "John Doe", geomStruct.Name) - require.Equal(t, loc.Coordinates, geomStruct.Point.Coordinates) - - query := ` - { - geomStruct(func: type(GeomStruct)) { - GeomStruct.name - } - }` - resp, err := engine.GetDefaultNamespace().Query(ctx, query) - require.NoError(t, err) - require.JSONEq(t, `{ - "geomStruct":[ - {"GeomStruct.name":"John Doe"} - ] - }`, string(resp.GetJson())) -} - -func TestPolygon(t *testing.T) { - ctx := context.Background() - engine, err := modusgraph.NewEngine(modusgraph.NewDefaultConfig(t.TempDir())) - require.NoError(t, err) - defer engine.Close() - - polygon := api.NewPolygon([][]float64{ - {-122.083506, 37.4259518}, // Northwest - {-122.081506, 37.4259518}, // Northeast - {-122.081506, 37.4239518}, // Southeast - {-122.083506, 37.4239518}, // Southwest - {-122.083506, 37.4259518}, // Close the polygon by repeating first point - }) - _, geomStruct, err := modusgraph.Create(ctx, engine, GeomStruct{ - Name: "Jane Doe", - Area: *polygon, - }) - require.NoError(t, err) - require.Equal(t, "Jane Doe", geomStruct.Name) - require.Equal(t, polygon.Coordinates, geomStruct.Area.Coordinates) -} - -func TestMultiPolygon(t *testing.T) { - ctx := context.Background() - engine, err := modusgraph.NewEngine(modusgraph.NewDefaultConfig(t.TempDir())) - require.NoError(t, err) - defer engine.Close() - - multiPolygon := api.NewMultiPolygon([][][]float64{ - { - {-122.083506, 37.4259518}, // Northwest - {-122.081506, 37.4259518}, // Northeast - {-122.081506, 37.4239518}, // Southeast - {-122.083506, 37.4239518}, // Southwest - {-122.083506, 37.4259518}, // Close the polygon by repeating first point - }, - { - {-122.073506, 37.4359518}, // Northwest - {-122.071506, 37.4359518}, // Northeast - {-122.071506, 37.4339518}, // Southeast - {-122.073506, 37.4339518}, // Southwest - {-122.073506, 37.4359518}, // Close the polygon by repeating first point - }, - }) - _, geomStruct, err := modusgraph.Create(ctx, engine, GeomStruct{ - Name: "Jane Doe", - MultiArea: *multiPolygon, - }) - require.NoError(t, err) - require.Equal(t, "Jane Doe", geomStruct.Name) - require.Equal(t, multiPolygon.Coordinates, geomStruct.MultiArea.Coordinates) -} diff --git a/unit_test/conn_test.go b/unit_test/conn_test.go deleted file mode 100644 index dd17825..0000000 --- a/unit_test/conn_test.go +++ /dev/null @@ -1,100 +0,0 @@ -/* - * SPDX-FileCopyrightText: © Hypermode Inc. - * SPDX-License-Identifier: Apache-2.0 - */ - -package unit_test - -import ( - "context" - "testing" - - "github.com/dgraph-io/dgo/v250/protos/api" - "github.com/hypermodeinc/modusgraph" - "github.com/stretchr/testify/require" -) - -func TestRDF(t *testing.T) { - // Create a new engine - this initializes all the necessary components - engine, err := modusgraph.NewEngine(modusgraph.NewDefaultConfig(t.TempDir())) - require.NoError(t, err) - defer engine.Close() - - client, err := engine.GetClient() - require.NoError(t, err) - defer client.Close() - - ctx := context.Background() - - // Test a simple operation - txn := client.NewReadOnlyTxn() - resp, err := txn.Query(ctx, "schema {}") - require.NoError(t, err) - require.NotEmpty(t, resp.Json) - _ = txn.Discard(ctx) - - txn = client.NewTxn() - // Additional test: Try a mutation in a transaction - mu := &api.Mutation{ - SetNquads: []byte(`_:person "Test Person" .`), - //CommitNow: true, - } - _, err = txn.Mutate(ctx, mu) - require.NoError(t, err) - // Commit the transaction - err = txn.Commit(ctx) - require.NoError(t, err) - _ = txn.Discard(ctx) - - // Create a new transaction for the follow-up query since the previous one was committed - txn = client.NewTxn() - // Query to verify the mutation worked - resp, err = txn.Query(ctx, `{ q(func: has(n)) { n } }`) - require.NoError(t, err) - require.NotEmpty(t, resp.Json) - _ = txn.Discard(ctx) - - err = client.Alter(context.Background(), &api.Operation{DropAll: true}) - if err != nil { - t.Error(err) - } -} - -// TestMultipleDgraphClients tests multiple clients connecting to the same bufconn server -func TestMultipleDgraphClients(t *testing.T) { - // Create a new engine - this initializes all the necessary components - engine, err := modusgraph.NewEngine(modusgraph.NewDefaultConfig(t.TempDir())) - require.NoError(t, err) - defer engine.Close() - - // Create a context - ctx := context.Background() - - // Create multiple clients - client1, err := engine.GetClient() - require.NoError(t, err) - defer client1.Close() - - client2, err := engine.GetClient() - require.NoError(t, err) - defer client2.Close() - - // Test that both clients can execute operations - txn1 := client1.NewTxn() - defer func() { - err := txn1.Discard(ctx) - require.NoError(t, err) - }() - - txn2 := client2.NewTxn() - defer func() { - err := txn2.Discard(ctx) - require.NoError(t, err) - }() - - _, err = txn1.Query(ctx, "schema {}") - require.NoError(t, err) - - _, err = txn2.Query(ctx, "schema {}") - require.NoError(t, err) -} From 9c88e041467be88a53bfe79d5a31ccda840e6d77 Mon Sep 17 00:00:00 2001 From: Matthew McNeely Date: Mon, 14 Jul 2025 16:28:57 -0400 Subject: [PATCH 03/20] Relocate unit tests to top-level --- unit_test/engine_test.go => engine_test.go | 2 +- unit_test/namespace_test.go => namespace_test.go | 4 ++-- unit_test/vector_test.go => vector_test.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) rename unit_test/engine_test.go => engine_test.go (99%) rename unit_test/namespace_test.go => namespace_test.go (99%) rename unit_test/vector_test.go => vector_test.go (99%) diff --git a/unit_test/engine_test.go b/engine_test.go similarity index 99% rename from unit_test/engine_test.go rename to engine_test.go index 481229f..cba6ee8 100644 --- a/unit_test/engine_test.go +++ b/engine_test.go @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -package unit_test +package modusgraph_test import ( "bytes" diff --git a/unit_test/namespace_test.go b/namespace_test.go similarity index 99% rename from unit_test/namespace_test.go rename to namespace_test.go index 55d9e12..c93486d 100644 --- a/unit_test/namespace_test.go +++ b/namespace_test.go @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -package unit_test +package modusgraph_test import ( "context" @@ -49,7 +49,7 @@ func TestNonGalaxyDB(t *testing.T) { } -func TestDropData(t *testing.T) { +func TestDropDataNamespace(t *testing.T) { engine, err := modusgraph.NewEngine(modusgraph.NewDefaultConfig(t.TempDir())) require.NoError(t, err) defer engine.Close() diff --git a/unit_test/vector_test.go b/vector_test.go similarity index 99% rename from unit_test/vector_test.go rename to vector_test.go index 871c270..aecccfd 100644 --- a/unit_test/vector_test.go +++ b/vector_test.go @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -package unit_test +package modusgraph_test import ( "context" From 01948ee02f02f2fe260e32954e17f70bc73b53bc Mon Sep 17 00:00:00 2001 From: Matthew McNeely Date: Mon, 14 Jul 2025 16:29:35 -0400 Subject: [PATCH 04/20] Remove reference to deprecated tests --- .github/workflows/ci-go-unit-tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-go-unit-tests.yaml b/.github/workflows/ci-go-unit-tests.yaml index 9154212..2100ff0 100644 --- a/.github/workflows/ci-go-unit-tests.yaml +++ b/.github/workflows/ci-go-unit-tests.yaml @@ -38,4 +38,4 @@ jobs: cache-dependency-path: go.sum - name: Run Unit Tests - run: go test -race -v . ./unit_test/... + run: go test -race -v . From 486697839dabe3cbe01c5ecb3afd7b1e7e022f30 Mon Sep 17 00:00:00 2001 From: Matthew McNeely Date: Mon, 14 Jul 2025 16:30:03 -0400 Subject: [PATCH 05/20] Update test with zero size buffer --- load_test/live_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/load_test/live_test.go b/load_test/live_test.go index a513c63..1b7f596 100644 --- a/load_test/live_test.go +++ b/load_test/live_test.go @@ -89,7 +89,7 @@ func TestLiveLoaderSmall(t *testing.T) { func TestLiveLoader1Million(t *testing.T) { stdLogger := log.New(os.Stdout, "", log.LstdFlags) logger := stdr.NewWithOptions(stdLogger, stdr.Options{LogCaller: stdr.All}).WithName("mg") - conf := modusgraph.NewDefaultConfig(t.TempDir()).WithLogger(logger) + conf := modusgraph.NewDefaultConfig(t.TempDir()).WithLogger(logger).WithCacheSizeMB(0) engine, err := modusgraph.NewEngine(conf) require.NoError(t, err) defer engine.Close() From 56981f3c8c9aa6f16032aecc2db2edfe1331626e Mon Sep 17 00:00:00 2001 From: Matthew McNeely Date: Mon, 14 Jul 2025 16:30:31 -0400 Subject: [PATCH 06/20] Update version string --- buf_server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buf_server.go b/buf_server.go index 9f666a5..bc5bbf1 100644 --- a/buf_server.go +++ b/buf_server.go @@ -178,7 +178,7 @@ func (s *serverWrapper) Alter(ctx context.Context, op *api.Operation) (*api.Payl func (s *serverWrapper) CheckVersion(ctx context.Context, check *api.Check) (*api.Version, error) { // Return a version that matches what the client expects (TODO) return &api.Version{ - Tag: "v24.0.0", // Must match major version expected by client + Tag: "v25.0.0", // Must match major version expected by client }, nil } From 962a3d346b0e08efc1f60f109d2e974038cda404 Mon Sep 17 00:00:00 2001 From: Matthew McNeely Date: Mon, 14 Jul 2025 16:30:59 -0400 Subject: [PATCH 07/20] Clarify log tag meanings --- live.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/live.go b/live.go index d03f0b2..f17fce5 100644 --- a/live.go +++ b/live.go @@ -82,8 +82,8 @@ func (n *Namespace) LoadData(inCtx context.Context, dataDir string) error { elapsed := time.Since(start).Round(time.Second) rate := float64(nqudsProcessed-last) / progressFrequency.Seconds() n.engine.logger.Info("Data loading progress", "elapsed", x.FixedDuration(elapsed), - "quads", nqudsProcessed, - "rate", fmt.Sprintf("%5.0f", rate)) + "nquadsProcessed", nqudsProcessed, + "writesPerSecond", fmt.Sprintf("%5.0f", rate)) last = nqudsProcessed case nqs, ok := <-nqch: From d0f6691519a463c30c26601be3d79992246ba07d Mon Sep 17 00:00:00 2001 From: Matthew McNeely Date: Mon, 14 Jul 2025 16:31:38 -0400 Subject: [PATCH 08/20] Remove unused func --- zero.go | 8 -------- 1 file changed, 8 deletions(-) diff --git a/zero.go b/zero.go index 59e1412..d954402 100644 --- a/zero.go +++ b/zero.go @@ -96,14 +96,6 @@ func (z *zero) readTs() uint64 { return z.minLeasedTs - 1 } -func (z *zero) nextUID() (uint64, error) { - uids, err := z.nextUIDs(&pb.Num{Val: 1, Type: pb.Num_UID}) - if err != nil { - return 0, err - } - return uids.StartId, nil -} - func (z *zero) nextUIDs(num *pb.Num) (*pb.AssignedIds, error) { var resp *pb.AssignedIds if num.Bump { From dba2a444e53b4462a61c0b851bcf7eacb42a39a9 Mon Sep 17 00:00:00 2001 From: Matthew McNeely Date: Mon, 14 Jul 2025 16:33:34 -0400 Subject: [PATCH 09/20] Add ristretto cache option for embedded DBs --- client.go | 23 +++++++++++++++++------ config.go | 23 +++++++++++++++++++---- engine.go | 22 ++++++++++++---------- 3 files changed, 48 insertions(+), 20 deletions(-) diff --git a/client.go b/client.go index e6f98b6..61a9284 100644 --- a/client.go +++ b/client.go @@ -100,6 +100,7 @@ type clientOptions struct { autoSchema bool poolSize int maxEdgeTraversal int + cacheSizeMB int namespace string logger logr.Logger } @@ -114,7 +115,7 @@ func WithAutoSchema(enable bool) ClientOpt { } } -// WithPoolSize sets the size of the dgo client connection pool +// WithPoolSize sets the size of the dgraph client connection pool func WithPoolSize(size int) ClientOpt { return func(o *clientOptions) { o.poolSize = size @@ -135,13 +136,20 @@ func WithLogger(logger logr.Logger) ClientOpt { } } -// WithMaxEdgeTraversal sets the maximum number of edges to traverse when fetching an object +// WithMaxEdgeTraversal sets the maximum depth of edges to traverse when fetching an object func WithMaxEdgeTraversal(max int) ClientOpt { return func(o *clientOptions) { o.maxEdgeTraversal = max } } +// WithCacheSizeMB sets the memory cache size in MB (only applicable for embedded databases) +func WithCacheSizeMB(size int) ClientOpt { + return func(o *clientOptions) { + o.cacheSizeMB = size + } +} + // NewClient creates a new graph database client instance based on the provided URI. // // The function supports two URI schemes: @@ -154,6 +162,7 @@ func WithMaxEdgeTraversal(max int) ClientOpt { // - WithMaxEdgeTraversal(int) - Set the maximum number of edges to traverse when fetching an object // - WithNamespace(string) - Set the database namespace for multi-tenant installations // - WithLogger(logr.Logger) - Configure structured logging with custom verbosity levels +// - WithCacheSizeMB(int) - Set the memory cache size in MB (only applicable for embedded databases) // // The returned Client provides a consistent interface regardless of whether you're // connected to a remote Dgraph cluster or a local embedded database. This abstraction @@ -168,6 +177,7 @@ func NewClient(uri string, opts ...ClientOpt) (Client, error) { poolSize: 10, namespace: "", maxEdgeTraversal: 10, + cacheSizeMB: 1024, // 1 GB logger: logr.Discard(), // No-op logger by default } @@ -210,8 +220,9 @@ func NewClient(uri string, opts ...ClientOpt) (Client, error) { return nil, err } engine, err := NewEngine(Config{ - dataDir: uri, - logger: client.logger, + dataDir: uri, + logger: client.logger, + cacheSizeMB: options.cacheSizeMB, }) if err != nil { return nil, err @@ -242,8 +253,8 @@ func (c client) isLocal() bool { } func (c client) key() string { - return fmt.Sprintf("%s:%t:%d:%d:%s", c.uri, c.options.autoSchema, c.options.poolSize, - c.options.maxEdgeTraversal, c.options.namespace) + return fmt.Sprintf("%s:%t:%d:%d:%d:%s", c.uri, c.options.autoSchema, c.options.poolSize, + c.options.maxEdgeTraversal, c.options.cacheSizeMB, c.options.namespace) } func checkPointer(obj any) error { diff --git a/config.go b/config.go index 125a3d4..820a921 100644 --- a/config.go +++ b/config.go @@ -10,9 +10,8 @@ import ( ) type Config struct { - dataDir string - - // optional params + dataDir string + cacheSizeMB int limitNormalizeNode int // logger is used for structured logging @@ -20,9 +19,15 @@ type Config struct { } func NewDefaultConfig(dir string) Config { - return Config{dataDir: dir, limitNormalizeNode: 10000, logger: logr.Discard()} + return Config{ + dataDir: dir, + limitNormalizeNode: 10000, + logger: logr.Discard(), + cacheSizeMB: 1024, // 1 GB + } } +// WithLimitNormalizeNode sets the limit for the number of nodes to normalize func (cc Config) WithLimitNormalizeNode(d int) Config { cc.limitNormalizeNode = d return cc @@ -34,10 +39,20 @@ func (cc Config) WithLogger(logger logr.Logger) Config { return cc } +// WithCacheSizeMB sets the memory cache size in MB +func (cc Config) WithCacheSizeMB(size int) Config { + cc.cacheSizeMB = size + return cc +} + func (cc Config) validate() error { if cc.dataDir == "" { return ErrEmptyDataDir } + if cc.cacheSizeMB < 0 { + return ErrInvalidCacheSize + } + return nil } diff --git a/engine.go b/engine.go index 6ec6ccc..6e8845e 100644 --- a/engine.go +++ b/engine.go @@ -39,14 +39,15 @@ var ( // activeEngine tracks the current Engine instance for global access activeEngine *Engine - ErrSingletonOnly = errors.New("only one instance of modusDB can exist in a process") - ErrEmptyDataDir = errors.New("data directory is required") - ErrClosedEngine = errors.New("modusDB engine is closed") - ErrNonExistentDB = errors.New("namespace does not exist") + ErrSingletonOnly = errors.New("only one instance of modusGraph can exist in a process") + ErrEmptyDataDir = errors.New("data directory is required") + ErrClosedEngine = errors.New("modusGraph engine is closed") + ErrNonExistentDB = errors.New("namespace does not exist") + ErrInvalidCacheSize = errors.New("cache size must be zero or positive") ) -// Engine is an instance of modusDB. -// For now, we only support one instance of modusDB per process. +// Engine is an instance of modusGraph. +// For now, we only support one instance of modusGraph per process. type Engine struct { mutex sync.RWMutex isOpen atomic.Bool @@ -61,15 +62,15 @@ type Engine struct { logger logr.Logger } -// NewEngine returns a new modusDB instance. +// NewEngine returns a new modusGraph instance. func NewEngine(conf Config) (*Engine, error) { - // Ensure that we do not create another instance of modusDB in the same process + // Ensure that we do not create another instance of modusGraph in the same process if !singleton.CompareAndSwap(false, true) { conf.logger.Error(ErrSingletonOnly, "Failed to create engine") return nil, ErrSingletonOnly } - conf.logger.V(1).Info("Creating new modusDB engine", "dataDir", conf.dataDir) + conf.logger.V(1).Info("Creating new modusGraph engine", "dataDir", conf.dataDir) if err := conf.validate(); err != nil { conf.logger.Error(err, "Invalid configuration") @@ -93,7 +94,8 @@ func NewEngine(conf Config) (*Engine, error) { worker.State.InitStorage() worker.InitForLite(worker.State.Pstore) schema.Init(worker.State.Pstore) - posting.Init(worker.State.Pstore, 0, false) // TODO: set cache size + cacheSizeBytes := conf.cacheSizeMB * 1024 * 1024 + posting.Init(worker.State.Pstore, int64(cacheSizeBytes), false) engine := &Engine{ logger: conf.logger, From b659d136b00350eea127807c44233ff303e3bee8 Mon Sep 17 00:00:00 2001 From: Matthew McNeely Date: Mon, 14 Jul 2025 16:33:48 -0400 Subject: [PATCH 10/20] Update dependencies --- go.mod | 40 +++++++++++++----------- go.sum | 98 ++++++++++++++++++++++++++++------------------------------ 2 files changed, 70 insertions(+), 68 deletions(-) diff --git a/go.mod b/go.mod index a3d64c4..f73c35d 100644 --- a/go.mod +++ b/go.mod @@ -1,35 +1,42 @@ module github.com/hypermodeinc/modusgraph -go 1.24.3 +go 1.24.4 require ( github.com/cavaliergopher/grab/v3 v3.0.1 github.com/dgraph-io/badger/v4 v4.7.0 - github.com/dgraph-io/dgo/v250 v250.0.0-preview4 + github.com/dgraph-io/dgo/v250 v250.0.0-preview4.0.20250619041351-4a519e53fb9d github.com/dgraph-io/ristretto/v2 v2.2.0 github.com/dolan-in/dgman/v2 v2.1.0-preview2 github.com/go-logr/logr v1.4.3 github.com/go-logr/stdr v1.2.2 - github.com/hypermodeinc/dgraph/v25 v25.0.0-preview4 + github.com/hypermodeinc/dgraph/v25 v25.0.0-preview6 github.com/pkg/errors v0.9.1 github.com/stretchr/testify v1.10.0 - github.com/twpayne/go-geom v1.6.1 - golang.org/x/sync v0.15.0 + golang.org/x/sync v0.16.0 google.golang.org/protobuf v1.36.6 ) require ( github.com/cenkalti/backoff/v5 v5.0.2 // indirect github.com/dolan-in/reflectwalk v1.0.2-0.20210101124621-dc2073a29d71 // indirect + github.com/go-ini/ini v1.67.0 // indirect github.com/go-viper/mapstructure/v2 v2.2.1 // indirect + github.com/goccy/go-json v0.10.5 // indirect github.com/google/uuid v1.6.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 // indirect + github.com/minio/crc64nvme v1.0.1 // indirect + github.com/minio/minio-go/v7 v7.0.94 // indirect github.com/pelletier/go-toml/v2 v2.2.4 // indirect + github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c // indirect + github.com/rs/xid v1.6.0 // indirect github.com/sagikazarmark/locafero v0.9.0 // indirect github.com/sergi/go-diff v1.2.0 // indirect github.com/sourcegraph/conc v0.3.0 // indirect + github.com/tinylib/msgp v1.3.0 // indirect + github.com/twpayne/go-geom v1.6.1 // indirect go.opentelemetry.io/auto/sdk v1.1.0 // indirect - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.60.0 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0 // indirect go.opentelemetry.io/otel v1.36.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.36.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.36.0 // indirect @@ -44,12 +51,12 @@ require ( require ( contrib.go.opencensus.io/exporter/prometheus v0.4.2 // indirect github.com/HdrHistogram/hdrhistogram-go v1.1.2 // indirect - github.com/IBM/sarama v1.45.1 // indirect + github.com/IBM/sarama v1.45.2 // indirect github.com/agnivade/levenshtein v1.2.1 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bits-and-blooms/bitset v1.22.0 // indirect // trunk-ignore(osv-scanner/GHSA-9w9f-6mg8-jp7w) - github.com/blevesearch/bleve/v2 v2.5.1 // indirect + github.com/blevesearch/bleve/v2 v2.5.2 // indirect github.com/blevesearch/bleve_index_api v1.2.8 // indirect github.com/blevesearch/geo v0.2.3 // indirect github.com/blevesearch/go-porterstemmer v1.0.3 // indirect @@ -74,7 +81,7 @@ require ( github.com/go-jose/go-jose/v4 v4.1.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang-jwt/jwt/v5 v5.2.2 // indirect - github.com/golang/geo v0.0.0-20250516193853-92f93c4cb289 // indirect + github.com/golang/geo v0.0.0-20250613135800-9e8e59d779cc // indirect github.com/golang/glog v1.2.5 // indirect github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect github.com/golang/protobuf v1.5.4 // indirect @@ -92,7 +99,7 @@ require ( github.com/hashicorp/go-sockaddr v1.0.7 // indirect github.com/hashicorp/go-uuid v1.0.3 // indirect github.com/hashicorp/hcl v1.0.1-vault-7 // indirect - github.com/hashicorp/vault/api v1.16.0 // indirect + github.com/hashicorp/vault/api v1.20.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jcmturner/aescts/v2 v2.0.0 // indirect github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect @@ -103,8 +110,6 @@ require ( github.com/klauspost/compress v1.18.0 // indirect github.com/klauspost/cpuid/v2 v2.2.10 // indirect github.com/minio/md5-simd v1.1.2 // indirect - github.com/minio/minio-go/v6 v6.0.57 // indirect - github.com/minio/sha256-simd v1.0.1 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect @@ -122,7 +127,7 @@ require ( github.com/ryanuber/go-glob v1.0.0 // indirect github.com/soheilhy/cmux v0.1.5 // indirect github.com/spf13/afero v1.14.0 // indirect - github.com/spf13/cast v1.8.0 // indirect + github.com/spf13/cast v1.9.2 // indirect github.com/spf13/cobra v1.9.1 // indirect github.com/spf13/pflag v1.0.6 // indirect github.com/spf13/viper v1.20.1 // indirect @@ -135,16 +140,15 @@ require ( go.opencensus.io v0.24.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/crypto v0.38.0 // indirect - golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6 // indirect - golang.org/x/net v0.40.0 // indirect + golang.org/x/crypto v0.39.0 // indirect + golang.org/x/exp v0.0.0-20250606033433-dcc06ee1d476 // indirect + golang.org/x/net v0.41.0 // indirect golang.org/x/sys v0.33.0 // indirect golang.org/x/term v0.32.0 // indirect - golang.org/x/text v0.25.0 // indirect + golang.org/x/text v0.26.0 // indirect golang.org/x/time v0.11.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20250519155744-55703ea1f237 // indirect google.golang.org/grpc v1.73.0 - gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 5480fbe..adee1f9 100644 --- a/go.sum +++ b/go.sum @@ -40,8 +40,8 @@ github.com/DATA-DOG/go-sqlmock v1.5.2 h1:OcvFkGmslmlZibjAjaHm3L//6LiuBgolP7Oputl github.com/DATA-DOG/go-sqlmock v1.5.2/go.mod h1:88MAG/4G7SMwSE3CeA0ZKzrT5CiOU3OJ+JlNzwDqpNU= github.com/HdrHistogram/hdrhistogram-go v1.1.2 h1:5IcZpTvzydCQeHzK4Ef/D5rrSqwxob0t8PQPMybUNFM= github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= -github.com/IBM/sarama v1.45.1 h1:nY30XqYpqyXOXSNoe2XCgjj9jklGM1Ye94ierUb1jQ0= -github.com/IBM/sarama v1.45.1/go.mod h1:qifDhA3VWSrQ1TjSMyxDl3nYL3oX2C83u+G6L79sq4w= +github.com/IBM/sarama v1.45.2 h1:8m8LcMCu3REcwpa7fCP6v2fuPuzVwXDAM2DOv3CBrKw= +github.com/IBM/sarama v1.45.2/go.mod h1:ppaoTcVdGv186/z6MEKsMm70A5fwJfRTpstI37kVn3Y= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= @@ -69,8 +69,8 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bits-and-blooms/bitset v1.22.0 h1:Tquv9S8+SGaS3EhyA+up3FXzmkhxPGjQQCkcs2uw7w4= github.com/bits-and-blooms/bitset v1.22.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= -github.com/blevesearch/bleve/v2 v2.5.1 h1:cc/O++W2Hcjp1SU5ETHeE+QYWv2oV88ldYEPowdmg8M= -github.com/blevesearch/bleve/v2 v2.5.1/go.mod h1:9g/wnbWKm9AgXrU8Ecqi+IDdqjUHWymwkQRDg+5tafU= +github.com/blevesearch/bleve/v2 v2.5.2 h1:Ab0r0MODV2C5A6BEL87GqLBySqp/s9xFgceCju6BQk8= +github.com/blevesearch/bleve/v2 v2.5.2/go.mod h1:5Dj6dUQxZM6aqYT3eutTD/GpWKGFSsV8f7LDidFbwXo= github.com/blevesearch/bleve_index_api v1.2.8 h1:Y98Pu5/MdlkRyLM0qDHostYo7i+Vv1cDNhqTeR4Sy6Y= github.com/blevesearch/bleve_index_api v1.2.8/go.mod h1:rKQDl4u51uwafZxFrPD1R7xFOwKnzZW7s/LSeK4lgo0= github.com/blevesearch/geo v0.2.3 h1:K9/vbGI9ehlXdxjxDRJtoAMt7zGAsMIzc6n8zWcwnhg= @@ -109,6 +109,10 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cockroachdb/datadriven v1.0.2 h1:H9MtNqVoVhvd9nCBwOyDjUEdZCREqbIdCJD93PBm/jA= github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/containerd/errdefs v1.0.0 h1:tg5yIfIlQIrxYtu9ajqY42W3lpS19XqdxRQeEwYG8PI= +github.com/containerd/errdefs v1.0.0/go.mod h1:+YBYIdtsnF4Iw6nWZhJcqGSg/dwvV7tyJ/kCkyJ2k+M= +github.com/containerd/errdefs/pkg v0.3.0 h1:9IKJ06FvyNlexW690DXuQNx2KA2cUJXx151Xdx3ZPPE= +github.com/containerd/errdefs/pkg v0.3.0/go.mod h1:NJw6s9HwNuRhnjJhM7pylWwMyAkmCQvQ4GpJHEqRLVk= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= @@ -118,8 +122,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgraph-io/badger/v4 v4.7.0 h1:Q+J8HApYAY7UMpL8d9owqiB+odzEc0zn/aqOD9jhc6Y= github.com/dgraph-io/badger/v4 v4.7.0/go.mod h1:He7TzG3YBy3j4f5baj5B7Zl2XyfNe5bl4Udl0aPemVA= -github.com/dgraph-io/dgo/v250 v250.0.0-preview4 h1:DkS6iFI6RwStXRzQxT5v8b6NLqqHQi0xKSK6FvcEwYo= -github.com/dgraph-io/dgo/v250 v250.0.0-preview4/go.mod h1:6nnKW4tYiai9xI6NSCrxaBgUGG1YI/+KlY+Tc7smqXY= +github.com/dgraph-io/dgo/v250 v250.0.0-preview4.0.20250619041351-4a519e53fb9d h1:9PLyvZY1Nih05g+2womk+kNnX3Gb20kx5BsK3foA5a8= +github.com/dgraph-io/dgo/v250 v250.0.0-preview4.0.20250619041351-4a519e53fb9d/go.mod h1:gLr7uM+x/8PjSQJ4Ca9kfQF15uBzruDzRK3bnELt3vE= github.com/dgraph-io/gqlgen v0.13.2 h1:TNhndk+eHKj5qE7BenKKSYdSIdOGhLqxR1rCiMso9KM= github.com/dgraph-io/gqlgen v0.13.2/go.mod h1:iCOrOv9lngN7KAo+jMgvUPVDlYHdf7qDwsTkQby2Sis= github.com/dgraph-io/gqlparser/v2 v2.1.1/go.mod h1:MYS4jppjyx8b9tuUtjV7jU1UFZK6P9fvO8TsIsQtRKU= @@ -138,8 +142,8 @@ github.com/dgryski/trifles v0.0.0-20230903005119-f50d829f2e54 h1:SG7nF6SRlWhcT7c github.com/dgryski/trifles v0.0.0-20230903005119-f50d829f2e54/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA= github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= -github.com/docker/docker v28.1.1+incompatible h1:49M11BFLsVO1gxY9UX9p/zwkE/rswggs8AdFmXQw51I= -github.com/docker/docker v28.1.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v28.2.2+incompatible h1:CjwRSksz8Yo4+RmQ339Dp/D2tGO5JxwYeqtMOEe0LDw= +github.com/docker/docker v28.2.2+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c= github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= @@ -148,7 +152,6 @@ github.com/dolan-in/dgman/v2 v2.1.0-preview2 h1:txflVWSbjgu6Q5Lhf4kImT4tM61Pu6JL github.com/dolan-in/dgman/v2 v2.1.0-preview2/go.mod h1:5OqMqJelDvhvdxgKc4CXkb7FApSJHhTxm79xZJsblOE= github.com/dolan-in/reflectwalk v1.0.2-0.20210101124621-dc2073a29d71 h1:v3bErDrPApxsyBlz8/8nFTCb7Ai0wecA8TokfEHIQ80= github.com/dolan-in/reflectwalk v1.0.2-0.20210101124621-dc2073a29d71/go.mod h1:Y9TyDkSL5jQ18ZnDaSxOdCUhbb5SCeamqYFQ7LYxxFs= -github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/eapache/go-resiliency v1.7.0 h1:n3NRTnBn5N0Cbi/IeOHuQn9s2UwVUH7Ga0ZWcP+9JTA= @@ -179,6 +182,8 @@ github.com/go-chi/chi v3.3.2+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxm github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-ini/ini v1.67.0 h1:z6ZrTEZqSWOTyH2FlglNbNgARyHG8oLW9gMELqKr06A= +github.com/go-ini/ini v1.67.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= github.com/go-jose/go-jose/v4 v4.1.0 h1:cYSYxd3pw5zd2FSXk2vGdn9igQU2PS8MuxrCOCl0FdY= github.com/go-jose/go-jose/v4 v4.1.0/go.mod h1:GG/vqmYm3Von2nYiB2vGTXzdoNKE5tix5tuc6iAd+sw= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= @@ -203,6 +208,8 @@ github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlnd github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM= github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.2.1/go.mod h1:hRKAFb8wOxFROYNsT1bqfWnhX+b5MFeJM9r2ZSwg/KY= +github.com/goccy/go-json v0.10.5 h1:Fq85nIqj+gXn/S5ahsiTlK3TmC85qgirsdTP/+DeaC4= +github.com/goccy/go-json v0.10.5/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= github.com/gogo/protobuf v1.0.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= @@ -211,8 +218,8 @@ github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69 github.com/golang-jwt/jwt/v5 v5.2.2 h1:Rl4B7itRWVtYIHFrSNd7vhTiz9UpLdi6gZhZ3wEeDy8= github.com/golang-jwt/jwt/v5 v5.2.2/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= -github.com/golang/geo v0.0.0-20250516193853-92f93c4cb289 h1:HeOFbnyPys/vx/t+d4fwZM782mnjRVtbjxVkDittTUs= -github.com/golang/geo v0.0.0-20250516193853-92f93c4cb289/go.mod h1:Vaw7L5b+xa3Rj4/pRtrQkymn3lSBRB/NAEdbF9YEVLA= +github.com/golang/geo v0.0.0-20250613135800-9e8e59d779cc h1:HeTandKJybEWXv6wW9o3ybXTNqGGV4Q6kW3S+8RsXbk= +github.com/golang/geo v0.0.0-20250613135800-9e8e59d779cc/go.mod h1:Vaw7L5b+xa3Rj4/pRtrQkymn3lSBRB/NAEdbF9YEVLA= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/glog v1.2.5 h1:DrW6hGnjIhtvhOIiAKT6Psh/Kd/ldepEa81DKeiRJ5I= github.com/golang/glog v1.2.5/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= @@ -288,7 +295,6 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v0.0.0-20160226214623-1ea25387ff6f/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/mux v1.6.1/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= @@ -323,12 +329,12 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hcl v1.0.1-vault-7 h1:ag5OxFVy3QYTFTJODRzTKVZ6xvdfLLCA1cy/Y6xGI0I= github.com/hashicorp/hcl v1.0.1-vault-7/go.mod h1:XYhtn6ijBSAj6n4YqAaf7RBPS4I06AItNorpy+MoQNM= -github.com/hashicorp/vault/api v1.16.0 h1:nbEYGJiAPGzT9U4oWgaaB0g+Rj8E59QuHKyA5LhwQN4= -github.com/hashicorp/vault/api v1.16.0/go.mod h1:KhuUhzOD8lDSk29AtzNjgAu2kxRA9jL9NAbkFlqvkBA= +github.com/hashicorp/vault/api v1.20.0 h1:KQMHElgudOsr+IbJgmbjHnCTxEpKs9LnozA1D3nozU4= +github.com/hashicorp/vault/api v1.20.0/go.mod h1:GZ4pcjfzoOWpkJ3ijHNpEoAxKEsBJnVljyTe3jM2Sms= github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= -github.com/hypermodeinc/dgraph/v25 v25.0.0-preview4 h1:DMMm1o6B+8o9hlTvFgTyQndyQrQtr8t53+feJ5cbZoA= -github.com/hypermodeinc/dgraph/v25 v25.0.0-preview4/go.mod h1:qSZN3M4DdIiqUjfTMXLWuHSKEquYhhNyW4ebICN3fkM= +github.com/hypermodeinc/dgraph/v25 v25.0.0-preview6 h1:q9Prj7fVT3ZuFDAhcj4xqBPhFqZlJNbneIKeMaQI5qc= +github.com/hypermodeinc/dgraph/v25 v25.0.0-preview6/go.mod h1:nJUpUxtKOl0l7nA3+ImMRUdlrvJPizgtfBJw3b/VXEU= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20210905161508-09a460cdf81d/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w= github.com/ianlancetaylor/demangle v0.0.0-20230524184225-eabc099b10ab/go.mod h1:gx7rwoVhcfuVKG5uya9Hs3Sxj7EIvldVofAWIUtGouw= @@ -349,14 +355,12 @@ github.com/jcmturner/rpc/v2 v2.0.3/go.mod h1:VUJYCIDm3PVOEHw8sgt091/20OJjskO/YJk github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= @@ -366,7 +370,6 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo= github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ= -github.com/klauspost/cpuid v1.2.3/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/cpuid/v2 v2.0.1/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.0.3/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.2.10 h1:tBs3QSyvjDyFTq3uoc/9xFpCuOsJQFNPiAhYdw2skhE= @@ -395,14 +398,12 @@ github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Ky github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/minio/md5-simd v1.1.0/go.mod h1:XpBqgZULrMYD3R+M28PcmP0CkI7PEMzB3U77ZrKZ0Gw= +github.com/minio/crc64nvme v1.0.1 h1:DHQPrYPdqK7jQG/Ls5CTBZWeex/2FMS3G5XGkycuFrY= +github.com/minio/crc64nvme v1.0.1/go.mod h1:eVfm2fAzLlxMdUGc0EEBGSMmPwmXD5XiNRpnu9J3bvg= github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34= github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM= -github.com/minio/minio-go/v6 v6.0.57 h1:ixPkbKkyD7IhnluRgQpGSpHdpvNVaW6OD5R9IAO/9Tw= -github.com/minio/minio-go/v6 v6.0.57/go.mod h1:5+R/nM9Pwrh0vqF+HbYYDQ84wdUFPyXHkrdT4AIkifM= -github.com/minio/sha256-simd v0.1.1/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM= -github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM= -github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8= +github.com/minio/minio-go/v7 v7.0.94 h1:1ZoksIKPyaSt64AVOyaQvhDOgVC3MfZsWM6mZXRUGtM= +github.com/minio/minio-go/v7 v7.0.94/go.mod h1:71t2CqDt3ThzESgZUlU1rBN54mksGGlkLcFgguDnnAc= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/mapstructure v0.0.0-20180203102830-a4e142e9c047/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= @@ -433,6 +434,8 @@ github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFSt github.com/orisano/pixelmatch v0.0.0-20220722002657-fb0b55479cde/go.mod h1:nZgzbfBr3hhjoZnS66nKrHmduYNpc34ny7RK4z5/HM0= github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4= github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= +github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c h1:dAMKvw0MlJT1GshSTtih8C2gDs04w8dReiOGXrGLNoY= +github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c/go.mod h1:RqIHx9QI14HlwKwm98g9Re5prTQ6LdeRQn+gXJFxsJM= github.com/pierrec/lz4/v4 v4.1.22 h1:cKFw6uJDK+/gfw5BcDL0JL5aBsAFdsIT18eRtLj7VIU= github.com/pierrec/lz4/v4 v4.1.22/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -484,6 +487,8 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/rs/cors v1.6.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= +github.com/rs/xid v1.6.0 h1:fV591PaemRlL6JfRxGDEPl69wICngIQ3shQtzfy2gxU= +github.com/rs/xid v1.6.0/go.mod h1:7XoLgs4eV+QndskICGsho+ADou8ySMSjJKDIan90Nz0= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/go-glob v1.0.0 h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkBk= @@ -498,18 +503,15 @@ github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeV github.com/shurcooL/vfsgen v0.0.0-20180121065927-ffb13db8def0/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.5.0/go.mod h1:+F7Ogzej0PZc/94MaYx/nvG9jOFMD2osvC3s+Squfpo= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.5 h1:jjzc5WVemNEDTLwv9tlmemhC73tI08BNOIGwBOo10Js= github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= github.com/spf13/afero v1.14.0 h1:9tH6MapGnn/j0eb0yIXiLjERO8RB6xIVZRDCX7PtqWA= github.com/spf13/afero v1.14.0/go.mod h1:acJQ8t0ohCGuMN3O+Pv0V0hgMxNYDlvdk+VTfyZmbYo= -github.com/spf13/cast v1.8.0 h1:gEN9K4b8Xws4EX0+a0reLmhq8moKn7ntRlQYgjPeCDk= -github.com/spf13/cast v1.8.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= +github.com/spf13/cast v1.9.2 h1:SsGfm7M8QOFtEzumm7UZrZdLLquNdzFYfIbEXntcFbE= +github.com/spf13/cast v1.9.2/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo= github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo= github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0= github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= @@ -535,6 +537,8 @@ github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf github.com/stvp/go-udp-testing v0.0.0-20201019212854-469649b16807/go.mod h1:7jxmlfBCDBXRzr0eAQJ48XC1hBu1np4CS5+cHEYfwpc= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= +github.com/tinylib/msgp v1.3.0 h1:ULuf7GPooDaIlbyvgAxBV/FI7ynli6LZ1/nVUNu+0ww= +github.com/tinylib/msgp v1.3.0/go.mod h1:ykjzy2wzgrlvpDCRc4LA8UXy6D8bzMSuAF3WD57Gok0= github.com/twpayne/go-geom v1.6.1 h1:iLE+Opv0Ihm/ABIcvQFGIiFBXd76oBIar9drAwHFhR4= github.com/twpayne/go-geom v1.6.1/go.mod h1:Kr+Nly6BswFsKM5sd31YaoWS5PeDDH2NftJTK7Gd028= github.com/urfave/cli/v2 v2.1.1/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ= @@ -567,8 +571,8 @@ go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.60.0 h1:x7wzEgXfnzJcHDwStJT+mxOz4etr2EcexjqhBvmoakw= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.60.0/go.mod h1:rg+RlpR5dKwaS95IyyZqj5Wd4E13lk/msnTS0Xl9lJM= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0 h1:q4XOmH/0opmeuJtPsbFNivyl7bCt7yRBbeEm2sC/XtQ= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0/go.mod h1:snMWehoOh2wsEwnvvwtDyFCxVeDAODenXHtn5vzrKjo= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.60.0 h1:sbiXRNDSWJOTobXh5HyQKjq6wUC5tNybqjIqDpAY4CU= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.60.0/go.mod h1:69uWxva0WgAA/4bu2Yy70SLDBwZXuQ6PbBpbsa5iZrQ= go.opentelemetry.io/otel v1.36.0 h1:UumtzIklRBY6cI/lllNZlALOF5nNIzJVb16APdvgTXg= @@ -596,14 +600,13 @@ go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= -golang.org/x/crypto v0.38.0 h1:jt+WWG8IZlBnVbomuhg2Mdq0+BBQaHbtqHEFEigjUV8= -golang.org/x/crypto v0.38.0/go.mod h1:MvrbAqul58NNYPKnOra203SB9vpuZW0e+RRZV+Ggqjw= +golang.org/x/crypto v0.39.0 h1:SHs+kF4LP+f+p14esP5jAoDpHU8Gu/v9lFRK6IT5imM= +golang.org/x/crypto v0.39.0/go.mod h1:L+Xg3Wf6HoL4Bn4238Z6ft6KfEpN0tJGo53AAPC632U= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -617,8 +620,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6 h1:y5zboxd6LQAqYIhHnB48p0ByQ/GnQx2BE33L8BOHQkI= -golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6/go.mod h1:U6Lno4MTRCDY+Ba7aCcauB9T60gsv5s4ralQzP72ZoQ= +golang.org/x/exp v0.0.0-20250606033433-dcc06ee1d476 h1:bsqhLWFR6G6xiQcb+JoGqdKdRU6WzPWmK8E0jxTjzo4= +golang.org/x/exp v0.0.0-20250606033433-dcc06ee1d476/go.mod h1:3//PLf8L/X+8b4vuAfHzxeRUl04Adcb341+IGKfnqS8= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= @@ -641,8 +644,8 @@ golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU= -golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= +golang.org/x/mod v0.25.0 h1:n7a+ZbQKQA/Ysbyb0/6IbB1H/X41mKgbhfv7AfG/44w= +golang.org/x/mod v0.25.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -652,7 +655,6 @@ golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -683,8 +685,8 @@ golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.40.0 h1:79Xs7wF06Gbdcg4kdCCIQArK11Z1hr5POQ6+fIYHNuY= -golang.org/x/net v0.40.0/go.mod h1:y0hY0exeL2Pku80/zKK7tpntoX23cqL3Oa6njdgRtds= +golang.org/x/net v0.41.0 h1:vBTly1HeNPEn3wtREYfy4GZ/NECgw2Cnl+nK6Nz3uvw= +golang.org/x/net v0.41.0/go.mod h1:B/K4NNqkfmg07DQYrbwvSluqCJOOXwUjeb/5lOisjbA= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -704,8 +706,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.15.0 h1:KWH3jNZsfyT6xfAfKiz6MRNmd46ByHDYaZ7KSkCtdW8= -golang.org/x/sync v0.15.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw= +golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -769,8 +771,8 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.25.0 h1:qVyWApTSYLk/drJRO5mDlNYskwQznZmkpV2c8q9zls4= -golang.org/x/text v0.25.0/go.mod h1:WEdwpYrmk1qmdHvhkSTNPm3app7v4rsT8F2UD6+VHIA= +golang.org/x/text v0.26.0 h1:P42AVeLghgTYr4+xUnTRKDMqpar+PtX7KWuNQL21L8M= +golang.org/x/text v0.26.0/go.mod h1:QK15LZJUUQVJxhz7wXgxSy/CJaTFjd0G+YLonydOVQA= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -786,7 +788,6 @@ golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3 golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190515012406-7d7faa4812bd/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= @@ -930,9 +931,6 @@ gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= -gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= From bbba27e5347c170a3957927d23269959ca89b4cb Mon Sep 17 00:00:00 2001 From: Matthew McNeely Date: Mon, 14 Jul 2025 17:05:43 -0400 Subject: [PATCH 11/20] Increase job timeout --- .github/workflows/ci-go-unit-tests.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci-go-unit-tests.yaml b/.github/workflows/ci-go-unit-tests.yaml index 2100ff0..19cf904 100644 --- a/.github/workflows/ci-go-unit-tests.yaml +++ b/.github/workflows/ci-go-unit-tests.yaml @@ -18,6 +18,7 @@ permissions: jobs: ci-go-tests: + timeout-minutes: 2 name: Test ${{ matrix.os }} runs-on: "${{ matrix.os == 'linux' && 'warp-ubuntu-latest-x64-4x' || matrix.os == 'macos' && From aae0a8c280e8771532f0a6d1c5ef653d619e06f3 Mon Sep 17 00:00:00 2001 From: Matthew McNeely Date: Mon, 14 Jul 2025 17:54:50 -0400 Subject: [PATCH 12/20] Debug failing test on Linux --- .github/workflows/ci-go-unit-tests.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-go-unit-tests.yaml b/.github/workflows/ci-go-unit-tests.yaml index 19cf904..27a571e 100644 --- a/.github/workflows/ci-go-unit-tests.yaml +++ b/.github/workflows/ci-go-unit-tests.yaml @@ -18,7 +18,7 @@ permissions: jobs: ci-go-tests: - timeout-minutes: 2 + timeout-minutes: 10 name: Test ${{ matrix.os }} runs-on: "${{ matrix.os == 'linux' && 'warp-ubuntu-latest-x64-4x' || matrix.os == 'macos' && @@ -39,4 +39,5 @@ jobs: cache-dependency-path: go.sum - name: Run Unit Tests - run: go test -race -v . + #run: go test -race -v . + run: go test -timeout 30s -run ^TestNonGalaxyDB$ github.com/hypermodeinc/modusgraph -v From 297908ae3b20795b1412b81be22af615fd634330 Mon Sep 17 00:00:00 2001 From: Matthew McNeely Date: Mon, 14 Jul 2025 17:58:54 -0400 Subject: [PATCH 13/20] Increase timeout --- .github/workflows/ci-go-unit-tests.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-go-unit-tests.yaml b/.github/workflows/ci-go-unit-tests.yaml index 27a571e..3629a26 100644 --- a/.github/workflows/ci-go-unit-tests.yaml +++ b/.github/workflows/ci-go-unit-tests.yaml @@ -18,7 +18,7 @@ permissions: jobs: ci-go-tests: - timeout-minutes: 10 + timeout-minutes: 20 name: Test ${{ matrix.os }} runs-on: "${{ matrix.os == 'linux' && 'warp-ubuntu-latest-x64-4x' || matrix.os == 'macos' && @@ -39,5 +39,4 @@ jobs: cache-dependency-path: go.sum - name: Run Unit Tests - #run: go test -race -v . - run: go test -timeout 30s -run ^TestNonGalaxyDB$ github.com/hypermodeinc/modusgraph -v + run: go test -race -v . From b94b5eaceb5426087c83b2796a78d889dfa4b40c Mon Sep 17 00:00:00 2001 From: Matthew McNeely Date: Mon, 14 Jul 2025 18:12:09 -0400 Subject: [PATCH 14/20] Lower the default cache size --- config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.go b/config.go index 820a921..9f4b24c 100644 --- a/config.go +++ b/config.go @@ -23,7 +23,7 @@ func NewDefaultConfig(dir string) Config { dataDir: dir, limitNormalizeNode: 10000, logger: logr.Discard(), - cacheSizeMB: 1024, // 1 GB + cacheSizeMB: 64, // 64 MB } } From a8fa0e3d2e8ef49c0c4e57bcc5df78de69c408e9 Mon Sep 17 00:00:00 2001 From: Matthew McNeely Date: Mon, 14 Jul 2025 19:12:17 -0400 Subject: [PATCH 15/20] Lower the cache size default --- config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.go b/config.go index 9f4b24c..24f1fec 100644 --- a/config.go +++ b/config.go @@ -23,7 +23,7 @@ func NewDefaultConfig(dir string) Config { dataDir: dir, limitNormalizeNode: 10000, logger: logr.Discard(), - cacheSizeMB: 64, // 64 MB + cacheSizeMB: 8, // 8 MB } } From 81103a437a7bf826f3c5263021ba3f4abab6447a Mon Sep 17 00:00:00 2001 From: Matthew McNeely Date: Mon, 14 Jul 2025 19:22:04 -0400 Subject: [PATCH 16/20] Try setting the cache to 0 --- config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.go b/config.go index 24f1fec..8208168 100644 --- a/config.go +++ b/config.go @@ -23,7 +23,7 @@ func NewDefaultConfig(dir string) Config { dataDir: dir, limitNormalizeNode: 10000, logger: logr.Discard(), - cacheSizeMB: 8, // 8 MB + cacheSizeMB: 0, // 0 MB } } From bb09c9d94b2fa17fe8e82cc8e8a25f7ed14362f6 Mon Sep 17 00:00:00 2001 From: Matthew McNeely Date: Mon, 14 Jul 2025 19:34:46 -0400 Subject: [PATCH 17/20] Try down-grading dgraph version --- go.mod | 14 +++++--------- go.sum | 50 ++++++++++++++++++++++++++------------------------ 2 files changed, 31 insertions(+), 33 deletions(-) diff --git a/go.mod b/go.mod index f73c35d..bc91bbe 100644 --- a/go.mod +++ b/go.mod @@ -5,12 +5,12 @@ go 1.24.4 require ( github.com/cavaliergopher/grab/v3 v3.0.1 github.com/dgraph-io/badger/v4 v4.7.0 - github.com/dgraph-io/dgo/v250 v250.0.0-preview4.0.20250619041351-4a519e53fb9d + github.com/dgraph-io/dgo/v250 v250.0.0-preview4 github.com/dgraph-io/ristretto/v2 v2.2.0 github.com/dolan-in/dgman/v2 v2.1.0-preview2 github.com/go-logr/logr v1.4.3 github.com/go-logr/stdr v1.2.2 - github.com/hypermodeinc/dgraph/v25 v25.0.0-preview6 + github.com/hypermodeinc/dgraph/v25 v25.0.0-preview4 github.com/pkg/errors v0.9.1 github.com/stretchr/testify v1.10.0 golang.org/x/sync v0.16.0 @@ -20,20 +20,15 @@ require ( require ( github.com/cenkalti/backoff/v5 v5.0.2 // indirect github.com/dolan-in/reflectwalk v1.0.2-0.20210101124621-dc2073a29d71 // indirect - github.com/go-ini/ini v1.67.0 // indirect github.com/go-viper/mapstructure/v2 v2.2.1 // indirect - github.com/goccy/go-json v0.10.5 // indirect github.com/google/uuid v1.6.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 // indirect - github.com/minio/crc64nvme v1.0.1 // indirect - github.com/minio/minio-go/v7 v7.0.94 // indirect + github.com/minio/minio-go/v6 v6.0.57 // indirect + github.com/minio/sha256-simd v1.0.1 // indirect github.com/pelletier/go-toml/v2 v2.2.4 // indirect - github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c // indirect - github.com/rs/xid v1.6.0 // indirect github.com/sagikazarmark/locafero v0.9.0 // indirect github.com/sergi/go-diff v1.2.0 // indirect github.com/sourcegraph/conc v0.3.0 // indirect - github.com/tinylib/msgp v1.3.0 // indirect github.com/twpayne/go-geom v1.6.1 // indirect go.opentelemetry.io/auto/sdk v1.1.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0 // indirect @@ -46,6 +41,7 @@ require ( go.opentelemetry.io/proto/otlp v1.6.0 // indirect gonum.org/v1/gonum v0.12.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20250519155744-55703ea1f237 // indirect + gopkg.in/ini.v1 v1.67.0 // indirect ) require ( diff --git a/go.sum b/go.sum index adee1f9..a4b11b5 100644 --- a/go.sum +++ b/go.sum @@ -109,10 +109,6 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cockroachdb/datadriven v1.0.2 h1:H9MtNqVoVhvd9nCBwOyDjUEdZCREqbIdCJD93PBm/jA= github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= -github.com/containerd/errdefs v1.0.0 h1:tg5yIfIlQIrxYtu9ajqY42W3lpS19XqdxRQeEwYG8PI= -github.com/containerd/errdefs v1.0.0/go.mod h1:+YBYIdtsnF4Iw6nWZhJcqGSg/dwvV7tyJ/kCkyJ2k+M= -github.com/containerd/errdefs/pkg v0.3.0 h1:9IKJ06FvyNlexW690DXuQNx2KA2cUJXx151Xdx3ZPPE= -github.com/containerd/errdefs/pkg v0.3.0/go.mod h1:NJw6s9HwNuRhnjJhM7pylWwMyAkmCQvQ4GpJHEqRLVk= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= @@ -122,8 +118,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgraph-io/badger/v4 v4.7.0 h1:Q+J8HApYAY7UMpL8d9owqiB+odzEc0zn/aqOD9jhc6Y= github.com/dgraph-io/badger/v4 v4.7.0/go.mod h1:He7TzG3YBy3j4f5baj5B7Zl2XyfNe5bl4Udl0aPemVA= -github.com/dgraph-io/dgo/v250 v250.0.0-preview4.0.20250619041351-4a519e53fb9d h1:9PLyvZY1Nih05g+2womk+kNnX3Gb20kx5BsK3foA5a8= -github.com/dgraph-io/dgo/v250 v250.0.0-preview4.0.20250619041351-4a519e53fb9d/go.mod h1:gLr7uM+x/8PjSQJ4Ca9kfQF15uBzruDzRK3bnELt3vE= +github.com/dgraph-io/dgo/v250 v250.0.0-preview4 h1:DkS6iFI6RwStXRzQxT5v8b6NLqqHQi0xKSK6FvcEwYo= +github.com/dgraph-io/dgo/v250 v250.0.0-preview4/go.mod h1:6nnKW4tYiai9xI6NSCrxaBgUGG1YI/+KlY+Tc7smqXY= github.com/dgraph-io/gqlgen v0.13.2 h1:TNhndk+eHKj5qE7BenKKSYdSIdOGhLqxR1rCiMso9KM= github.com/dgraph-io/gqlgen v0.13.2/go.mod h1:iCOrOv9lngN7KAo+jMgvUPVDlYHdf7qDwsTkQby2Sis= github.com/dgraph-io/gqlparser/v2 v2.1.1/go.mod h1:MYS4jppjyx8b9tuUtjV7jU1UFZK6P9fvO8TsIsQtRKU= @@ -142,8 +138,8 @@ github.com/dgryski/trifles v0.0.0-20230903005119-f50d829f2e54 h1:SG7nF6SRlWhcT7c github.com/dgryski/trifles v0.0.0-20230903005119-f50d829f2e54/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA= github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= -github.com/docker/docker v28.2.2+incompatible h1:CjwRSksz8Yo4+RmQ339Dp/D2tGO5JxwYeqtMOEe0LDw= -github.com/docker/docker v28.2.2+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v28.1.1+incompatible h1:49M11BFLsVO1gxY9UX9p/zwkE/rswggs8AdFmXQw51I= +github.com/docker/docker v28.1.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c= github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= @@ -152,6 +148,7 @@ github.com/dolan-in/dgman/v2 v2.1.0-preview2 h1:txflVWSbjgu6Q5Lhf4kImT4tM61Pu6JL github.com/dolan-in/dgman/v2 v2.1.0-preview2/go.mod h1:5OqMqJelDvhvdxgKc4CXkb7FApSJHhTxm79xZJsblOE= github.com/dolan-in/reflectwalk v1.0.2-0.20210101124621-dc2073a29d71 h1:v3bErDrPApxsyBlz8/8nFTCb7Ai0wecA8TokfEHIQ80= github.com/dolan-in/reflectwalk v1.0.2-0.20210101124621-dc2073a29d71/go.mod h1:Y9TyDkSL5jQ18ZnDaSxOdCUhbb5SCeamqYFQ7LYxxFs= +github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/eapache/go-resiliency v1.7.0 h1:n3NRTnBn5N0Cbi/IeOHuQn9s2UwVUH7Ga0ZWcP+9JTA= @@ -182,8 +179,6 @@ github.com/go-chi/chi v3.3.2+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxm github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-ini/ini v1.67.0 h1:z6ZrTEZqSWOTyH2FlglNbNgARyHG8oLW9gMELqKr06A= -github.com/go-ini/ini v1.67.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= github.com/go-jose/go-jose/v4 v4.1.0 h1:cYSYxd3pw5zd2FSXk2vGdn9igQU2PS8MuxrCOCl0FdY= github.com/go-jose/go-jose/v4 v4.1.0/go.mod h1:GG/vqmYm3Von2nYiB2vGTXzdoNKE5tix5tuc6iAd+sw= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= @@ -208,8 +203,6 @@ github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlnd github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM= github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.2.1/go.mod h1:hRKAFb8wOxFROYNsT1bqfWnhX+b5MFeJM9r2ZSwg/KY= -github.com/goccy/go-json v0.10.5 h1:Fq85nIqj+gXn/S5ahsiTlK3TmC85qgirsdTP/+DeaC4= -github.com/goccy/go-json v0.10.5/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= github.com/gogo/protobuf v1.0.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= @@ -295,6 +288,7 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v0.0.0-20160226214623-1ea25387ff6f/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/mux v1.6.1/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= @@ -333,8 +327,8 @@ github.com/hashicorp/vault/api v1.20.0 h1:KQMHElgudOsr+IbJgmbjHnCTxEpKs9LnozA1D3 github.com/hashicorp/vault/api v1.20.0/go.mod h1:GZ4pcjfzoOWpkJ3ijHNpEoAxKEsBJnVljyTe3jM2Sms= github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= -github.com/hypermodeinc/dgraph/v25 v25.0.0-preview6 h1:q9Prj7fVT3ZuFDAhcj4xqBPhFqZlJNbneIKeMaQI5qc= -github.com/hypermodeinc/dgraph/v25 v25.0.0-preview6/go.mod h1:nJUpUxtKOl0l7nA3+ImMRUdlrvJPizgtfBJw3b/VXEU= +github.com/hypermodeinc/dgraph/v25 v25.0.0-preview4 h1:DMMm1o6B+8o9hlTvFgTyQndyQrQtr8t53+feJ5cbZoA= +github.com/hypermodeinc/dgraph/v25 v25.0.0-preview4/go.mod h1:qSZN3M4DdIiqUjfTMXLWuHSKEquYhhNyW4ebICN3fkM= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20210905161508-09a460cdf81d/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w= github.com/ianlancetaylor/demangle v0.0.0-20230524184225-eabc099b10ab/go.mod h1:gx7rwoVhcfuVKG5uya9Hs3Sxj7EIvldVofAWIUtGouw= @@ -355,12 +349,14 @@ github.com/jcmturner/rpc/v2 v2.0.3/go.mod h1:VUJYCIDm3PVOEHw8sgt091/20OJjskO/YJk github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= @@ -370,6 +366,7 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo= github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ= +github.com/klauspost/cpuid v1.2.3/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/cpuid/v2 v2.0.1/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.0.3/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.2.10 h1:tBs3QSyvjDyFTq3uoc/9xFpCuOsJQFNPiAhYdw2skhE= @@ -398,12 +395,14 @@ github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Ky github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/minio/crc64nvme v1.0.1 h1:DHQPrYPdqK7jQG/Ls5CTBZWeex/2FMS3G5XGkycuFrY= -github.com/minio/crc64nvme v1.0.1/go.mod h1:eVfm2fAzLlxMdUGc0EEBGSMmPwmXD5XiNRpnu9J3bvg= +github.com/minio/md5-simd v1.1.0/go.mod h1:XpBqgZULrMYD3R+M28PcmP0CkI7PEMzB3U77ZrKZ0Gw= github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34= github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM= -github.com/minio/minio-go/v7 v7.0.94 h1:1ZoksIKPyaSt64AVOyaQvhDOgVC3MfZsWM6mZXRUGtM= -github.com/minio/minio-go/v7 v7.0.94/go.mod h1:71t2CqDt3ThzESgZUlU1rBN54mksGGlkLcFgguDnnAc= +github.com/minio/minio-go/v6 v6.0.57 h1:ixPkbKkyD7IhnluRgQpGSpHdpvNVaW6OD5R9IAO/9Tw= +github.com/minio/minio-go/v6 v6.0.57/go.mod h1:5+R/nM9Pwrh0vqF+HbYYDQ84wdUFPyXHkrdT4AIkifM= +github.com/minio/sha256-simd v0.1.1/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM= +github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM= +github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/mapstructure v0.0.0-20180203102830-a4e142e9c047/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= @@ -434,8 +433,6 @@ github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFSt github.com/orisano/pixelmatch v0.0.0-20220722002657-fb0b55479cde/go.mod h1:nZgzbfBr3hhjoZnS66nKrHmduYNpc34ny7RK4z5/HM0= github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4= github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= -github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c h1:dAMKvw0MlJT1GshSTtih8C2gDs04w8dReiOGXrGLNoY= -github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c/go.mod h1:RqIHx9QI14HlwKwm98g9Re5prTQ6LdeRQn+gXJFxsJM= github.com/pierrec/lz4/v4 v4.1.22 h1:cKFw6uJDK+/gfw5BcDL0JL5aBsAFdsIT18eRtLj7VIU= github.com/pierrec/lz4/v4 v4.1.22/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -487,8 +484,6 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/rs/cors v1.6.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= -github.com/rs/xid v1.6.0 h1:fV591PaemRlL6JfRxGDEPl69wICngIQ3shQtzfy2gxU= -github.com/rs/xid v1.6.0/go.mod h1:7XoLgs4eV+QndskICGsho+ADou8ySMSjJKDIan90Nz0= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/go-glob v1.0.0 h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkBk= @@ -503,7 +498,10 @@ github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeV github.com/shurcooL/vfsgen v0.0.0-20180121065927-ffb13db8def0/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sirupsen/logrus v1.5.0/go.mod h1:+F7Ogzej0PZc/94MaYx/nvG9jOFMD2osvC3s+Squfpo= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.5 h1:jjzc5WVemNEDTLwv9tlmemhC73tI08BNOIGwBOo10Js= github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= @@ -537,8 +535,6 @@ github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf github.com/stvp/go-udp-testing v0.0.0-20201019212854-469649b16807/go.mod h1:7jxmlfBCDBXRzr0eAQJ48XC1hBu1np4CS5+cHEYfwpc= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= -github.com/tinylib/msgp v1.3.0 h1:ULuf7GPooDaIlbyvgAxBV/FI7ynli6LZ1/nVUNu+0ww= -github.com/tinylib/msgp v1.3.0/go.mod h1:ykjzy2wzgrlvpDCRc4LA8UXy6D8bzMSuAF3WD57Gok0= github.com/twpayne/go-geom v1.6.1 h1:iLE+Opv0Ihm/ABIcvQFGIiFBXd76oBIar9drAwHFhR4= github.com/twpayne/go-geom v1.6.1/go.mod h1:Kr+Nly6BswFsKM5sd31YaoWS5PeDDH2NftJTK7Gd028= github.com/urfave/cli/v2 v2.1.1/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ= @@ -600,6 +596,7 @@ go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -655,6 +652,7 @@ golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -788,6 +786,7 @@ golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3 golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190515012406-7d7faa4812bd/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= @@ -931,6 +930,9 @@ gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= +gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= From 0f14b62df6677478cf30f370480fed825bd1506e Mon Sep 17 00:00:00 2001 From: Matthew McNeely Date: Mon, 14 Jul 2025 20:05:02 -0400 Subject: [PATCH 18/20] Apply cache config across client and config --- client.go | 2 +- config.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client.go b/client.go index 61a9284..9c194ea 100644 --- a/client.go +++ b/client.go @@ -177,7 +177,7 @@ func NewClient(uri string, opts ...ClientOpt) (Client, error) { poolSize: 10, namespace: "", maxEdgeTraversal: 10, - cacheSizeMB: 1024, // 1 GB + cacheSizeMB: 64, // 64 MB logger: logr.Discard(), // No-op logger by default } diff --git a/config.go b/config.go index 8208168..9f4b24c 100644 --- a/config.go +++ b/config.go @@ -23,7 +23,7 @@ func NewDefaultConfig(dir string) Config { dataDir: dir, limitNormalizeNode: 10000, logger: logr.Discard(), - cacheSizeMB: 0, // 0 MB + cacheSizeMB: 64, // 64 MB } } From ed33788496421b95c63280e3445418908e3cbe05 Mon Sep 17 00:00:00 2001 From: Matthew McNeely Date: Mon, 14 Jul 2025 20:15:17 -0400 Subject: [PATCH 19/20] Revert Dgraph version --- go.mod | 14 +++++++++----- go.sum | 50 ++++++++++++++++++++++++-------------------------- 2 files changed, 33 insertions(+), 31 deletions(-) diff --git a/go.mod b/go.mod index bc91bbe..f73c35d 100644 --- a/go.mod +++ b/go.mod @@ -5,12 +5,12 @@ go 1.24.4 require ( github.com/cavaliergopher/grab/v3 v3.0.1 github.com/dgraph-io/badger/v4 v4.7.0 - github.com/dgraph-io/dgo/v250 v250.0.0-preview4 + github.com/dgraph-io/dgo/v250 v250.0.0-preview4.0.20250619041351-4a519e53fb9d github.com/dgraph-io/ristretto/v2 v2.2.0 github.com/dolan-in/dgman/v2 v2.1.0-preview2 github.com/go-logr/logr v1.4.3 github.com/go-logr/stdr v1.2.2 - github.com/hypermodeinc/dgraph/v25 v25.0.0-preview4 + github.com/hypermodeinc/dgraph/v25 v25.0.0-preview6 github.com/pkg/errors v0.9.1 github.com/stretchr/testify v1.10.0 golang.org/x/sync v0.16.0 @@ -20,15 +20,20 @@ require ( require ( github.com/cenkalti/backoff/v5 v5.0.2 // indirect github.com/dolan-in/reflectwalk v1.0.2-0.20210101124621-dc2073a29d71 // indirect + github.com/go-ini/ini v1.67.0 // indirect github.com/go-viper/mapstructure/v2 v2.2.1 // indirect + github.com/goccy/go-json v0.10.5 // indirect github.com/google/uuid v1.6.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 // indirect - github.com/minio/minio-go/v6 v6.0.57 // indirect - github.com/minio/sha256-simd v1.0.1 // indirect + github.com/minio/crc64nvme v1.0.1 // indirect + github.com/minio/minio-go/v7 v7.0.94 // indirect github.com/pelletier/go-toml/v2 v2.2.4 // indirect + github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c // indirect + github.com/rs/xid v1.6.0 // indirect github.com/sagikazarmark/locafero v0.9.0 // indirect github.com/sergi/go-diff v1.2.0 // indirect github.com/sourcegraph/conc v0.3.0 // indirect + github.com/tinylib/msgp v1.3.0 // indirect github.com/twpayne/go-geom v1.6.1 // indirect go.opentelemetry.io/auto/sdk v1.1.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0 // indirect @@ -41,7 +46,6 @@ require ( go.opentelemetry.io/proto/otlp v1.6.0 // indirect gonum.org/v1/gonum v0.12.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20250519155744-55703ea1f237 // indirect - gopkg.in/ini.v1 v1.67.0 // indirect ) require ( diff --git a/go.sum b/go.sum index a4b11b5..adee1f9 100644 --- a/go.sum +++ b/go.sum @@ -109,6 +109,10 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cockroachdb/datadriven v1.0.2 h1:H9MtNqVoVhvd9nCBwOyDjUEdZCREqbIdCJD93PBm/jA= github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/containerd/errdefs v1.0.0 h1:tg5yIfIlQIrxYtu9ajqY42W3lpS19XqdxRQeEwYG8PI= +github.com/containerd/errdefs v1.0.0/go.mod h1:+YBYIdtsnF4Iw6nWZhJcqGSg/dwvV7tyJ/kCkyJ2k+M= +github.com/containerd/errdefs/pkg v0.3.0 h1:9IKJ06FvyNlexW690DXuQNx2KA2cUJXx151Xdx3ZPPE= +github.com/containerd/errdefs/pkg v0.3.0/go.mod h1:NJw6s9HwNuRhnjJhM7pylWwMyAkmCQvQ4GpJHEqRLVk= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= @@ -118,8 +122,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgraph-io/badger/v4 v4.7.0 h1:Q+J8HApYAY7UMpL8d9owqiB+odzEc0zn/aqOD9jhc6Y= github.com/dgraph-io/badger/v4 v4.7.0/go.mod h1:He7TzG3YBy3j4f5baj5B7Zl2XyfNe5bl4Udl0aPemVA= -github.com/dgraph-io/dgo/v250 v250.0.0-preview4 h1:DkS6iFI6RwStXRzQxT5v8b6NLqqHQi0xKSK6FvcEwYo= -github.com/dgraph-io/dgo/v250 v250.0.0-preview4/go.mod h1:6nnKW4tYiai9xI6NSCrxaBgUGG1YI/+KlY+Tc7smqXY= +github.com/dgraph-io/dgo/v250 v250.0.0-preview4.0.20250619041351-4a519e53fb9d h1:9PLyvZY1Nih05g+2womk+kNnX3Gb20kx5BsK3foA5a8= +github.com/dgraph-io/dgo/v250 v250.0.0-preview4.0.20250619041351-4a519e53fb9d/go.mod h1:gLr7uM+x/8PjSQJ4Ca9kfQF15uBzruDzRK3bnELt3vE= github.com/dgraph-io/gqlgen v0.13.2 h1:TNhndk+eHKj5qE7BenKKSYdSIdOGhLqxR1rCiMso9KM= github.com/dgraph-io/gqlgen v0.13.2/go.mod h1:iCOrOv9lngN7KAo+jMgvUPVDlYHdf7qDwsTkQby2Sis= github.com/dgraph-io/gqlparser/v2 v2.1.1/go.mod h1:MYS4jppjyx8b9tuUtjV7jU1UFZK6P9fvO8TsIsQtRKU= @@ -138,8 +142,8 @@ github.com/dgryski/trifles v0.0.0-20230903005119-f50d829f2e54 h1:SG7nF6SRlWhcT7c github.com/dgryski/trifles v0.0.0-20230903005119-f50d829f2e54/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA= github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= -github.com/docker/docker v28.1.1+incompatible h1:49M11BFLsVO1gxY9UX9p/zwkE/rswggs8AdFmXQw51I= -github.com/docker/docker v28.1.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v28.2.2+incompatible h1:CjwRSksz8Yo4+RmQ339Dp/D2tGO5JxwYeqtMOEe0LDw= +github.com/docker/docker v28.2.2+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c= github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= @@ -148,7 +152,6 @@ github.com/dolan-in/dgman/v2 v2.1.0-preview2 h1:txflVWSbjgu6Q5Lhf4kImT4tM61Pu6JL github.com/dolan-in/dgman/v2 v2.1.0-preview2/go.mod h1:5OqMqJelDvhvdxgKc4CXkb7FApSJHhTxm79xZJsblOE= github.com/dolan-in/reflectwalk v1.0.2-0.20210101124621-dc2073a29d71 h1:v3bErDrPApxsyBlz8/8nFTCb7Ai0wecA8TokfEHIQ80= github.com/dolan-in/reflectwalk v1.0.2-0.20210101124621-dc2073a29d71/go.mod h1:Y9TyDkSL5jQ18ZnDaSxOdCUhbb5SCeamqYFQ7LYxxFs= -github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/eapache/go-resiliency v1.7.0 h1:n3NRTnBn5N0Cbi/IeOHuQn9s2UwVUH7Ga0ZWcP+9JTA= @@ -179,6 +182,8 @@ github.com/go-chi/chi v3.3.2+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxm github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-ini/ini v1.67.0 h1:z6ZrTEZqSWOTyH2FlglNbNgARyHG8oLW9gMELqKr06A= +github.com/go-ini/ini v1.67.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= github.com/go-jose/go-jose/v4 v4.1.0 h1:cYSYxd3pw5zd2FSXk2vGdn9igQU2PS8MuxrCOCl0FdY= github.com/go-jose/go-jose/v4 v4.1.0/go.mod h1:GG/vqmYm3Von2nYiB2vGTXzdoNKE5tix5tuc6iAd+sw= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= @@ -203,6 +208,8 @@ github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlnd github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM= github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.2.1/go.mod h1:hRKAFb8wOxFROYNsT1bqfWnhX+b5MFeJM9r2ZSwg/KY= +github.com/goccy/go-json v0.10.5 h1:Fq85nIqj+gXn/S5ahsiTlK3TmC85qgirsdTP/+DeaC4= +github.com/goccy/go-json v0.10.5/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= github.com/gogo/protobuf v1.0.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= @@ -288,7 +295,6 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v0.0.0-20160226214623-1ea25387ff6f/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/mux v1.6.1/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= @@ -327,8 +333,8 @@ github.com/hashicorp/vault/api v1.20.0 h1:KQMHElgudOsr+IbJgmbjHnCTxEpKs9LnozA1D3 github.com/hashicorp/vault/api v1.20.0/go.mod h1:GZ4pcjfzoOWpkJ3ijHNpEoAxKEsBJnVljyTe3jM2Sms= github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= -github.com/hypermodeinc/dgraph/v25 v25.0.0-preview4 h1:DMMm1o6B+8o9hlTvFgTyQndyQrQtr8t53+feJ5cbZoA= -github.com/hypermodeinc/dgraph/v25 v25.0.0-preview4/go.mod h1:qSZN3M4DdIiqUjfTMXLWuHSKEquYhhNyW4ebICN3fkM= +github.com/hypermodeinc/dgraph/v25 v25.0.0-preview6 h1:q9Prj7fVT3ZuFDAhcj4xqBPhFqZlJNbneIKeMaQI5qc= +github.com/hypermodeinc/dgraph/v25 v25.0.0-preview6/go.mod h1:nJUpUxtKOl0l7nA3+ImMRUdlrvJPizgtfBJw3b/VXEU= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20210905161508-09a460cdf81d/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w= github.com/ianlancetaylor/demangle v0.0.0-20230524184225-eabc099b10ab/go.mod h1:gx7rwoVhcfuVKG5uya9Hs3Sxj7EIvldVofAWIUtGouw= @@ -349,14 +355,12 @@ github.com/jcmturner/rpc/v2 v2.0.3/go.mod h1:VUJYCIDm3PVOEHw8sgt091/20OJjskO/YJk github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= @@ -366,7 +370,6 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo= github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ= -github.com/klauspost/cpuid v1.2.3/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/cpuid/v2 v2.0.1/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.0.3/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.2.10 h1:tBs3QSyvjDyFTq3uoc/9xFpCuOsJQFNPiAhYdw2skhE= @@ -395,14 +398,12 @@ github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Ky github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/minio/md5-simd v1.1.0/go.mod h1:XpBqgZULrMYD3R+M28PcmP0CkI7PEMzB3U77ZrKZ0Gw= +github.com/minio/crc64nvme v1.0.1 h1:DHQPrYPdqK7jQG/Ls5CTBZWeex/2FMS3G5XGkycuFrY= +github.com/minio/crc64nvme v1.0.1/go.mod h1:eVfm2fAzLlxMdUGc0EEBGSMmPwmXD5XiNRpnu9J3bvg= github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34= github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM= -github.com/minio/minio-go/v6 v6.0.57 h1:ixPkbKkyD7IhnluRgQpGSpHdpvNVaW6OD5R9IAO/9Tw= -github.com/minio/minio-go/v6 v6.0.57/go.mod h1:5+R/nM9Pwrh0vqF+HbYYDQ84wdUFPyXHkrdT4AIkifM= -github.com/minio/sha256-simd v0.1.1/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM= -github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM= -github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8= +github.com/minio/minio-go/v7 v7.0.94 h1:1ZoksIKPyaSt64AVOyaQvhDOgVC3MfZsWM6mZXRUGtM= +github.com/minio/minio-go/v7 v7.0.94/go.mod h1:71t2CqDt3ThzESgZUlU1rBN54mksGGlkLcFgguDnnAc= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/mapstructure v0.0.0-20180203102830-a4e142e9c047/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= @@ -433,6 +434,8 @@ github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFSt github.com/orisano/pixelmatch v0.0.0-20220722002657-fb0b55479cde/go.mod h1:nZgzbfBr3hhjoZnS66nKrHmduYNpc34ny7RK4z5/HM0= github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4= github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= +github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c h1:dAMKvw0MlJT1GshSTtih8C2gDs04w8dReiOGXrGLNoY= +github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c/go.mod h1:RqIHx9QI14HlwKwm98g9Re5prTQ6LdeRQn+gXJFxsJM= github.com/pierrec/lz4/v4 v4.1.22 h1:cKFw6uJDK+/gfw5BcDL0JL5aBsAFdsIT18eRtLj7VIU= github.com/pierrec/lz4/v4 v4.1.22/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -484,6 +487,8 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/rs/cors v1.6.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= +github.com/rs/xid v1.6.0 h1:fV591PaemRlL6JfRxGDEPl69wICngIQ3shQtzfy2gxU= +github.com/rs/xid v1.6.0/go.mod h1:7XoLgs4eV+QndskICGsho+ADou8ySMSjJKDIan90Nz0= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/go-glob v1.0.0 h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkBk= @@ -498,10 +503,7 @@ github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeV github.com/shurcooL/vfsgen v0.0.0-20180121065927-ffb13db8def0/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.5.0/go.mod h1:+F7Ogzej0PZc/94MaYx/nvG9jOFMD2osvC3s+Squfpo= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.5 h1:jjzc5WVemNEDTLwv9tlmemhC73tI08BNOIGwBOo10Js= github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= @@ -535,6 +537,8 @@ github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf github.com/stvp/go-udp-testing v0.0.0-20201019212854-469649b16807/go.mod h1:7jxmlfBCDBXRzr0eAQJ48XC1hBu1np4CS5+cHEYfwpc= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= +github.com/tinylib/msgp v1.3.0 h1:ULuf7GPooDaIlbyvgAxBV/FI7ynli6LZ1/nVUNu+0ww= +github.com/tinylib/msgp v1.3.0/go.mod h1:ykjzy2wzgrlvpDCRc4LA8UXy6D8bzMSuAF3WD57Gok0= github.com/twpayne/go-geom v1.6.1 h1:iLE+Opv0Ihm/ABIcvQFGIiFBXd76oBIar9drAwHFhR4= github.com/twpayne/go-geom v1.6.1/go.mod h1:Kr+Nly6BswFsKM5sd31YaoWS5PeDDH2NftJTK7Gd028= github.com/urfave/cli/v2 v2.1.1/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ= @@ -596,7 +600,6 @@ go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -652,7 +655,6 @@ golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -786,7 +788,6 @@ golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3 golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190515012406-7d7faa4812bd/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= @@ -930,9 +931,6 @@ gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= -gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= From 9411cadd7acc605813670e1a2355ba66fa0d2e6d Mon Sep 17 00:00:00 2001 From: Matthew McNeely Date: Mon, 14 Jul 2025 20:34:23 -0400 Subject: [PATCH 20/20] Update documentation for `CacheSizeMB` --- client.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client.go b/client.go index 9c194ea..a38d222 100644 --- a/client.go +++ b/client.go @@ -143,7 +143,10 @@ func WithMaxEdgeTraversal(max int) ClientOpt { } } -// WithCacheSizeMB sets the memory cache size in MB (only applicable for embedded databases) +// WithCacheSizeMB sets the memory cache size in MB (only applicable for embedded databases). +// A good starting point for a system with a moderate amount of RAM (e.g., 8-16GB) would be +// between 256 MB and 1 GB. Dgraph itself often defaults to a 1GB cache. In order to minimize +// resource usage sans configuration, the default is set to 64 MB. func WithCacheSizeMB(size int) ClientOpt { return func(o *clientOptions) { o.cacheSizeMB = size