Documentation ¶
Overview ¶
Code generated by mocker; DO NOT EDIT github.com/travisjeffery/mocker
Index ¶
- type Client
- func (p *Client) CreateTopics(createRequest *protocol.CreateTopicRequests) (*protocol.CreateTopicsResponse, error)
- func (p *Client) Fetch(fetchRequest *protocol.FetchRequest) (*protocol.FetchResponse, error)
- func (p *Client) LeaderAndISR(request *protocol.LeaderAndISRRequest) (*protocol.LeaderAndISRResponse, error)
- func (p *Client) Messages() [][]byte
- type CommitLog
- func (mock *CommitLog) Append(in1 []byte) (int64, error)
- func (mock *CommitLog) AppendCalled() bool
- func (mock *CommitLog) AppendCalls() []struct{ ... }
- func (mock *CommitLog) Delete() error
- func (mock *CommitLog) DeleteCalled() bool
- func (mock *CommitLog) DeleteCalls() []struct{}
- func (mock *CommitLog) NewReader(offset int64, maxBytes int32) (io.Reader, error)
- func (mock *CommitLog) NewReaderCalled() bool
- func (mock *CommitLog) NewReaderCalls() []struct{ ... }
- func (mock *CommitLog) NewestOffset() int64
- func (mock *CommitLog) NewestOffsetCalled() bool
- func (mock *CommitLog) NewestOffsetCalls() []struct{}
- func (mock *CommitLog) OldestOffset() int64
- func (mock *CommitLog) OldestOffsetCalled() bool
- func (mock *CommitLog) OldestOffsetCalls() []struct{}
- func (mock *CommitLog) Reset()
- func (mock *CommitLog) Truncate(in1 int64) error
- func (mock *CommitLog) TruncateCalled() bool
- func (mock *CommitLog) TruncateCalls() []struct{ ... }
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client for testing
func (*Client) CreateTopics ¶
func (p *Client) CreateTopics(createRequest *protocol.CreateTopicRequests) (*protocol.CreateTopicsResponse, error)
func (*Client) Fetch ¶
func (p *Client) Fetch(fetchRequest *protocol.FetchRequest) (*protocol.FetchResponse, error)
func (*Client) LeaderAndISR ¶
func (p *Client) LeaderAndISR(request *protocol.LeaderAndISRRequest) (*protocol.LeaderAndISRResponse, error)
type CommitLog ¶
type CommitLog struct { // AppendFunc mocks the Append method. AppendFunc func(in1 []byte) (int64, error) // DeleteFunc mocks the Delete method. DeleteFunc func() error // NewReaderFunc mocks the NewReader method. NewReaderFunc func(offset int64, maxBytes int32) (io.Reader, error) // NewestOffsetFunc mocks the NewestOffset method. NewestOffsetFunc func() int64 // OldestOffsetFunc mocks the OldestOffset method. OldestOffsetFunc func() int64 // TruncateFunc mocks the Truncate method. TruncateFunc func(in1 int64) error // contains filtered or unexported fields }
CommitLog is a mock implementation of CommitLog.
func TestSomethingThatUsesCommitLog(t *testing.T) { // make and configure a mocked CommitLog mockedCommitLog := &CommitLog{ AppendFunc: func(in1 []byte) (int64, error) { panic("TODO: mock out the Append method") }, DeleteFunc: func() error { panic("TODO: mock out the Delete method") }, NewReaderFunc: func(offset int64,maxBytes int32) (io.Reader, error) { panic("TODO: mock out the NewReader method") }, NewestOffsetFunc: func() int64 { panic("TODO: mock out the NewestOffset method") }, OldestOffsetFunc: func() int64 { panic("TODO: mock out the OldestOffset method") }, TruncateFunc: func(in1 int64) error { panic("TODO: mock out the Truncate method") }, } // TODO: use mockedCommitLog in code that requires CommitLog // and then make assertions. }
func (*CommitLog) AppendCalled ¶
AppendCalled returns true if at least one call was made to Append.
func (*CommitLog) AppendCalls ¶
AppendCalls gets all the calls that were made to Append. Check the length with:
len(mockedCommitLog.AppendCalls())
func (*CommitLog) DeleteCalled ¶
DeleteCalled returns true if at least one call was made to Delete.
func (*CommitLog) DeleteCalls ¶
func (mock *CommitLog) DeleteCalls() []struct { }
DeleteCalls gets all the calls that were made to Delete. Check the length with:
len(mockedCommitLog.DeleteCalls())
func (*CommitLog) NewReaderCalled ¶
NewReaderCalled returns true if at least one call was made to NewReader.
func (*CommitLog) NewReaderCalls ¶
NewReaderCalls gets all the calls that were made to NewReader. Check the length with:
len(mockedCommitLog.NewReaderCalls())
func (*CommitLog) NewestOffset ¶
NewestOffset calls NewestOffsetFunc.
func (*CommitLog) NewestOffsetCalled ¶
NewestOffsetCalled returns true if at least one call was made to NewestOffset.
func (*CommitLog) NewestOffsetCalls ¶
func (mock *CommitLog) NewestOffsetCalls() []struct { }
NewestOffsetCalls gets all the calls that were made to NewestOffset. Check the length with:
len(mockedCommitLog.NewestOffsetCalls())
func (*CommitLog) OldestOffset ¶
OldestOffset calls OldestOffsetFunc.
func (*CommitLog) OldestOffsetCalled ¶
OldestOffsetCalled returns true if at least one call was made to OldestOffset.
func (*CommitLog) OldestOffsetCalls ¶
func (mock *CommitLog) OldestOffsetCalls() []struct { }
OldestOffsetCalls gets all the calls that were made to OldestOffset. Check the length with:
len(mockedCommitLog.OldestOffsetCalls())
func (*CommitLog) Reset ¶
func (mock *CommitLog) Reset()
Reset resets the calls made to the mocked APIs.
func (*CommitLog) TruncateCalled ¶
TruncateCalled returns true if at least one call was made to Truncate.
func (*CommitLog) TruncateCalls ¶
TruncateCalls gets all the calls that were made to Truncate. Check the length with:
len(mockedCommitLog.TruncateCalls())