Documentation
¶
Overview ¶
Code generated by mocker; DO NOT EDIT github.com/travisjeffery/mocker
Code generated by mocker; DO NOT EDIT github.com/travisjeffery/mocker
Code generated by mocker; DO NOT EDIT github.com/travisjeffery/mocker
Code generated by mocker; DO NOT EDIT github.com/travisjeffery/mocker
Index ¶
- func NewMetrics() *jocko.Metrics
- type Broker
- func (mock *Broker) Join(addr ...string) protocol.Error
- func (mock *Broker) JoinCalled() bool
- func (mock *Broker) JoinCalls() []struct{ ... }
- func (mock *Broker) Reset()
- func (mock *Broker) Run(in1 context.Context, in2 <-chan jocko.Request, in3 chan<- jocko.Response)
- func (mock *Broker) RunCalled() bool
- func (mock *Broker) RunCalls() []struct{ ... }
- func (mock *Broker) Shutdown() error
- func (mock *Broker) ShutdownCalled() bool
- func (mock *Broker) ShutdownCalls() []struct{}
- type Client
- 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{ ... }
- type Raft
- func (mock *Raft) Addr() string
- func (mock *Raft) AddrCalled() bool
- func (mock *Raft) AddrCalls() []struct{}
- func (mock *Raft) Apply(cmd jocko.RaftCommand) error
- func (mock *Raft) ApplyCalled() bool
- func (mock *Raft) ApplyCalls() []struct{ ... }
- func (mock *Raft) Bootstrap(serf jocko.Serf, serfEventCh <-chan *jocko.ClusterMember, ...) error
- func (mock *Raft) BootstrapCalled() bool
- func (mock *Raft) BootstrapCalls() []struct{ ... }
- func (mock *Raft) IsLeader() bool
- func (mock *Raft) IsLeaderCalled() bool
- func (mock *Raft) IsLeaderCalls() []struct{}
- func (mock *Raft) LeaderID() string
- func (mock *Raft) LeaderIDCalled() bool
- func (mock *Raft) LeaderIDCalls() []struct{}
- func (mock *Raft) Reset()
- func (mock *Raft) Shutdown() error
- func (mock *Raft) ShutdownCalled() bool
- func (mock *Raft) ShutdownCalls() []struct{}
- type Serf
- func (mock *Serf) Bootstrap(node *jocko.ClusterMember, reconcileCh chan<- *jocko.ClusterMember) error
- func (mock *Serf) BootstrapCalled() bool
- func (mock *Serf) BootstrapCalls() []struct{ ... }
- func (mock *Serf) Cluster() []*jocko.ClusterMember
- func (mock *Serf) ClusterCalled() bool
- func (mock *Serf) ClusterCalls() []struct{}
- func (mock *Serf) ID() int32
- func (mock *Serf) IDCalled() bool
- func (mock *Serf) IDCalls() []struct{}
- func (mock *Serf) Join(addrs ...string) (int, error)
- func (mock *Serf) JoinCalled() bool
- func (mock *Serf) JoinCalls() []struct{ ... }
- func (mock *Serf) Member(memberID int32) *jocko.ClusterMember
- func (mock *Serf) MemberCalled() bool
- func (mock *Serf) MemberCalls() []struct{ ... }
- func (mock *Serf) Reset()
- func (mock *Serf) Shutdown() error
- func (mock *Serf) ShutdownCalled() bool
- func (mock *Serf) ShutdownCalls() []struct{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMetrics ¶
Types ¶
type Broker ¶
type Broker struct { // JoinFunc mocks the Join method. JoinFunc func(addr ...string) protocol.Error // RunFunc mocks the Run method. RunFunc func(in1 context.Context, in2 <-chan jocko.Request, in3 chan<- jocko.Response) // ShutdownFunc mocks the Shutdown method. ShutdownFunc func() error // contains filtered or unexported fields }
Broker is a mock implementation of Broker.
func TestSomethingThatUsesBroker(t *testing.T) { // make and configure a mocked Broker mockedBroker := &Broker{ JoinFunc: func(addr ...string) protocol.Error { panic("TODO: mock out the Join method") }, RunFunc: func(in1 context.Context,in2 <-chan jocko.Request,in3 chan<- jocko.Response) { panic("TODO: mock out the Run method") }, ShutdownFunc: func() error { panic("TODO: mock out the Shutdown method") }, } // TODO: use mockedBroker in code that requires Broker // and then make assertions. }
func (*Broker) JoinCalled ¶
JoinCalled returns true if at least one call was made to Join.
func (*Broker) JoinCalls ¶
JoinCalls gets all the calls that were made to Join. Check the length with:
len(mockedBroker.JoinCalls())
func (*Broker) RunCalls ¶
func (mock *Broker) RunCalls() []struct { In1 context.Context In2 <-chan jocko.Request In3 chan<- jocko.Response }
RunCalls gets all the calls that were made to Run. Check the length with:
len(mockedBroker.RunCalls())
func (*Broker) ShutdownCalled ¶
ShutdownCalled returns true if at least one call was made to Shutdown.
func (*Broker) ShutdownCalls ¶
func (mock *Broker) ShutdownCalls() []struct { }
ShutdownCalls gets all the calls that were made to Shutdown. Check the length with:
len(mockedBroker.ShutdownCalls())
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client for testing
func (*Client) CreateTopic ¶
func (p *Client) CreateTopic(clientID string, createRequest *protocol.CreateTopicRequest) (*protocol.CreateTopicsResponse, error)
func (*Client) FetchMessages ¶
func (p *Client) FetchMessages(clientID string, fetchRequest *protocol.FetchRequest) (*protocol.FetchResponses, 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())
type Raft ¶
type Raft struct { // AddrFunc mocks the Addr method. AddrFunc func() string // ApplyFunc mocks the Apply method. ApplyFunc func(cmd jocko.RaftCommand) error // BootstrapFunc mocks the Bootstrap method. BootstrapFunc func(serf jocko.Serf, serfEventCh <-chan *jocko.ClusterMember, commandCh chan<- jocko.RaftCommand) error // IsLeaderFunc mocks the IsLeader method. IsLeaderFunc func() bool // LeaderIDFunc mocks the LeaderID method. LeaderIDFunc func() string // ShutdownFunc mocks the Shutdown method. ShutdownFunc func() error // contains filtered or unexported fields }
Raft is a mock implementation of Raft.
func TestSomethingThatUsesRaft(t *testing.T) { // make and configure a mocked Raft mockedRaft := &Raft{ AddrFunc: func() string { panic("TODO: mock out the Addr method") }, ApplyFunc: func(cmd jocko.RaftCommand) error { panic("TODO: mock out the Apply method") }, BootstrapFunc: func(serf jocko.Serf,serfEventCh <-chan *jocko.ClusterMember,commandCh chan<- jocko.RaftCommand) error { panic("TODO: mock out the Bootstrap method") }, IsLeaderFunc: func() bool { panic("TODO: mock out the IsLeader method") }, LeaderIDFunc: func() string { panic("TODO: mock out the LeaderID method") }, ShutdownFunc: func() error { panic("TODO: mock out the Shutdown method") }, } // TODO: use mockedRaft in code that requires Raft // and then make assertions. }
func (*Raft) AddrCalled ¶
AddrCalled returns true if at least one call was made to Addr.
func (*Raft) AddrCalls ¶
func (mock *Raft) AddrCalls() []struct { }
AddrCalls gets all the calls that were made to Addr. Check the length with:
len(mockedRaft.AddrCalls())
func (*Raft) ApplyCalled ¶
ApplyCalled returns true if at least one call was made to Apply.
func (*Raft) ApplyCalls ¶
func (mock *Raft) ApplyCalls() []struct { Cmd jocko.RaftCommand }
ApplyCalls gets all the calls that were made to Apply. Check the length with:
len(mockedRaft.ApplyCalls())
func (*Raft) Bootstrap ¶
func (mock *Raft) Bootstrap(serf jocko.Serf, serfEventCh <-chan *jocko.ClusterMember, commandCh chan<- jocko.RaftCommand) error
Bootstrap calls BootstrapFunc.
func (*Raft) BootstrapCalled ¶
BootstrapCalled returns true if at least one call was made to Bootstrap.
func (*Raft) BootstrapCalls ¶
func (mock *Raft) BootstrapCalls() []struct { Serf jocko.Serf SerfEventCh <-chan *jocko.ClusterMember CommandCh chan<- jocko.RaftCommand }
BootstrapCalls gets all the calls that were made to Bootstrap. Check the length with:
len(mockedRaft.BootstrapCalls())
func (*Raft) IsLeaderCalled ¶
IsLeaderCalled returns true if at least one call was made to IsLeader.
func (*Raft) IsLeaderCalls ¶
func (mock *Raft) IsLeaderCalls() []struct { }
IsLeaderCalls gets all the calls that were made to IsLeader. Check the length with:
len(mockedRaft.IsLeaderCalls())
func (*Raft) LeaderIDCalled ¶
LeaderIDCalled returns true if at least one call was made to LeaderID.
func (*Raft) LeaderIDCalls ¶
func (mock *Raft) LeaderIDCalls() []struct { }
LeaderIDCalls gets all the calls that were made to LeaderID. Check the length with:
len(mockedRaft.LeaderIDCalls())
func (*Raft) ShutdownCalled ¶
ShutdownCalled returns true if at least one call was made to Shutdown.
func (*Raft) ShutdownCalls ¶
func (mock *Raft) ShutdownCalls() []struct { }
ShutdownCalls gets all the calls that were made to Shutdown. Check the length with:
len(mockedRaft.ShutdownCalls())
type Serf ¶
type Serf struct { // BootstrapFunc mocks the Bootstrap method. BootstrapFunc func(node *jocko.ClusterMember, reconcileCh chan<- *jocko.ClusterMember) error // ClusterFunc mocks the Cluster method. ClusterFunc func() []*jocko.ClusterMember // IDFunc mocks the ID method. IDFunc func() int32 // JoinFunc mocks the Join method. JoinFunc func(addrs ...string) (int, error) // MemberFunc mocks the Member method. MemberFunc func(memberID int32) *jocko.ClusterMember // ShutdownFunc mocks the Shutdown method. ShutdownFunc func() error // contains filtered or unexported fields }
Serf is a mock implementation of Serf.
func TestSomethingThatUsesSerf(t *testing.T) { // make and configure a mocked Serf mockedSerf := &Serf{ BootstrapFunc: func(node *jocko.ClusterMember,reconcileCh chan<- *jocko.ClusterMember) error { panic("TODO: mock out the Bootstrap method") }, ClusterFunc: func() []*jocko.ClusterMember { panic("TODO: mock out the Cluster method") }, IDFunc: func() int32 { panic("TODO: mock out the ID method") }, JoinFunc: func(addrs ...string) (int, error) { panic("TODO: mock out the Join method") }, MemberFunc: func(memberID int32) *jocko.ClusterMember { panic("TODO: mock out the Member method") }, ShutdownFunc: func() error { panic("TODO: mock out the Shutdown method") }, } // TODO: use mockedSerf in code that requires Serf // and then make assertions. }
func (*Serf) Bootstrap ¶
func (mock *Serf) Bootstrap(node *jocko.ClusterMember, reconcileCh chan<- *jocko.ClusterMember) error
Bootstrap calls BootstrapFunc.
func (*Serf) BootstrapCalled ¶
BootstrapCalled returns true if at least one call was made to Bootstrap.
func (*Serf) BootstrapCalls ¶
func (mock *Serf) BootstrapCalls() []struct { Node *jocko.ClusterMember ReconcileCh chan<- *jocko.ClusterMember }
BootstrapCalls gets all the calls that were made to Bootstrap. Check the length with:
len(mockedSerf.BootstrapCalls())
func (*Serf) Cluster ¶
func (mock *Serf) Cluster() []*jocko.ClusterMember
Cluster calls ClusterFunc.
func (*Serf) ClusterCalled ¶
ClusterCalled returns true if at least one call was made to Cluster.
func (*Serf) ClusterCalls ¶
func (mock *Serf) ClusterCalls() []struct { }
ClusterCalls gets all the calls that were made to Cluster. Check the length with:
len(mockedSerf.ClusterCalls())
func (*Serf) IDCalls ¶
func (mock *Serf) IDCalls() []struct { }
IDCalls gets all the calls that were made to ID. Check the length with:
len(mockedSerf.IDCalls())
func (*Serf) JoinCalled ¶
JoinCalled returns true if at least one call was made to Join.
func (*Serf) JoinCalls ¶
JoinCalls gets all the calls that were made to Join. Check the length with:
len(mockedSerf.JoinCalls())
func (*Serf) Member ¶
func (mock *Serf) Member(memberID int32) *jocko.ClusterMember
Member calls MemberFunc.
func (*Serf) MemberCalled ¶
MemberCalled returns true if at least one call was made to Member.
func (*Serf) MemberCalls ¶
MemberCalls gets all the calls that were made to Member. Check the length with:
len(mockedSerf.MemberCalls())
func (*Serf) ShutdownCalled ¶
ShutdownCalled returns true if at least one call was made to Shutdown.
func (*Serf) ShutdownCalls ¶
func (mock *Serf) ShutdownCalls() []struct { }
ShutdownCalls gets all the calls that were made to Shutdown. Check the length with:
len(mockedSerf.ShutdownCalls())