Documentation
¶
Index ¶
- type Clienter
- type ClienterMock
- func (mock *ClienterMock) AddNavigationCache(ctx context.Context, updateInterval *time.Duration) error
- func (mock *ClienterMock) AddNavigationCacheCalls() []struct{ ... }
- func (mock *ClienterMock) Close()
- func (mock *ClienterMock) CloseCalls() []struct{}
- func (mock *ClienterMock) GetNavigationData(ctx context.Context, lang string) (*topicModel.Navigation, error)
- func (mock *ClienterMock) GetNavigationDataCalls() []struct{ ... }
- func (mock *ClienterMock) StartBackgroundUpdate(ctx context.Context, errorChannel chan error)
- func (mock *ClienterMock) StartBackgroundUpdateCalls() []struct{ ... }
- type Clients
- type PublishingClient
- func (hpc *PublishingClient) AddNavigationCache(ctx context.Context, updateInterval *time.Duration) error
- func (hpc *PublishingClient) Close()
- func (hpc *PublishingClient) GetNavigationData(ctx context.Context, lang string) (*topicModel.Navigation, error)
- func (hpc *PublishingClient) StartBackgroundUpdate(ctx context.Context, errorChannel chan error)
- type Updater
- type WebClient
- func (hwc *WebClient) AddNavigationCache(ctx context.Context, updateInterval *time.Duration) error
- func (hwc *WebClient) Close()
- func (hwc *WebClient) GetNavigationData(ctx context.Context, lang string) (*topicModel.Navigation, error)
- func (hwc *WebClient) StartBackgroundUpdate(ctx context.Context, errorChannel chan error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Clienter ¶
type Clienter interface {
Close()
StartBackgroundUpdate(ctx context.Context, errorChannel chan error)
}
Clienter is an interface with methods required for navigation cache
func NewPublishingClient ¶
type ClienterMock ¶
type ClienterMock struct {
AddNavigationCacheFunc func(ctx context.Context, updateInterval *time.Duration) error
// CloseFunc mocks the Close method.
CloseFunc func()
GetNavigationDataFunc func(ctx context.Context, lang string) (*topicModel.Navigation, error)
// StartBackgroundUpdateFunc mocks the StartBackgroundUpdate method.
StartBackgroundUpdateFunc func(ctx context.Context, errorChannel chan error)
// contains filtered or unexported fields
}
ClienterMock is a mock implementation of Clienter.
func TestSomethingThatUsesClienter(t *testing.T) {
// make and configure a mocked Clienter
mockedClienter := &ClienterMock{
AddNavigationCacheFunc: func(ctx context.Context, updateInterval time.Duration) error {
panic("mock out the AddNavigationCache method")
},
CloseFunc: func() {
panic("mock out the Close method")
},
GetNavigationDataFunc: func(ctx context.Context, lang string) (*topicModel.Navigation, error) {
panic("mock out the GetNavigationData method")
},
StartBackgroundUpdateFunc: func(ctx context.Context, errorChannel chan error) {
panic("mock out the StartBackgroundUpdate method")
},
}
// use mockedClienter in code that requires Clienter
// and then make assertions.
}
func (*ClienterMock) AddNavigationCache ¶
func (mock *ClienterMock) AddNavigationCache(ctx context.Context, updateInterval *time.Duration) error
AddNavigationCache calls AddNavigationCacheFunc.
func (*ClienterMock) AddNavigationCacheCalls ¶
func (mock *ClienterMock) AddNavigationCacheCalls() []struct { Ctx context.Context UpdateInterval time.Duration }
AddNavigationCacheCalls gets all the calls that were made to AddNavigationCache. Check the length with:
len(mockedClienter.AddNavigationCacheCalls())
func (*ClienterMock) CloseCalls ¶
func (mock *ClienterMock) CloseCalls() []struct { }
CloseCalls gets all the calls that were made to Close. Check the length with:
len(mockedClienter.CloseCalls())
func (*ClienterMock) GetNavigationData ¶
func (mock *ClienterMock) GetNavigationData(ctx context.Context, lang string) (*topicModel.Navigation, error)
GetNavigationData calls GetNavigationDataFunc.
func (*ClienterMock) GetNavigationDataCalls ¶
func (mock *ClienterMock) GetNavigationDataCalls() []struct { Ctx context.Context Lang string }
GetNavigationDataCalls gets all the calls that were made to GetNavigationData. Check the length with:
len(mockedClienter.GetNavigationDataCalls())
func (*ClienterMock) StartBackgroundUpdate ¶
func (mock *ClienterMock) StartBackgroundUpdate(ctx context.Context, errorChannel chan error)
StartBackgroundUpdate calls StartBackgroundUpdateFunc.
func (*ClienterMock) StartBackgroundUpdateCalls ¶
func (mock *ClienterMock) StartBackgroundUpdateCalls() []struct { Ctx context.Context ErrorChannel chan error }
StartBackgroundUpdateCalls gets all the calls that were made to StartBackgroundUpdate. Check the length with:
len(mockedClienter.StartBackgroundUpdateCalls())
type PublishingClient ¶
type PublishingClient struct {
Updater
// contains filtered or unexported fields
}
func (*PublishingClient) AddNavigationCache ¶
func (*PublishingClient) Close ¶
func (hpc *PublishingClient) Close()
func (*PublishingClient) GetNavigationData ¶
func (hpc *PublishingClient) GetNavigationData(ctx context.Context, lang string) (*topicModel.Navigation, error)
func (*PublishingClient) StartBackgroundUpdate ¶
func (hpc *PublishingClient) StartBackgroundUpdate(ctx context.Context, errorChannel chan error)
type Updater ¶
type Updater struct {
// contains filtered or unexported fields
}
func (*Updater) UpdateNavigationData ¶
func (hu *Updater) UpdateNavigationData(ctx context.Context, lang string) func() *topicModel.Navigation
type WebClient ¶
type WebClient struct {
Updater
// contains filtered or unexported fields
}
func (*WebClient) AddNavigationCache ¶
func (*WebClient) GetNavigationData ¶
func (hwc *WebClient) GetNavigationData(ctx context.Context, lang string) (*topicModel.Navigation, error)