@@ -61,6 +61,44 @@ func WithPreAllocCacheNumNodes(n int) ChanGraphOption {
61
61
}
62
62
}
63
63
64
+ // SQLStoreOptions holds parameters for tuning and customizing a SQLStore
65
+ // instance.
66
+ type SQLStoreOptions struct {
67
+ // RejectCacheSize is the maximum number of rejectCacheEntries to hold
68
+ // in the rejection cache.
69
+ RejectCacheSize int
70
+
71
+ // ChannelCacheSize is the maximum number of ChannelEdges to hold in the
72
+ // channel cache.
73
+ ChannelCacheSize int
74
+ }
75
+
76
+ // DefaultSQLOptions returns a SQLStoreOptions populated with default values.
77
+ func DefaultSQLOptions () * SQLStoreOptions {
78
+ return & SQLStoreOptions {
79
+ RejectCacheSize : DefaultRejectCacheSize ,
80
+ ChannelCacheSize : DefaultChannelCacheSize ,
81
+ }
82
+ }
83
+
84
+ // SQLStoreOption defines the function signature for a functional option
85
+ // that can be used to customize a SQLStoreOptions instance.
86
+ type SQLStoreOption func (* SQLStoreOptions )
87
+
88
+ // WithSQLStoreRejectCacheSize sets the RejectCacheSize to n.
89
+ func WithSQLStoreRejectCacheSize (n int ) SQLStoreOption {
90
+ return func (o * SQLStoreOptions ) {
91
+ o .RejectCacheSize = n
92
+ }
93
+ }
94
+
95
+ // WithSQLStoreChannelCacheSize sets the ChannelCacheSize to n.
96
+ func WithSQLStoreChannelCacheSize (n int ) SQLStoreOption {
97
+ return func (o * SQLStoreOptions ) {
98
+ o .ChannelCacheSize = n
99
+ }
100
+ }
101
+
64
102
// KVStoreOptions holds parameters for tuning and customizing a graph.DB.
65
103
type KVStoreOptions struct {
66
104
// RejectCacheSize is the maximum number of rejectCacheEntries to hold
0 commit comments