clienttest

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 10, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package clienttest ...

Package clienttest ...

Package clienttest ...

Package clienttest ...

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HomedirServiceMock

type HomedirServiceMock struct {
	client.HomedirService
	WriteFileToUserHomeDirF    func(content []byte, pathToFile string) error
	FileExistsInUserHomeDirF   func(pathToFile string) (bool, error)
	ReadFileFromUserHomeDirF   func(pathToFile string) (string, error)
	DeleteFileFromUserHomeDirF func(pathToFile string) error
}

HomedirServiceMock ...

func DefaultHomedirServiceMock

func DefaultHomedirServiceMock() *HomedirServiceMock

DefaultHomedirServiceMock ...

func (*HomedirServiceMock) DeleteFileFromUserHomeDir

func (h *HomedirServiceMock) DeleteFileFromUserHomeDir(pathToFile string) error

DeleteFileFromUserHomeDir ...

func (*HomedirServiceMock) FileExistsInUserHomeDir

func (h *HomedirServiceMock) FileExistsInUserHomeDir(pathToFile string) (bool, error)

FileExistsInUserHomeDir ...

func (*HomedirServiceMock) ReadFileFromUserHomeDir

func (h *HomedirServiceMock) ReadFileFromUserHomeDir(pathToFile string) (string, error)

ReadFileFromUserHomeDir ...

func (*HomedirServiceMock) WriteFileToUserHomeDir

func (h *HomedirServiceMock) WriteFileToUserHomeDir(content []byte, pathToFile string) error

WriteFileToUserHomeDir ...

type 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
	SafeGetF            func(context.Context, []byte, ...grpc.CallOption) (*client.VerifiedItem, error)
	SafeSetF            func(context.Context, []byte, []byte) (*client.VerifiedIndex, error)
	SetF                func(context.Context, []byte, []byte) (*schema.Index, error)
	ReferenceF          func(context.Context, []byte, []byte) (*schema.Index, error)
	SafeReferenceF      func(context.Context, []byte, []byte) (*client.VerifiedIndex, error)
	ZAddF               func(context.Context, []byte, float64, []byte) (*schema.Index, error)
	SafeZAddF           func(context.Context, []byte, float64, []byte) (*client.VerifiedIndex, error)
	HistoryF            func(context.Context, []byte) (*schema.StructuredItemList, error)
	UseDatabaseF        func(context.Context, *schema.Database) (*schema.UseDatabaseReply, error)
	DumpF               func(context.Context, io.WriteSeeker) (int64, error)
	CurrentRootF        func(context.Context) (*schema.Root, error)
	ByIndexF            func(context.Context, uint64) (*schema.StructuredItem, error)
	GetF                func(context.Context, []byte) (*schema.StructuredItem, error)
	RawSafeGetF         func(context.Context, []byte, ...grpc.CallOption) (vi *client.VerifiedItem, err error)
	RawBySafeIndexF     func(context.Context, uint64) (*client.VerifiedItem, error)
	ListUsersF          func(context.Context) (*schema.UserList, error)
	SetActiveUserF      func(context.Context, *schema.SetActiveUserRequest) error
	ChangePermissionF   func(context.Context, schema.PermissionAction, string, string, uint32) error
	ZScanF              func(context.Context, []byte) (*schema.StructuredItemList, error)
	IScanF              func(context.Context, uint64, uint64) (*schema.SPage, error)
	ScanF               func(context.Context, []byte) (*schema.StructuredItemList, error)
	CountF              func(context.Context, []byte) (*schema.ItemsCount, error)
	RawSafeSetF         func(context.Context, []byte, []byte) (vi *client.VerifiedIndex, err error)
	CreateDatabaseF     func(context.Context, *schema.Database) error
	DatabaseListF       func(context.Context) (*schema.DatabaseListResponse, error)
	ChangePasswordF     func(context.Context, []byte, []byte, []byte) error
	CreateUserF         func(context.Context, []byte, []byte, uint32, string) error
}

ImmuClientMock ...

func (*ImmuClientMock) ByIndex

func (icm *ImmuClientMock) ByIndex(ctx context.Context, index uint64) (*schema.StructuredItem, error)

ByIndex ...

func (*ImmuClientMock) ChangePassword

func (icm *ImmuClientMock) ChangePassword(ctx context.Context, user []byte, oldPass []byte, newPass []byte) error

ChangePassword ...

func (*ImmuClientMock) ChangePermission

func (icm *ImmuClientMock) ChangePermission(ctx context.Context, action schema.PermissionAction, username string, database string, permissions uint32) error

ChangePermission ...

func (*ImmuClientMock) Connect

func (icm *ImmuClientMock) Connect(ctx context.Context) (clientConn *grpc.ClientConn, err error)

Connect ...

func (*ImmuClientMock) Count

func (icm *ImmuClientMock) Count(ctx context.Context, prefix []byte) (*schema.ItemsCount, error)

Count ...

func (*ImmuClientMock) CreateDatabase

func (icm *ImmuClientMock) CreateDatabase(ctx context.Context, db *schema.Database) error

CreateDatabase ...

func (*ImmuClientMock) CreateUser

func (icm *ImmuClientMock) CreateUser(ctx context.Context, user []byte, pass []byte, permission uint32, databasename string) error

CreateUser ...

func (*ImmuClientMock) CurrentRoot

func (icm *ImmuClientMock) CurrentRoot(ctx context.Context) (*schema.Root, error)

CurrentRoot ...

func (*ImmuClientMock) DatabaseList

func (icm *ImmuClientMock) DatabaseList(ctx context.Context) (*schema.DatabaseListResponse, error)

DatabaseList ...

func (*ImmuClientMock) Disconnect

func (icm *ImmuClientMock) Disconnect() error

Disconnect ...

func (*ImmuClientMock) Dump

func (icm *ImmuClientMock) Dump(ctx context.Context, writer io.WriteSeeker) (int64, error)

Dump ...

func (*ImmuClientMock) Get

func (icm *ImmuClientMock) Get(ctx context.Context, key []byte) (*schema.StructuredItem, error)

Get ...

func (*ImmuClientMock) GetOptions

func (icm *ImmuClientMock) GetOptions() *client.Options

GetOptions ...

func (*ImmuClientMock) HealthCheck

func (icm *ImmuClientMock) HealthCheck(ctx context.Context) error

HealthCheck ...

func (*ImmuClientMock) History

func (icm *ImmuClientMock) History(ctx context.Context, key []byte) (*schema.StructuredItemList, error)

History ...

func (*ImmuClientMock) IScan

func (icm *ImmuClientMock) IScan(ctx context.Context, pageNumber uint64, pageSize uint64) (*schema.SPage, error)

IScan ...

func (*ImmuClientMock) IsConnected

func (icm *ImmuClientMock) IsConnected() bool

IsConnected ...

func (*ImmuClientMock) ListUsers

func (icm *ImmuClientMock) ListUsers(ctx context.Context) (*schema.UserList, error)

ListUsers ...

func (*ImmuClientMock) Login

func (icm *ImmuClientMock) Login(ctx context.Context, user []byte, pass []byte) (*schema.LoginResponse, error)

Login ...

func (*ImmuClientMock) Logout

func (icm *ImmuClientMock) Logout(ctx context.Context) error

Logout ...

func (*ImmuClientMock) RawBySafeIndex

func (icm *ImmuClientMock) RawBySafeIndex(ctx context.Context, index uint64) (*client.VerifiedItem, error)

RawBySafeIndex ...

func (*ImmuClientMock) RawSafeGet

func (icm *ImmuClientMock) RawSafeGet(ctx context.Context, key []byte, opts ...grpc.CallOption) (vi *client.VerifiedItem, err error)

RawSafeGet ...

func (*ImmuClientMock) RawSafeSet

func (icm *ImmuClientMock) RawSafeSet(ctx context.Context, key []byte, value []byte) (vi *client.VerifiedIndex, err error)

RawSafeSet ...

func (*ImmuClientMock) Reference

func (icm *ImmuClientMock) Reference(ctx context.Context, reference []byte, key []byte) (*schema.Index, error)

Reference ...

func (*ImmuClientMock) SafeGet

func (icm *ImmuClientMock) SafeGet(ctx context.Context, key []byte, opts ...grpc.CallOption) (*client.VerifiedItem, error)

SafeGet ...

func (*ImmuClientMock) SafeReference

func (icm *ImmuClientMock) SafeReference(ctx context.Context, reference []byte, key []byte) (*client.VerifiedIndex, error)

SafeReference ...

func (*ImmuClientMock) SafeSet

func (icm *ImmuClientMock) SafeSet(ctx context.Context, key []byte, value []byte) (*client.VerifiedIndex, error)

SafeSet ...

func (*ImmuClientMock) SafeZAdd

func (icm *ImmuClientMock) SafeZAdd(ctx context.Context, set []byte, score float64, key []byte) (*client.VerifiedIndex, error)

SafeZAdd ...

func (*ImmuClientMock) Scan

func (icm *ImmuClientMock) Scan(ctx context.Context, prefix []byte) (*schema.StructuredItemList, error)

Scan ...

func (*ImmuClientMock) Set

func (icm *ImmuClientMock) Set(ctx context.Context, key []byte, value []byte) (*schema.Index, error)

Set ...

func (*ImmuClientMock) SetActiveUser

func (icm *ImmuClientMock) SetActiveUser(ctx context.Context, u *schema.SetActiveUserRequest) error

SetActiveUser ...

func (*ImmuClientMock) UseDatabase

func (icm *ImmuClientMock) UseDatabase(ctx context.Context, d *schema.Database) (*schema.UseDatabaseReply, error)

UseDatabase ...

func (*ImmuClientMock) WaitForHealthCheck

func (icm *ImmuClientMock) WaitForHealthCheck(ctx context.Context) (err error)

WaitForHealthCheck ...

func (*ImmuClientMock) ZAdd

func (icm *ImmuClientMock) ZAdd(ctx context.Context, set []byte, score float64, key []byte) (*schema.Index, error)

ZAdd ...

func (*ImmuClientMock) ZScan

func (icm *ImmuClientMock) ZScan(ctx context.Context, set []byte) (*schema.StructuredItemList, error)

ZScan ...

type PasswordReaderMock

type PasswordReaderMock struct {
	ReadF func(msg string) ([]byte, error)
}

PasswordReaderMock ...

func (*PasswordReaderMock) Read

func (pr *PasswordReaderMock) Read(msg string) ([]byte, error)

type TerminalReaderMock

type TerminalReaderMock struct {
	Counter             int
	Responses           []string
	ReadFromTerminalYNF func(string) (string, error)
}

TerminalReaderMock ...

func (*TerminalReaderMock) ReadFromTerminalYN

func (t *TerminalReaderMock) ReadFromTerminalYN(def string) (selected string, err error)

ReadFromTerminalYN ...

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL