@@ -17,7 +17,7 @@ import (
1717 "code.cloudfoundry.org/tlsconfig"
1818
1919 "code.cloudfoundry.org/go-envstruct"
20- . "code.cloudfoundry.org/log-cache/internal/cache"
20+ "code.cloudfoundry.org/log-cache/internal/cache"
2121 "code.cloudfoundry.org/log-cache/internal/plumbing"
2222 "google.golang.org/grpc"
2323 "google.golang.org/grpc/credentials"
@@ -89,17 +89,17 @@ func main() {
8989 }
9090 }(time .Now ())
9191
92- logCacheOptions := []LogCacheOption {
93- WithAddr (cfg .Addr ),
94- WithMemoryLimitPercent (float64 (cfg .MemoryLimitPercent )),
95- WithMemoryLimit (cfg .MemoryLimit ),
96- WithMaxPerSource (cfg .MaxPerSource ),
97- WithQueryTimeout (cfg .QueryTimeout ),
98- WithTruncationInterval (cfg .TruncationInterval ),
99- WithPrunesPerGC (cfg .PrunesPerGC ),
100- WithIngressBufferSize (cfg .IngressBufferSize ),
101- WithIngressBufferReadBatchSize (cfg .IngressBufferReadBatchSize ),
102- WithIngressBufferReadBatchInterval (cfg .IngressBufferReadBatchInterval ),
92+ logCacheOptions := []cache. LogCacheOption {
93+ cache . WithAddr (cfg .Addr ),
94+ cache . WithMemoryLimitPercent (float64 (cfg .MemoryLimitPercent )),
95+ cache . WithMemoryLimit (cfg .MemoryLimit ),
96+ cache . WithMaxPerSource (cfg .MaxPerSource ),
97+ cache . WithQueryTimeout (cfg .QueryTimeout ),
98+ cache . WithTruncationInterval (cfg .TruncationInterval ),
99+ cache . WithPrunesPerGC (cfg .PrunesPerGC ),
100+ cache . WithIngressBufferSize (cfg .IngressBufferSize ),
101+ cache . WithIngressBufferReadBatchSize (cfg .IngressBufferReadBatchSize ),
102+ cache . WithIngressBufferReadBatchInterval (cfg .IngressBufferReadBatchInterval ),
103103 }
104104 var transport grpc.DialOption
105105 if cfg .TLS .HasAnyCredential () {
@@ -125,24 +125,24 @@ func main() {
125125 if err != nil {
126126 panic (err )
127127 }
128- logCacheOptions = append (logCacheOptions , WithServerOpts (grpc .Creds (credentials .NewTLS (tlsConfigServer )), grpc .MaxRecvMsgSize (50 * 1024 * 1024 )))
128+ logCacheOptions = append (logCacheOptions , cache . WithServerOpts (grpc .Creds (credentials .NewTLS (tlsConfigServer )), grpc .MaxRecvMsgSize (50 * 1024 * 1024 )))
129129 } else {
130130 transport = grpc .WithTransportCredentials (insecure .NewCredentials ())
131131 }
132- logCacheOptions = append (logCacheOptions , WithClustered (
132+ logCacheOptions = append (logCacheOptions , cache . WithClustered (
133133 cfg .NodeIndex ,
134134 cfg .NodeAddrs ,
135135 transport ,
136136 grpc .WithDefaultCallOptions (grpc .MaxCallRecvMsgSize (50 * 1024 * 1024 )),
137137 ))
138138
139- cache := New (
139+ lc := cache . New (
140140 m ,
141141 logger ,
142142 logCacheOptions ... ,
143143 )
144144
145- cache .Start ()
145+ lc .Start ()
146146 waitForTermination ()
147147}
148148
0 commit comments