Repository: codenotary/immudb
File: pkg/client/clienttest/immuclient_mock.go (Go)

Code before:
You may obtain a copy of the License at

	http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

// Package clienttest ...
package clienttest

import (
	"context"
	"io"

	"github.com/codenotary/immudb/pkg/api/schema"
	"github.com/codenotary/immudb/pkg/client"
	immuclient "github.com/codenotary/immudb/pkg/client"
	"google.golang.org/grpc"
)

var (
	_ client.ImmuClient = &ImmuClientMock{}
)

// ImmuClientMock ...
type ImmuClientMock struct {
	immuclient.ImmuClient

	GetOptionsF           func() *client.Options
	IsConnectedF          func() bool
	HealthCheckF          func(context.Context) error
	WaitForHealthCheckF   func(context.Context) error
	ConnectF              func(context.Context) (*grpc.ClientConn, error)
	DisconnectF           func() error
	LoginF                func(context.Context, []byte, []byte) (*schema.LoginResponse, error)
	LogoutF               func(context.Context) error
	VerifiedGetF          func(context.Context, []byte, ...client.GetOption) (*schema.Entry, error)
	VerifiedGetAtF        func(context.Context, []byte, uint64) (*schema.Entry, error)
	VerifiedSetF          func(context.Context, []byte, []byte) (*schema.TxHeader, error)
	SetF                  func(context.Context, []byte, []byte) (*schema.TxHeader, error)
	SetReferenceF         func(context.Context, []byte, []byte, uint64) (*schema.TxHeader, error)
	VerifiedSetReferenceF func(context.Context, []byte, []byte, uint64) (*schema.TxHeader, error)
	ZAddF                 func(context.Context, []byte, float64, []byte, uint64) (*schema.TxHeader, error)
	VerifiedZAddF         func(context.Context, []byte, float64, []byte, uint64) (*schema.TxHeader, error)
	HistoryF              func(context.Context, *schema.HistoryRequest) (*schema.Entries, error)
	UseDatabaseF          func(context.Context, *schema.Database) (*schema.UseDatabaseReply, error)
	DumpF                 func(context.Context, io.WriteSeeker) (int64, error)

Review comment (suggestion):
```suggestion
	_ client.ImmuClient = (*ImmuClientMock)(nil)
```

Code after:
You may obtain a copy of the License at

	http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

// Package clienttest ...
package clienttest

import (
	"context"
	"io"

	"github.com/codenotary/immudb/pkg/api/schema"
	"github.com/codenotary/immudb/pkg/client"
	immuclient "github.com/codenotary/immudb/pkg/client"
	"google.golang.org/grpc"
)

var (
	_ client.ImmuClient = (*ImmuClientMock)(nil)
)

// ImmuClientMock ...
type ImmuClientMock struct {
	immuclient.ImmuClient

	GetOptionsF           func() *client.Options
	IsConnectedF          func() bool
	HealthCheckF          func(context.Context) error
	WaitForHealthCheckF   func(context.Context) error
	ConnectF              func(context.Context) (*grpc.ClientConn, error)
	DisconnectF           func() error
	LoginF                func(context.Context, []byte, []byte) (*schema.LoginResponse, error)
	LogoutF               func(context.Context) error
	VerifiedGetF          func(context.Context, []byte, ...client.GetOption) (*schema.Entry, error)
	VerifiedGetAtF        func(context.Context, []byte, uint64) (*schema.Entry, error)
	VerifiedSetF          func(context.Context, []byte, []byte) (*schema.TxHeader, error)
	SetF                  func(context.Context, []byte, []byte) (*schema.TxHeader, error)
	SetReferenceF         func(context.Context, []byte, []byte, uint64) (*schema.TxHeader, error)
	VerifiedSetReferenceF func(context.Context, []byte, []byte, uint64) (*schema.TxHeader, error)
	ZAddF                 func(context.Context, []byte, float64, []byte, uint64) (*schema.TxHeader, error)
	VerifiedZAddF         func(context.Context, []byte, float64, []byte, uint64) (*schema.TxHeader, error)
	HistoryF              func(context.Context, *schema.HistoryRequest) (*schema.Entries, error)
	UseDatabaseF          func(context.Context, *schema.Database) (*schema.UseDatabaseReply, error)
	DumpF                 func(context.Context, io.WriteSeeker) (int64, error)