summaryrefslogtreecommitdiff
path: root/vendor/codeberg.org/gruf
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/codeberg.org/gruf')
-rw-r--r--vendor/codeberg.org/gruf/go-mangler/helpers.go4
-rw-r--r--vendor/codeberg.org/gruf/go-structr/cache.go38
-rw-r--r--vendor/codeberg.org/gruf/go-structr/index.go8
-rw-r--r--vendor/codeberg.org/gruf/go-structr/item.go6
-rw-r--r--vendor/codeberg.org/gruf/go-structr/key.go2
-rw-r--r--vendor/codeberg.org/gruf/go-structr/queue.go22
-rw-r--r--vendor/codeberg.org/gruf/go-structr/queue_ctx.go2
-rw-r--r--vendor/codeberg.org/gruf/go-structr/runtime.go8
8 files changed, 45 insertions, 45 deletions
diff --git a/vendor/codeberg.org/gruf/go-mangler/helpers.go b/vendor/codeberg.org/gruf/go-mangler/helpers.go
index 26d31152b..4e37e1344 100644
--- a/vendor/codeberg.org/gruf/go-mangler/helpers.go
+++ b/vendor/codeberg.org/gruf/go-mangler/helpers.go
@@ -69,7 +69,7 @@ func deref_ptr_mangler(ctx typecontext, mangle Mangler, n uint) Mangler {
}
if ptr == nil {
- // Check for nil values
+ // Final nil val check
buf = append(buf, '0')
return buf
}
@@ -144,8 +144,8 @@ func iter_struct_mangler(ctx typecontext, manglers []Mangler) Mangler {
}
type field struct {
- offset uintptr
mangle Mangler
+ offset uintptr
}
// Bundle together the fields and manglers.
diff --git a/vendor/codeberg.org/gruf/go-structr/cache.go b/vendor/codeberg.org/gruf/go-structr/cache.go
index c16bf48c8..8fcd4fec4 100644
--- a/vendor/codeberg.org/gruf/go-structr/cache.go
+++ b/vendor/codeberg.org/gruf/go-structr/cache.go
@@ -20,17 +20,6 @@ func DefaultIgnoreErr(err error) bool {
// for initializing a struct cache.
type CacheConfig[StructType any] struct {
- // Indices defines indices to create
- // in the Cache for the receiving
- // generic struct type parameter.
- Indices []IndexConfig
-
- // MaxSize defines the maximum number
- // of items allowed in the Cache at
- // one time, before old items start
- // getting evicted.
- MaxSize int
-
// IgnoreErr defines which errors to
// ignore (i.e. not cache) returned
// from load function callback calls.
@@ -48,6 +37,17 @@ type CacheConfig[StructType any] struct {
// as the values passed to Put() / Store(),
// or by the keys by calls to Invalidate().
Invalidate func(StructType)
+
+ // Indices defines indices to create
+ // in the Cache for the receiving
+ // generic struct type parameter.
+ Indices []IndexConfig
+
+ // MaxSize defines the maximum number
+ // of items allowed in the Cache at
+ // one time, before old items start
+ // getting evicted.
+ MaxSize int
}
// Cache provides a structure cache with automated
@@ -56,24 +56,24 @@ type CacheConfig[StructType any] struct {
// of negative results (errors!) returned by LoadOne().
type Cache[StructType any] struct {
- // indices used in storing passed struct
- // types by user defined sets of fields.
- indices []Index
+ // hook functions.
+ ignore func(error) bool
+ copy func(StructType) StructType
+ invalid func(StructType)
// keeps track of all indexed items,
// in order of last recently used (LRU).
lru list
+ // indices used in storing passed struct
+ // types by user defined sets of fields.
+ indices []Index
+
// max cache size, imposes size
// limit on the lruList in order
// to evict old entries.
maxSize int
- // hook functions.
- ignore func(error) bool
- copy func(StructType) StructType
- invalid func(StructType)
-
// protective mutex, guards:
// - Cache{}.lruList
// - Index{}.data
diff --git a/vendor/codeberg.org/gruf/go-structr/index.go b/vendor/codeberg.org/gruf/go-structr/index.go
index b1e05b9b9..8605cdb25 100644
--- a/vendor/codeberg.org/gruf/go-structr/index.go
+++ b/vendor/codeberg.org/gruf/go-structr/index.go
@@ -349,15 +349,15 @@ type index_entry struct {
// elem.data is ptr to index_entry.
elem list_elem
- // raw cache key
- // for this entry.
- key string
-
// index this is stored in.
index *Index
// underlying indexed item.
item *indexed_item
+
+ // raw cache key
+ // for this entry.
+ key string
}
var index_entry_pool sync.Pool
diff --git a/vendor/codeberg.org/gruf/go-structr/item.go b/vendor/codeberg.org/gruf/go-structr/item.go
index 9e837e157..97079c378 100644
--- a/vendor/codeberg.org/gruf/go-structr/item.go
+++ b/vendor/codeberg.org/gruf/go-structr/item.go
@@ -10,12 +10,12 @@ type indexed_item struct {
// is stored in a main list.
elem list_elem
+ // cached data with type.
+ data interface{}
+
// indexed stores the indices
// this item is stored under.
indexed []*index_entry
-
- // cached data with type.
- data interface{}
}
var indexed_item_pool sync.Pool
diff --git a/vendor/codeberg.org/gruf/go-structr/key.go b/vendor/codeberg.org/gruf/go-structr/key.go
index 099f70f99..65bdba455 100644
--- a/vendor/codeberg.org/gruf/go-structr/key.go
+++ b/vendor/codeberg.org/gruf/go-structr/key.go
@@ -10,8 +10,8 @@ import (
// lookup (potentially) stored
// entries in an Index.
type Key struct {
- raw []any
key string
+ raw []any
}
// Key returns the underlying cache key string.
diff --git a/vendor/codeberg.org/gruf/go-structr/queue.go b/vendor/codeberg.org/gruf/go-structr/queue.go
index 1c49edbb1..f48d1530c 100644
--- a/vendor/codeberg.org/gruf/go-structr/queue.go
+++ b/vendor/codeberg.org/gruf/go-structr/queue.go
@@ -10,15 +10,15 @@ import (
// for initializing a struct queue.
type QueueConfig[StructType any] struct {
- // Indices defines indices to create
- // in the Queue for the receiving
- // generic struct parameter type.
- Indices []IndexConfig
-
// Pop is called when queue values
// are popped, during calls to any
// of the Pop___() series of fns.
Pop func(StructType)
+
+ // Indices defines indices to create
+ // in the Queue for the receiving
+ // generic struct parameter type.
+ Indices []IndexConfig
}
// Queue provides a structure model queue with
@@ -26,17 +26,17 @@ type QueueConfig[StructType any] struct {
// defined lookups of field combinations.
type Queue[StructType any] struct {
- // indices used in storing passed struct
- // types by user defined sets of fields.
- indices []Index
+ // hook functions.
+ copy func(StructType) StructType
+ pop func(StructType)
// main underlying
// struct item queue.
queue list
- // hook functions.
- copy func(StructType) StructType
- pop func(StructType)
+ // indices used in storing passed struct
+ // types by user defined sets of fields.
+ indices []Index
// protective mutex, guards:
// - Queue{}.queue
diff --git a/vendor/codeberg.org/gruf/go-structr/queue_ctx.go b/vendor/codeberg.org/gruf/go-structr/queue_ctx.go
index 5431b8947..1dac46349 100644
--- a/vendor/codeberg.org/gruf/go-structr/queue_ctx.go
+++ b/vendor/codeberg.org/gruf/go-structr/queue_ctx.go
@@ -6,8 +6,8 @@ import (
// QueueCtx is a context-aware form of Queue{}.
type QueueCtx[StructType any] struct {
- Queue[StructType]
ch chan struct{}
+ Queue[StructType]
}
// PopFront pops the current value at front of the queue, else blocking on ctx.
diff --git a/vendor/codeberg.org/gruf/go-structr/runtime.go b/vendor/codeberg.org/gruf/go-structr/runtime.go
index 4d76a0d74..44fdd74a7 100644
--- a/vendor/codeberg.org/gruf/go-structr/runtime.go
+++ b/vendor/codeberg.org/gruf/go-structr/runtime.go
@@ -16,10 +16,6 @@ import (
type struct_field struct {
rtype reflect.Type
- // offsets defines whereabouts in
- // memory this field is located.
- offsets []next_offset
-
// struct field type mangling
// (i.e. fast serializing) fn.
mangle mangler.Mangler
@@ -33,6 +29,10 @@ type struct_field struct {
// if set this indicates zero
// values of field not allowed
zerostr string
+
+ // offsets defines whereabouts in
+ // memory this field is located.
+ offsets []next_offset
}
// next_offset defines a next offset location