@@ -22,6 +22,7 @@ import (
2222 barmancloudv1 "github.com/cloudnative-pg/plugin-barman-cloud/api/v1"
2323)
2424
25+ // WALServiceImplementation is the implementation of the WAL Service
2526type WALServiceImplementation struct {
2627 BarmanObjectKey client.ObjectKey
2728 ClusterObjectKey client.ObjectKey
@@ -33,7 +34,11 @@ type WALServiceImplementation struct {
3334 wal.UnimplementedWALServer
3435}
3536
36- func (w WALServiceImplementation ) GetCapabilities (ctx context.Context , request * wal.WALCapabilitiesRequest ) (* wal.WALCapabilitiesResult , error ) {
37+ // GetCapabilities implements the WALService interface
38+ func (w WALServiceImplementation ) GetCapabilities (
39+ _ context.Context ,
40+ _ * wal.WALCapabilitiesRequest ,
41+ ) (* wal.WALCapabilitiesResult , error ) {
3742 return & wal.WALCapabilitiesResult {
3843 Capabilities : []* wal.WALCapability {
3944 {
@@ -54,7 +59,11 @@ func (w WALServiceImplementation) GetCapabilities(ctx context.Context, request *
5459 }, nil
5560}
5661
57- func (w WALServiceImplementation ) Archive (ctx context.Context , request * wal.WALArchiveRequest ) (* wal.WALArchiveResult , error ) {
62+ // Archive implements the WALService interface
63+ func (w WALServiceImplementation ) Archive (
64+ ctx context.Context ,
65+ request * wal.WALArchiveRequest ,
66+ ) (* wal.WALArchiveResult , error ) {
5867 var objectStore barmancloudv1.ObjectStore
5968 if err := w .Client .Get (ctx , w .BarmanObjectKey , & objectStore ); err != nil {
6069 return nil , err
@@ -90,7 +99,11 @@ func (w WALServiceImplementation) Archive(ctx context.Context, request *wal.WALA
9099 return & wal.WALArchiveResult {}, nil
91100}
92101
93- func (w WALServiceImplementation ) Restore (ctx context.Context , request * wal.WALRestoreRequest ) (* wal.WALRestoreResult , error ) {
102+ // Restore implements the WALService interface
103+ func (w WALServiceImplementation ) Restore (
104+ ctx context.Context ,
105+ request * wal.WALRestoreRequest ,
106+ ) (* wal.WALRestoreResult , error ) {
94107 contextLogger := log .FromContext (ctx )
95108 startTime := time .Now ()
96109
@@ -181,7 +194,7 @@ func (w WALServiceImplementation) Restore(ctx context.Context, request *wal.WALR
181194 return nil , walStatus [0 ].Err
182195 }
183196
184- //We skip this step if streaming connection is not available
197+ // We skip this step if streaming connection is not available
185198 endOfWALStream := isEndOfWALStream (walStatus )
186199 if isStreamingAvailable (cluster , w .InstanceName ) && endOfWALStream {
187200 contextLogger .Info (
@@ -213,12 +226,20 @@ func (w WALServiceImplementation) Restore(ctx context.Context, request *wal.WALR
213226 return & wal.WALRestoreResult {}, nil
214227}
215228
216- func (w WALServiceImplementation ) Status (ctx context.Context , request * wal.WALStatusRequest ) (* wal.WALStatusResult , error ) {
229+ // Status implements the WALService interface
230+ func (w WALServiceImplementation ) Status (
231+ _ context.Context ,
232+ _ * wal.WALStatusRequest ,
233+ ) (* wal.WALStatusResult , error ) {
217234 // TODO implement me
218235 panic ("implement me" )
219236}
220237
221- func (w WALServiceImplementation ) SetFirstRequired (ctx context.Context , request * wal.SetFirstRequiredRequest ) (* wal.SetFirstRequiredResult , error ) {
238+ // SetFirstRequired implements the WALService interface
239+ func (w WALServiceImplementation ) SetFirstRequired (
240+ _ context.Context ,
241+ _ * wal.SetFirstRequiredRequest ,
242+ ) (* wal.SetFirstRequiredResult , error ) {
222243 // TODO implement me
223244 panic ("implement me" )
224245}
@@ -325,7 +346,7 @@ func gatherWALFilesToRestore(walName string, parallel int) (walList []string, er
325346 return walList , err
326347}
327348
328- // ErrEndOfWALStreamReached is returned when end of WAL is detected in the cloud archive
349+ // ErrEndOfWALStreamReached is returned when end of WAL is detected in the cloud archive.
329350var ErrEndOfWALStreamReached = errors .New ("end of WAL reached" )
330351
331352// checkEndOfWALStreamFlag returns ErrEndOfWALStreamReached if the flag is set in the restorer.
0 commit comments