| // Code generated by mockery v0.0.0-dev. DO NOT EDIT. |
| |
| package mocks |
| |
| import ( |
| context "context" |
| |
| gopubsub "cloud.google.com/go/pubsub" |
| mock "github.com/stretchr/testify/mock" |
| |
| pubsub "go.skia.org/infra/go/pubsub" |
| ) |
| |
| // Client is an autogenerated mock type for the Client type |
| type Client struct { |
| mock.Mock |
| } |
| |
| // Close provides a mock function with given fields: |
| func (_m *Client) Close() error { |
| ret := _m.Called() |
| |
| if len(ret) == 0 { |
| panic("no return value specified for Close") |
| } |
| |
| var r0 error |
| if rf, ok := ret.Get(0).(func() error); ok { |
| r0 = rf() |
| } else { |
| r0 = ret.Error(0) |
| } |
| |
| return r0 |
| } |
| |
| // CreateSubscription provides a mock function with given fields: ctx, id, cfg |
| func (_m *Client) CreateSubscription(ctx context.Context, id string, cfg gopubsub.SubscriptionConfig) (pubsub.Subscription, error) { |
| ret := _m.Called(ctx, id, cfg) |
| |
| if len(ret) == 0 { |
| panic("no return value specified for CreateSubscription") |
| } |
| |
| var r0 pubsub.Subscription |
| var r1 error |
| if rf, ok := ret.Get(0).(func(context.Context, string, gopubsub.SubscriptionConfig) (pubsub.Subscription, error)); ok { |
| return rf(ctx, id, cfg) |
| } |
| if rf, ok := ret.Get(0).(func(context.Context, string, gopubsub.SubscriptionConfig) pubsub.Subscription); ok { |
| r0 = rf(ctx, id, cfg) |
| } else { |
| if ret.Get(0) != nil { |
| r0 = ret.Get(0).(pubsub.Subscription) |
| } |
| } |
| |
| if rf, ok := ret.Get(1).(func(context.Context, string, gopubsub.SubscriptionConfig) error); ok { |
| r1 = rf(ctx, id, cfg) |
| } else { |
| r1 = ret.Error(1) |
| } |
| |
| return r0, r1 |
| } |
| |
| // CreateTopic provides a mock function with given fields: ctx, topicID |
| func (_m *Client) CreateTopic(ctx context.Context, topicID string) (pubsub.Topic, error) { |
| ret := _m.Called(ctx, topicID) |
| |
| if len(ret) == 0 { |
| panic("no return value specified for CreateTopic") |
| } |
| |
| var r0 pubsub.Topic |
| var r1 error |
| if rf, ok := ret.Get(0).(func(context.Context, string) (pubsub.Topic, error)); ok { |
| return rf(ctx, topicID) |
| } |
| if rf, ok := ret.Get(0).(func(context.Context, string) pubsub.Topic); ok { |
| r0 = rf(ctx, topicID) |
| } else { |
| if ret.Get(0) != nil { |
| r0 = ret.Get(0).(pubsub.Topic) |
| } |
| } |
| |
| if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { |
| r1 = rf(ctx, topicID) |
| } else { |
| r1 = ret.Error(1) |
| } |
| |
| return r0, r1 |
| } |
| |
| // CreateTopicWithConfig provides a mock function with given fields: ctx, topicID, tc |
| func (_m *Client) CreateTopicWithConfig(ctx context.Context, topicID string, tc *gopubsub.TopicConfig) (pubsub.Topic, error) { |
| ret := _m.Called(ctx, topicID, tc) |
| |
| if len(ret) == 0 { |
| panic("no return value specified for CreateTopicWithConfig") |
| } |
| |
| var r0 pubsub.Topic |
| var r1 error |
| if rf, ok := ret.Get(0).(func(context.Context, string, *gopubsub.TopicConfig) (pubsub.Topic, error)); ok { |
| return rf(ctx, topicID, tc) |
| } |
| if rf, ok := ret.Get(0).(func(context.Context, string, *gopubsub.TopicConfig) pubsub.Topic); ok { |
| r0 = rf(ctx, topicID, tc) |
| } else { |
| if ret.Get(0) != nil { |
| r0 = ret.Get(0).(pubsub.Topic) |
| } |
| } |
| |
| if rf, ok := ret.Get(1).(func(context.Context, string, *gopubsub.TopicConfig) error); ok { |
| r1 = rf(ctx, topicID, tc) |
| } else { |
| r1 = ret.Error(1) |
| } |
| |
| return r0, r1 |
| } |
| |
| // DetachSubscription provides a mock function with given fields: ctx, sub |
| func (_m *Client) DetachSubscription(ctx context.Context, sub string) (*gopubsub.DetachSubscriptionResult, error) { |
| ret := _m.Called(ctx, sub) |
| |
| if len(ret) == 0 { |
| panic("no return value specified for DetachSubscription") |
| } |
| |
| var r0 *gopubsub.DetachSubscriptionResult |
| var r1 error |
| if rf, ok := ret.Get(0).(func(context.Context, string) (*gopubsub.DetachSubscriptionResult, error)); ok { |
| return rf(ctx, sub) |
| } |
| if rf, ok := ret.Get(0).(func(context.Context, string) *gopubsub.DetachSubscriptionResult); ok { |
| r0 = rf(ctx, sub) |
| } else { |
| if ret.Get(0) != nil { |
| r0 = ret.Get(0).(*gopubsub.DetachSubscriptionResult) |
| } |
| } |
| |
| if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { |
| r1 = rf(ctx, sub) |
| } else { |
| r1 = ret.Error(1) |
| } |
| |
| return r0, r1 |
| } |
| |
| // Project provides a mock function with given fields: |
| func (_m *Client) Project() string { |
| ret := _m.Called() |
| |
| if len(ret) == 0 { |
| panic("no return value specified for Project") |
| } |
| |
| var r0 string |
| if rf, ok := ret.Get(0).(func() string); ok { |
| r0 = rf() |
| } else { |
| r0 = ret.Get(0).(string) |
| } |
| |
| return r0 |
| } |
| |
| // Snapshot provides a mock function with given fields: id |
| func (_m *Client) Snapshot(id string) pubsub.Snapshot { |
| ret := _m.Called(id) |
| |
| if len(ret) == 0 { |
| panic("no return value specified for Snapshot") |
| } |
| |
| var r0 pubsub.Snapshot |
| if rf, ok := ret.Get(0).(func(string) pubsub.Snapshot); ok { |
| r0 = rf(id) |
| } else { |
| if ret.Get(0) != nil { |
| r0 = ret.Get(0).(pubsub.Snapshot) |
| } |
| } |
| |
| return r0 |
| } |
| |
| // Snapshots provides a mock function with given fields: ctx |
| func (_m *Client) Snapshots(ctx context.Context) *gopubsub.SnapshotConfigIterator { |
| ret := _m.Called(ctx) |
| |
| if len(ret) == 0 { |
| panic("no return value specified for Snapshots") |
| } |
| |
| var r0 *gopubsub.SnapshotConfigIterator |
| if rf, ok := ret.Get(0).(func(context.Context) *gopubsub.SnapshotConfigIterator); ok { |
| r0 = rf(ctx) |
| } else { |
| if ret.Get(0) != nil { |
| r0 = ret.Get(0).(*gopubsub.SnapshotConfigIterator) |
| } |
| } |
| |
| return r0 |
| } |
| |
| // Subscription provides a mock function with given fields: id |
| func (_m *Client) Subscription(id string) pubsub.Subscription { |
| ret := _m.Called(id) |
| |
| if len(ret) == 0 { |
| panic("no return value specified for Subscription") |
| } |
| |
| var r0 pubsub.Subscription |
| if rf, ok := ret.Get(0).(func(string) pubsub.Subscription); ok { |
| r0 = rf(id) |
| } else { |
| if ret.Get(0) != nil { |
| r0 = ret.Get(0).(pubsub.Subscription) |
| } |
| } |
| |
| return r0 |
| } |
| |
| // SubscriptionInProject provides a mock function with given fields: id, projectID |
| func (_m *Client) SubscriptionInProject(id string, projectID string) pubsub.Subscription { |
| ret := _m.Called(id, projectID) |
| |
| if len(ret) == 0 { |
| panic("no return value specified for SubscriptionInProject") |
| } |
| |
| var r0 pubsub.Subscription |
| if rf, ok := ret.Get(0).(func(string, string) pubsub.Subscription); ok { |
| r0 = rf(id, projectID) |
| } else { |
| if ret.Get(0) != nil { |
| r0 = ret.Get(0).(pubsub.Subscription) |
| } |
| } |
| |
| return r0 |
| } |
| |
| // Subscriptions provides a mock function with given fields: ctx |
| func (_m *Client) Subscriptions(ctx context.Context) *gopubsub.SubscriptionIterator { |
| ret := _m.Called(ctx) |
| |
| if len(ret) == 0 { |
| panic("no return value specified for Subscriptions") |
| } |
| |
| var r0 *gopubsub.SubscriptionIterator |
| if rf, ok := ret.Get(0).(func(context.Context) *gopubsub.SubscriptionIterator); ok { |
| r0 = rf(ctx) |
| } else { |
| if ret.Get(0) != nil { |
| r0 = ret.Get(0).(*gopubsub.SubscriptionIterator) |
| } |
| } |
| |
| return r0 |
| } |
| |
| // Topic provides a mock function with given fields: id |
| func (_m *Client) Topic(id string) pubsub.Topic { |
| ret := _m.Called(id) |
| |
| if len(ret) == 0 { |
| panic("no return value specified for Topic") |
| } |
| |
| var r0 pubsub.Topic |
| if rf, ok := ret.Get(0).(func(string) pubsub.Topic); ok { |
| r0 = rf(id) |
| } else { |
| if ret.Get(0) != nil { |
| r0 = ret.Get(0).(pubsub.Topic) |
| } |
| } |
| |
| return r0 |
| } |
| |
| // TopicInProject provides a mock function with given fields: id, projectID |
| func (_m *Client) TopicInProject(id string, projectID string) pubsub.Topic { |
| ret := _m.Called(id, projectID) |
| |
| if len(ret) == 0 { |
| panic("no return value specified for TopicInProject") |
| } |
| |
| var r0 pubsub.Topic |
| if rf, ok := ret.Get(0).(func(string, string) pubsub.Topic); ok { |
| r0 = rf(id, projectID) |
| } else { |
| if ret.Get(0) != nil { |
| r0 = ret.Get(0).(pubsub.Topic) |
| } |
| } |
| |
| return r0 |
| } |
| |
| // Topics provides a mock function with given fields: ctx |
| func (_m *Client) Topics(ctx context.Context) *gopubsub.TopicIterator { |
| ret := _m.Called(ctx) |
| |
| if len(ret) == 0 { |
| panic("no return value specified for Topics") |
| } |
| |
| var r0 *gopubsub.TopicIterator |
| if rf, ok := ret.Get(0).(func(context.Context) *gopubsub.TopicIterator); ok { |
| r0 = rf(ctx) |
| } else { |
| if ret.Get(0) != nil { |
| r0 = ret.Get(0).(*gopubsub.TopicIterator) |
| } |
| } |
| |
| return r0 |
| } |
| |
| // NewClient creates a new instance of Client. 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 NewClient(t interface { |
| mock.TestingT |
| Cleanup(func()) |
| }) *Client { |
| mock := &Client{} |
| mock.Mock.Test(t) |
| |
| t.Cleanup(func() { mock.AssertExpectations(t) }) |
| |
| return mock |
| } |