gc

package
v1.0.14 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package gc is a generated GoMock package.

Package gc is a generated GoMock package.

Package gc is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GC

type GC interface {
	// Add adds GC task.
	Add(Task) error

	// Run GC task.
	Run(string) error

	// Run all registered GC tasks.
	RunAll()

	// Start running the GC task.
	Start()

	// Stop running the GC task.
	Stop()
}

GC is the interface used for release resource.

func New

func New(options ...Option) GC

New returns a new GC instence.

type Logger

type Logger interface {
	// Infof logs routine messages for GC.
	Infof(template string, args ...any)
	// Error logs error messages for GC.
	Errorf(template string, args ...any)
}

Logger is the interface used in GC for logging.

type MockGC

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

MockGC is a mock of GC interface.

func NewMockGC

func NewMockGC(ctrl *gomock.Controller) *MockGC

NewMockGC creates a new mock instance.

func (*MockGC) Add

func (m *MockGC) Add(arg0 Task) error

Add mocks base method.

func (*MockGC) EXPECT

func (m *MockGC) EXPECT() *MockGCMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockGC) Run

func (m *MockGC) Run(arg0 string) error

Run mocks base method.

func (*MockGC) RunAll

func (m *MockGC) RunAll()

RunAll mocks base method.

func (*MockGC) Start

func (m *MockGC) Start()

Start mocks base method.

func (*MockGC) Stop

func (m *MockGC) Stop()

Stop mocks base method.

type MockGCMockRecorder

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

MockGCMockRecorder is the mock recorder for MockGC.

func (*MockGCMockRecorder) Add

func (mr *MockGCMockRecorder) Add(arg0 interface{}) *gomock.Call

Add indicates an expected call of Add.

func (*MockGCMockRecorder) Run

func (mr *MockGCMockRecorder) Run(arg0 interface{}) *gomock.Call

Run indicates an expected call of Run.

func (*MockGCMockRecorder) RunAll

func (mr *MockGCMockRecorder) RunAll() *gomock.Call

RunAll indicates an expected call of RunAll.

func (*MockGCMockRecorder) Start

func (mr *MockGCMockRecorder) Start() *gomock.Call

Start indicates an expected call of Start.

func (*MockGCMockRecorder) Stop

func (mr *MockGCMockRecorder) Stop() *gomock.Call

Stop indicates an expected call of Stop.

type MockLogger

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

MockLogger is a mock of Logger interface.

func NewMockLogger

func NewMockLogger(ctrl *gomock.Controller) *MockLogger

NewMockLogger creates a new mock instance.

func (*MockLogger) EXPECT

func (m *MockLogger) EXPECT() *MockLoggerMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockLogger) Errorf

func (m *MockLogger) Errorf(template string, args ...any)

Errorf mocks base method.

func (*MockLogger) Infof

func (m *MockLogger) Infof(template string, args ...any)

Infof mocks base method.

type MockLoggerMockRecorder

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

MockLoggerMockRecorder is the mock recorder for MockLogger.

func (*MockLoggerMockRecorder) Errorf

func (mr *MockLoggerMockRecorder) Errorf(template interface{}, args ...interface{}) *gomock.Call

Errorf indicates an expected call of Errorf.

func (*MockLoggerMockRecorder) Infof

func (mr *MockLoggerMockRecorder) Infof(template interface{}, args ...interface{}) *gomock.Call

Infof indicates an expected call of Infof.

type MockRunner

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

MockRunner is a mock of Runner interface.

func NewMockRunner

func NewMockRunner(ctrl *gomock.Controller) *MockRunner

NewMockRunner creates a new mock instance.

func (*MockRunner) EXPECT

func (m *MockRunner) EXPECT() *MockRunnerMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockRunner) RunGC

func (m *MockRunner) RunGC() error

RunGC mocks base method.

type MockRunnerMockRecorder

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

MockRunnerMockRecorder is the mock recorder for MockRunner.

func (*MockRunnerMockRecorder) RunGC

func (mr *MockRunnerMockRecorder) RunGC() *gomock.Call

RunGC indicates an expected call of RunGC.

type Option

type Option func(g *gc)

Option is a functional option for configuring the GC.

func WithLogger

func WithLogger(logger Logger) Option

WithLogger set the logger for GC.

type Runner

type Runner interface {
	RunGC() error
}

type Task

type Task struct {
	ID       string
	Interval time.Duration
	Timeout  time.Duration
	Runner   Runner
}

Task is an struct used to run GC instance.

Jump to

Keyboard shortcuts

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