mock

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

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

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

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

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

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

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

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

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

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

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

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

  • Copyright (c) 2018-2025, 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) (int, error)

func (*DBDriver) DeleteCollection

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

func (*DBDriver) Get

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

func (*DBDriver) GetAll

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

func (*DBDriver) GetString

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

func (*DBDriver) List

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

func (*DBDriver) Set

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

func (*DBDriver) SetString

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

type IOS

type IOS struct {
	Utils ios.MpathUtil
}

func NewIOS

func NewIOS() *IOS

func (*IOS) AddMpath

func (*IOS) DiskStats added in v1.3.24

func (*IOS) DiskStats(cos.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)

func (*IOS) RescanDisks added in v1.3.24

func (*IOS) RescanDisks(string, string, []string) ios.RescanDisksResult

type StatsTracker

type StatsTracker struct{}

func (*StatsTracker) Add

func (*StatsTracker) Add(string, int64)

func (*StatsTracker) AddWith added in v1.3.26

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

func (*StatsTracker) ClrFlag added in v1.3.24

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) IncBck added in v1.3.26

func (*StatsTracker) IncBck(string, *cmn.Bck)

func (*StatsTracker) IncWith added in v1.3.26

func (*StatsTracker) IncWith(string, map[string]string)

func (*StatsTracker) Observe added in v1.4.2

func (*StatsTracker) Observe(string, float64)

func (*StatsTracker) PromHandler added in v1.3.26

func (*StatsTracker) PromHandler() http.Handler

func (*StatsTracker) RegExtMetric added in v1.3.24

func (*StatsTracker) RegExtMetric(*meta.Snode, string, string, *stats.Extra)

func (*StatsTracker) ResetStats

func (*StatsTracker) ResetStats(bool)

func (*StatsTracker) SetClrFlag added in v1.3.24

func (*StatsTracker) SetFlag added in v1.3.24

func (*StatsTracker) StartedUp

func (*StatsTracker) StartedUp() bool

type TargetMock

type TargetMock struct {
	BO       meta.Bowner
	SO       meta.Sowner
	Backends map[string]core.Backend
}

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 (t *TargetMock) Backend(bck *meta.Bck) core.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) DataClient

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

func (*TargetMock) DeleteObject

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

func (*TargetMock) ECRestoreReq added in v1.3.26

func (*TargetMock) ECRestoreReq(*core.CT, *meta.Snode, string) error

func (*TargetMock) EvictObject

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

func (*TargetMock) FSHC

func (*TargetMock) FSHC(error, *fs.Mountpath, string)

func (*TargetMock) FinalizeObj

func (*TargetMock) FinalizeObj(*core.LOM, string, core.Xact, cmn.OWT) (int, error)

func (*TargetMock) GetAllRunning

func (*TargetMock) GetAllRunning(*core.AllRunningInOut, bool)

func (*TargetMock) GetCold

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

func (*TargetMock) GetColdBlob

func (*TargetMock) GetColdBlob(*core.BlobParams, *cmn.ObjAttrs) (core.Xact, error)

func (*TargetMock) GetFromNeighbor added in v1.4.0

func (*TargetMock) GetFromNeighbor(*core.GfnParams) (*http.Response, error)

func (*TargetMock) HeadCold added in v1.3.24

func (*TargetMock) HeadCold(*core.LOM, *http.Request) (*cmn.ObjAttrs, int, error)

func (*TargetMock) HeadObjT2T

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

func (*TargetMock) Health

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

func (*TargetMock) MaxUtilLoad added in v1.3.26

func (*TargetMock) MaxUtilLoad() (int64, float64)

func (*TargetMock) NodeStarted

func (*TargetMock) NodeStarted() bool

func (*TargetMock) OOS

func (*TargetMock) PageMM

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

func (*TargetMock) Promote

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

func (*TargetMock) PutObject

func (*TargetMock) PutObject(*core.LOM, *core.PutParams) error

func (*TargetMock) SID

func (*TargetMock) SID() string

func (*TargetMock) Snode

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

func (*TargetMock) SoftFSHC added in v1.3.24

func (*TargetMock) SoftFSHC()

func (*TargetMock) Sowner

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

func (*TargetMock) StatsUpdater added in v1.3.28

func (*TargetMock) StatsUpdater() cos.StatsUpdater

func (*TargetMock) String

func (*TargetMock) String() string

type XactMock

type XactMock struct {
	xact.Base
}

XactMock provides core.Xact interface with mocked return values.

func NewXact

func NewXact(kind string) *XactMock

func (*XactMock) CtlMsg added in v1.4.1

func (*XactMock) CtlMsg() string

func (*XactMock) Run

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

func (*XactMock) Snap

func (r *XactMock) Snap() *core.Snap

Jump to

Keyboard shortcuts

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