mocks

package
v0.1.4-alpha Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorClosed = errors.New("not acquired")

Functions

This section is empty.

Types

type CollectorMock

type CollectorMock struct{}

CollectorMock for metrics manipulating object

func NewCollectorMock

func NewCollectorMock() *CollectorMock

func (*CollectorMock) DeleteThrottlingDelay

func (collector *CollectorMock) DeleteThrottlingDelay(_, _, _ string) bool

func (*CollectorMock) IncrementHTTPRequestCount

func (collector *CollectorMock) IncrementHTTPRequestCount(_, _, _, _, _ string, _ int)

func (*CollectorMock) IncrementHTTPRequestsTotalCount

func (collector *CollectorMock) IncrementHTTPRequestsTotalCount(_ string)

func (*CollectorMock) IncrementLogMessageCount

func (collector *CollectorMock) IncrementLogMessageCount(_, _, _ string)

func (*CollectorMock) IncrementThrottlingDelay

func (collector *CollectorMock) IncrementThrottlingDelay(_, _, _ string, _ float64)

func (*CollectorMock) ObserveHTTPRequestTime

func (collector *CollectorMock) ObserveHTTPRequestTime(_, _, _, _, _ string, _ float64)

func (*CollectorMock) ObserveHTTPUpstreamResponseTimeTotal

func (collector *CollectorMock) ObserveHTTPUpstreamResponseTimeTotal(_, _, _, _, _ string, _ float64)

func (*CollectorMock) Retrieve

func (collector *CollectorMock) Retrieve() error

type LineReaderMock

type LineReaderMock struct {
	Entries [][]byte
	// contains filtered or unexported fields
}

LineReaderMock is mock for readers with byte ReaderJournald interface

func NewLineReaderMock

func NewLineReaderMock(entries ...[]byte) *LineReaderMock

func (*LineReaderMock) Close

func (reader *LineReaderMock) Close() error

func (*LineReaderMock) EntryRead

func (reader *LineReaderMock) EntryRead() ([]byte, bool, error)

func (*LineReaderMock) GetAcquireFlag

func (reader *LineReaderMock) GetAcquireFlag() bool

func (*LineReaderMock) GetCursor

func (reader *LineReaderMock) GetCursor() *readers.Cursor

GetCursor should be used to get current reader in-memory cursor

func (*LineReaderMock) GetPrefixFlag

func (reader *LineReaderMock) GetPrefixFlag() bool

func (*LineReaderMock) SetAcquireFlag

func (reader *LineReaderMock) SetAcquireFlag(flag bool)

func (*LineReaderMock) SetCursor

func (reader *LineReaderMock) SetCursor(cursor *readers.Cursor)

func (*LineReaderMock) SetPrefixFlag

func (reader *LineReaderMock) SetPrefixFlag(flag bool)

func (*LineReaderMock) SetReturnErrorFlag

func (reader *LineReaderMock) SetReturnErrorFlag(flag bool)

type ReaderJournaldMock

type ReaderJournaldMock struct {
	Entries []common.EntryMap
	// contains filtered or unexported fields
}

ReaderJournaldMock mocks specific sdjournal based reader with EntryMap reader interface

func NewReaderJournaldMock

func NewReaderJournaldMock(entries ...common.EntryMap) *ReaderJournaldMock

func (*ReaderJournaldMock) Close

func (reader *ReaderJournaldMock) Close() error

func (*ReaderJournaldMock) EntryRead

func (reader *ReaderJournaldMock) EntryRead() (common.EntryMap, error)

func (*ReaderJournaldMock) GetAcquireFlag

func (reader *ReaderJournaldMock) GetAcquireFlag() bool

func (*ReaderJournaldMock) GetCursor

func (reader *ReaderJournaldMock) GetCursor() string

type SLIMock

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

SLIMock is stub for testing purposes

func NewSLIMock

func NewSLIMock() *SLIMock

NewSLIMock is a constructor for SLIMock

func (*SLIMock) Parse

func (parser *SLIMock) Parse(_ common.EntryMap)

Parse increments parsed count

func (*SLIMock) Parsed

func (parser *SLIMock) Parsed() int

Parse increments parsed count

type WorkerFollowerMock

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

func (*WorkerFollowerMock) GetActiveFlag

func (w *WorkerFollowerMock) GetActiveFlag() bool

func (*WorkerFollowerMock) SetEOFShutdownFlag

func (w *WorkerFollowerMock) SetEOFShutdownFlag()

func (*WorkerFollowerMock) Start

func (w *WorkerFollowerMock) Start(ctx context.Context)

func (*WorkerFollowerMock) Stop

func (w *WorkerFollowerMock) Stop()

type WorkerJournaldMock

type WorkerJournaldMock struct {
}

func (*WorkerJournaldMock) Start

func (w *WorkerJournaldMock) Start(ctx context.Context)

Jump to

Keyboard shortcuts

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