garm/runner/common/mocks/RateLimitClient.go
Gabriel Adrian Samfira eec158b32c Add SPA UI for GARM
This change adds a single page application front-end to GARM. It uses
a generated REST client, built from the swagger definitions, the websocket
interface for live updates of entities and eager loading of everything
except runners, as users may have many runners and we don't want to load
hundreds of runners in memory.

Proper pagination should be implemented in the API, in future commits,
to avoid loading lots of elements for no reason.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2025-08-16 09:09:13 +00:00

95 lines
2.5 KiB
Go

// Code generated by mockery. DO NOT EDIT.
package mocks
import (
context "context"
github "github.com/google/go-github/v72/github"
mock "github.com/stretchr/testify/mock"
)
// RateLimitClient is an autogenerated mock type for the RateLimitClient type
type RateLimitClient struct {
mock.Mock
}
type RateLimitClient_Expecter struct {
mock *mock.Mock
}
func (_m *RateLimitClient) EXPECT() *RateLimitClient_Expecter {
return &RateLimitClient_Expecter{mock: &_m.Mock}
}
// RateLimit provides a mock function with given fields: ctx
func (_m *RateLimitClient) RateLimit(ctx context.Context) (*github.RateLimits, error) {
ret := _m.Called(ctx)
if len(ret) == 0 {
panic("no return value specified for RateLimit")
}
var r0 *github.RateLimits
var r1 error
if rf, ok := ret.Get(0).(func(context.Context) (*github.RateLimits, error)); ok {
return rf(ctx)
}
if rf, ok := ret.Get(0).(func(context.Context) *github.RateLimits); ok {
r0 = rf(ctx)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*github.RateLimits)
}
}
if rf, ok := ret.Get(1).(func(context.Context) error); ok {
r1 = rf(ctx)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// RateLimitClient_RateLimit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RateLimit'
type RateLimitClient_RateLimit_Call struct {
*mock.Call
}
// RateLimit is a helper method to define mock.On call
// - ctx context.Context
func (_e *RateLimitClient_Expecter) RateLimit(ctx interface{}) *RateLimitClient_RateLimit_Call {
return &RateLimitClient_RateLimit_Call{Call: _e.mock.On("RateLimit", ctx)}
}
func (_c *RateLimitClient_RateLimit_Call) Run(run func(ctx context.Context)) *RateLimitClient_RateLimit_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context))
})
return _c
}
func (_c *RateLimitClient_RateLimit_Call) Return(_a0 *github.RateLimits, _a1 error) *RateLimitClient_RateLimit_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *RateLimitClient_RateLimit_Call) RunAndReturn(run func(context.Context) (*github.RateLimits, error)) *RateLimitClient_RateLimit_Call {
_c.Call.Return(run)
return _c
}
// NewRateLimitClient creates a new instance of RateLimitClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewRateLimitClient(t interface {
mock.TestingT
Cleanup(func())
}) *RateLimitClient {
mock := &RateLimitClient{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}