gc

package
v2.1.50 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Code generated by MockGen. DO NOT EDIT. Source: gc.go

Generated by this command:

mockgen -destination gc_mock.go -source gc.go -package gc

Package gc is a generated GoMock package.

Code generated by MockGen. DO NOT EDIT. Source: logger.go

Generated by this command:

mockgen -destination logger_mock.go -source logger.go -package gc

Package gc is a generated GoMock package.

Code generated by MockGen. DO NOT EDIT. Source: task.go

Generated by this command:

mockgen -destination runner_mock.go -source task.go -package gc

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 added in v2.0.2

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

MockGC is a mock of GC interface.

func NewMockGC added in v2.0.2

func NewMockGC(ctrl *gomock.Controller) *MockGC

NewMockGC creates a new mock instance.

func (*MockGC) Add added in v2.0.2

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

Add mocks base method.

func (*MockGC) EXPECT added in v2.0.2

func (m *MockGC) EXPECT() *MockGCMockRecorder

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

func (*MockGC) Run added in v2.0.2

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

Run mocks base method.

func (*MockGC) RunAll added in v2.0.2

func (m *MockGC) RunAll()

RunAll mocks base method.

func (*MockGC) Start added in v2.0.8

func (m *MockGC) Start()

Start mocks base method.

func (*MockGC) Stop added in v2.0.2

func (m *MockGC) Stop()

Stop mocks base method.

type MockGCMockRecorder added in v2.0.2

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

MockGCMockRecorder is the mock recorder for MockGC.

func (*MockGCMockRecorder) Add added in v2.0.2

func (mr *MockGCMockRecorder) Add(arg0 any) *gomock.Call

Add indicates an expected call of Add.

func (*MockGCMockRecorder) Run added in v2.0.2

func (mr *MockGCMockRecorder) Run(arg0 any) *gomock.Call

Run indicates an expected call of Run.

func (*MockGCMockRecorder) RunAll added in v2.0.2

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

RunAll indicates an expected call of RunAll.

func (*MockGCMockRecorder) Start added in v2.0.8

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

Start indicates an expected call of Start.

func (*MockGCMockRecorder) Stop added in v2.0.2

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

Stop indicates an expected call of Stop.

type MockLogger added in v2.0.2

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

MockLogger is a mock of Logger interface.

func NewMockLogger added in v2.0.2

func NewMockLogger(ctrl *gomock.Controller) *MockLogger

NewMockLogger creates a new mock instance.

func (*MockLogger) EXPECT added in v2.0.2

func (m *MockLogger) EXPECT() *MockLoggerMockRecorder

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

func (*MockLogger) Errorf added in v2.0.2

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

Errorf mocks base method.

func (*MockLogger) Infof added in v2.0.2

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

Infof mocks base method.

type MockLoggerMockRecorder added in v2.0.2

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

MockLoggerMockRecorder is the mock recorder for MockLogger.

func (*MockLoggerMockRecorder) Errorf added in v2.0.2

func (mr *MockLoggerMockRecorder) Errorf(template any, args ...any) *gomock.Call

Errorf indicates an expected call of Errorf.

func (*MockLoggerMockRecorder) Infof added in v2.0.2

func (mr *MockLoggerMockRecorder) Infof(template any, args ...any) *gomock.Call

Infof indicates an expected call of Infof.

type MockRunner added in v2.0.2

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

MockRunner is a mock of Runner interface.

func NewMockRunner added in v2.0.2

func NewMockRunner(ctrl *gomock.Controller) *MockRunner

NewMockRunner creates a new mock instance.

func (*MockRunner) EXPECT added in v2.0.2

func (m *MockRunner) EXPECT() *MockRunnerMockRecorder

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

func (*MockRunner) RunGC added in v2.0.2

func (m *MockRunner) RunGC() error

RunGC mocks base method.

type MockRunnerMockRecorder added in v2.0.2

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

MockRunnerMockRecorder is the mock recorder for MockRunner.

func (*MockRunnerMockRecorder) RunGC added in v2.0.2

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 added in v2.0.1

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