mock

package
v1.3.19 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package mock provides a variety of mock implementations used for testing.

  • Copyright (c) 2018-2022, NVIDIA CORPORATION. All rights reserved.

Package mock provides a variety of mock implementations used for testing.

  • Copyright (c) 2018-2022, NVIDIA CORPORATION. All rights reserved.

Package mock provides a variety of mock implementations used for testing.

  • Copyright (c) 2018-2023, NVIDIA CORPORATION. All rights reserved.

Package mock provides a variety of mock implementations used for testing.

  • Copyright (c) 2018-2023, NVIDIA CORPORATION. All rights reserved.

Package mock provides a variety of mock implementations used for testing.

  • Copyright (c) 2018-2022, NVIDIA CORPORATION. All rights reserved.

Package mock provides a variety of mock implementations used for testing.

  • Copyright (c) 2018-2022, NVIDIA CORPORATION. All rights reserved.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDBDriver

func NewDBDriver() kvdb.Driver

func NewStatsTracker

func NewStatsTracker() stats.Tracker

Types

type BownerMock

type BownerMock struct {
	meta.BMD
}

func NewBaseBownerMock

func NewBaseBownerMock(bcks ...*meta.Bck) *BownerMock

func (BownerMock) Get

func (r BownerMock) Get() *meta.BMD

type DBDriver

type DBDriver struct {
	// contains filtered or unexported fields
}

func (*DBDriver) Close

func (*DBDriver) Close() error

func (*DBDriver) Delete

func (bd *DBDriver) Delete(collection, key string) error

func (*DBDriver) DeleteCollection

func (bd *DBDriver) DeleteCollection(collection string) error

func (*DBDriver) Get

func (bd *DBDriver) Get(collection, key string, object any) error

func (*DBDriver) GetAll

func (bd *DBDriver) GetAll(collection, pattern string) (map[string]string, error)

func (*DBDriver) GetString

func (bd *DBDriver) GetString(collection, key string) (string, error)

func (*DBDriver) List

func (bd *DBDriver) List(collection, pattern string) ([]string, error)

func (*DBDriver) Set

func (bd *DBDriver) Set(collection, key string, object any) error

func (*DBDriver) SetString

func (bd *DBDriver) SetString(collection, key, data string) error

type IOS

type IOS struct {
	Utils ios.MpathUtil
}

func NewIOS

func NewIOS() *IOS

func (*IOS) AddMpath

func (*IOS) AddMpath(string, string, bool) (ios.FsDisks, error)

func (*IOS) FillDiskStats

func (*IOS) FillDiskStats(ios.AllDiskStats)

func (*IOS) GetAllMpathUtils

func (m *IOS) GetAllMpathUtils() *ios.MpathUtil

func (*IOS) GetMpathUtil

func (m *IOS) GetMpathUtil(mpath string) int64

func (*IOS) LogAppend

func (*IOS) LogAppend(l []string) []string

func (*IOS) RemoveMpath

func (*IOS) RemoveMpath(string, bool)

type StatsTracker

type StatsTracker struct{}

func (*StatsTracker) Add

func (*StatsTracker) Add(string, int64)

func (*StatsTracker) AddMany

func (*StatsTracker) AddMany(...cos.NamedVal64)

func (*StatsTracker) Get

func (*StatsTracker) Get(string) int64

func (*StatsTracker) GetMetricNames

func (*StatsTracker) GetMetricNames() cos.StrKVs

func (*StatsTracker) GetStats

func (*StatsTracker) GetStats() *stats.Node

func (*StatsTracker) Inc

func (*StatsTracker) Inc(string)

func (*StatsTracker) IncErr

func (*StatsTracker) IncErr(string)

func (*StatsTracker) IsPrometheus

func (*StatsTracker) IsPrometheus() bool

func (*StatsTracker) RegMetrics

func (*StatsTracker) RegMetrics(*meta.Snode)

func (*StatsTracker) ResetStats

func (*StatsTracker) ResetStats(bool)

func (*StatsTracker) StartedUp

func (*StatsTracker) StartedUp() bool

type TargetMock

type TargetMock struct {
	BO meta.Bowner
}

TargetMock provides cluster.Target interface with mocked return values.

func NewTarget

func NewTarget(bo meta.Bowner) *TargetMock

func (*TargetMock) BMDVersionFixup

func (*TargetMock) BMDVersionFixup(*http.Request, ...cmn.Bck)

func (*TargetMock) Backend

func (*TargetMock) Bowner

func (t *TargetMock) Bowner() meta.Bowner

func (*TargetMock) ByteMM

func (*TargetMock) ByteMM() *memsys.MMSA

func (*TargetMock) ClusterStarted

func (*TargetMock) ClusterStarted() bool

func (*TargetMock) CompareObjects

func (*TargetMock) CompareObjects(context.Context, *cluster.LOM) (bool, int, error)

func (*TargetMock) CopyObject

func (*TargetMock) DataClient

func (*TargetMock) DataClient() *http.Client

func (*TargetMock) DeleteObject

func (*TargetMock) DeleteObject(*cluster.LOM, bool) (int, error)

func (*TargetMock) EvictObject

func (*TargetMock) EvictObject(*cluster.LOM) (int, error)

func (*TargetMock) FSHC

func (*TargetMock) FSHC(error, string)

func (*TargetMock) FinalizeObj

func (*TargetMock) FinalizeObj(*cluster.LOM, string, cluster.Xact) (int, error)

func (*TargetMock) GetAllRunning

func (*TargetMock) GetAllRunning(string, bool) ([]string, []string)

func (*TargetMock) GetCold

func (*TargetMock) GetCold(context.Context, *cluster.LOM, cmn.OWT) (int, error)

func (*TargetMock) HeadObjT2T

func (*TargetMock) HeadObjT2T(*cluster.LOM, *meta.Snode) bool

func (*TargetMock) Health

func (*TargetMock) Health(*meta.Snode, time.Duration, url.Values) ([]byte, int, error)

func (*TargetMock) NodeStarted

func (*TargetMock) NodeStarted() bool

func (*TargetMock) OOS

func (*TargetMock) PageMM

func (*TargetMock) PageMM() *memsys.MMSA

func (*TargetMock) Promote

func (*TargetMock) Promote(cluster.PromoteParams) (int, error)

func (*TargetMock) PutObject

func (*TargetMock) RebalanceNamespace

func (*TargetMock) RebalanceNamespace(*meta.Snode) ([]byte, int, error)

func (*TargetMock) SID

func (*TargetMock) SID() string

func (*TargetMock) Sname

func (*TargetMock) Sname() string

func (*TargetMock) Snode

func (*TargetMock) Snode() *meta.Snode

func (*TargetMock) Sowner

func (*TargetMock) Sowner() meta.Sowner

func (*TargetMock) String

func (*TargetMock) String() string

type XactMock

type XactMock struct {
	xact.Base
}

XactMock provides cluster.Xact interface with mocked return values.

func NewXact

func NewXact(kind string) *XactMock

func (*XactMock) Run

func (*XactMock) Run(*sync.WaitGroup)

func (*XactMock) Snap

func (r *XactMock) Snap() (snap *cluster.Snap)

Jump to

Keyboard shortcuts

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