Skip to content

Commit

Permalink
Add store mock
Browse files Browse the repository at this point in the history
  • Loading branch information
eminano committed Oct 2, 2024
1 parent ccf445a commit fb7ed79
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions pkg/snapshot/store/mocks/mock_snapshot_store.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// SPDX-License-Identifier: Apache-2.0

package mocks

import (
"context"

"github.com/xataio/pgstream/pkg/snapshot"
)

type Store struct {
CreateSnapshotRequestFn func(context.Context, *snapshot.Snapshot) error
UpdateSnapshotRequestFn func(context.Context, *snapshot.Snapshot) error
GetSnapshotRequestsFn func(ctx context.Context, status snapshot.Status) ([]*snapshot.Snapshot, error)
}

func (m *Store) CreateSnapshotRequest(ctx context.Context, s *snapshot.Snapshot) error {
return m.CreateSnapshotRequestFn(ctx, s)
}

Check failure on line 19 in pkg/snapshot/store/mocks/mock_snapshot_store.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gofumpt`-ed (gofumpt)
func (m *Store) UpdateSnapshotRequest(ctx context.Context, s *snapshot.Snapshot) error {
return m.UpdateSnapshotRequestFn(ctx, s)
}

Check failure on line 22 in pkg/snapshot/store/mocks/mock_snapshot_store.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gofumpt`-ed (gofumpt)
func (m *Store) GetSnapshotRequests(ctx context.Context, status snapshot.Status) ([]*snapshot.Snapshot, error) {
return m.GetSnapshotRequestsFn(ctx, status)
}

0 comments on commit fb7ed79

Please sign in to comment.