Documentation
¶
Overview ¶
Package testclient contains test helpers that reference the SDK-related packages. These are in sharedtest/testclient rather than just sharedtest so that sharedtest can be used by those packages without a circular reference.
Index ¶
- func ClientFactoryThatFails(err error) sdks.ClientFactoryFunc
- func CreateDummyClient(sdkKey config.SDKKey, sdkConfig ld.Config, timeout time.Duration) (sdks.LDClientContext, error)
- func FakeHashForContext(context ldcontext.Context) string
- func FakeLDClientFactory(shouldBeInitialized bool) sdks.ClientFactoryFunc
- func FakeLDClientFactoryWithChannel(shouldBeInitialized bool, createdCh chan<- *FakeLDClient, ...) sdks.ClientFactoryFunc
- func RealLDClientFactoryWithChannel(shouldBeInitialized bool, createdCh chan<- CapturedLDClient) sdks.ClientFactoryFunc
- type CapturedLDClient
- type FakeDataDestination
- func (d *FakeDataDestination) Apply(changeSet subsystems.ChangeSet)
- func (d *FakeDataDestination) ApplyDelta(changes []subsystems.Change, selector subsystems.Selector, persist bool)
- func (d *FakeDataDestination) Selector() subsystems.Selector
- func (d *FakeDataDestination) SetBasis(changes []subsystems.Change, selector subsystems.Selector, persist bool)
- type FakeLDClient
- func (c *FakeLDClient) AwaitClose(t *testing.T, timeout time.Duration)
- func (c *FakeLDClient) Close() error
- func (c *FakeLDClient) GetDataSourceStatus() interfaces.DataSourceStatus
- func (c *FakeLDClient) GetDataStoreStatus() sdks.DataStoreStatusInfo
- func (c *FakeLDClient) Initialized() bool
- func (c *FakeLDClient) SecureModeHash(context ldcontext.Context) string
- func (c *FakeLDClient) SetDataSourceStatus(newStatus interfaces.DataSourceStatus)
- type FakeStore
- func (s *FakeStore) Apply(changeSet subsystems.ChangeSet)
- func (s *FakeStore) Close() error
- func (s *FakeStore) Get(kind ldstoretypes.DataKind, key string) (ldstoretypes.ItemDescriptor, error)
- func (s *FakeStore) GetAll(kind ldstoretypes.DataKind) ([]ldstoretypes.KeyedItemDescriptor, error)
- func (s *FakeStore) InvalidateClientSideState()
- func (s *FakeStore) IsInitialized() bool
- func (s *FakeStore) Selector() subsystems.Selector
- func (s *FakeStore) Snapshot() (map[ldstoretypes.DataKind][]ldstoretypes.KeyedItemDescriptor, ...)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClientFactoryThatFails ¶
func ClientFactoryThatFails(err error) sdks.ClientFactoryFunc
func CreateDummyClient ¶
func FakeHashForContext ¶
func FakeLDClientFactory ¶
func FakeLDClientFactory(shouldBeInitialized bool) sdks.ClientFactoryFunc
func FakeLDClientFactoryWithChannel ¶
func FakeLDClientFactoryWithChannel(shouldBeInitialized bool, createdCh chan<- *FakeLDClient, changeSetCh <-chan subsystems.ChangeSet) sdks.ClientFactoryFunc
func RealLDClientFactoryWithChannel ¶
func RealLDClientFactoryWithChannel(shouldBeInitialized bool, createdCh chan<- CapturedLDClient) sdks.ClientFactoryFunc
Types ¶
type CapturedLDClient ¶
type CapturedLDClient struct {
Key config.SDKKey
Client sdks.LDClientContext
}
type FakeDataDestination ¶
type FakeDataDestination struct {
// contains filtered or unexported fields
}
func NewFakeDataDestination ¶
func NewFakeDataDestination(store *FakeStore) *FakeDataDestination
func (*FakeDataDestination) Apply ¶
func (d *FakeDataDestination) Apply(changeSet subsystems.ChangeSet)
func (*FakeDataDestination) ApplyDelta ¶
func (d *FakeDataDestination) ApplyDelta(changes []subsystems.Change, selector subsystems.Selector, persist bool)
func (*FakeDataDestination) Selector ¶
func (d *FakeDataDestination) Selector() subsystems.Selector
func (*FakeDataDestination) SetBasis ¶
func (d *FakeDataDestination) SetBasis(changes []subsystems.Change, selector subsystems.Selector, persist bool)
type FakeLDClient ¶
type FakeLDClient struct {
Key config.SDKKey
CloseCh chan struct{}
// contains filtered or unexported fields
}
func (*FakeLDClient) AwaitClose ¶
func (c *FakeLDClient) AwaitClose(t *testing.T, timeout time.Duration)
func (*FakeLDClient) Close ¶
func (c *FakeLDClient) Close() error
func (*FakeLDClient) GetDataSourceStatus ¶
func (c *FakeLDClient) GetDataSourceStatus() interfaces.DataSourceStatus
func (*FakeLDClient) GetDataStoreStatus ¶
func (c *FakeLDClient) GetDataStoreStatus() sdks.DataStoreStatusInfo
func (*FakeLDClient) Initialized ¶
func (c *FakeLDClient) Initialized() bool
func (*FakeLDClient) SecureModeHash ¶
func (c *FakeLDClient) SecureModeHash(context ldcontext.Context) string
func (*FakeLDClient) SetDataSourceStatus ¶
func (c *FakeLDClient) SetDataSourceStatus(newStatus interfaces.DataSourceStatus)
type FakeStore ¶
type FakeStore struct {
// contains filtered or unexported fields
}
func NewFakeStore ¶
func NewFakeStore(collections []ldstoretypes.Collection) *FakeStore
func (*FakeStore) Apply ¶
func (s *FakeStore) Apply(changeSet subsystems.ChangeSet)
func (*FakeStore) Get ¶
func (s *FakeStore) Get(kind ldstoretypes.DataKind, key string) (ldstoretypes.ItemDescriptor, error)
func (*FakeStore) GetAll ¶
func (s *FakeStore) GetAll(kind ldstoretypes.DataKind) ([]ldstoretypes.KeyedItemDescriptor, error)
func (*FakeStore) InvalidateClientSideState ¶
func (s *FakeStore) InvalidateClientSideState()
func (*FakeStore) IsInitialized ¶
func (*FakeStore) Selector ¶
func (s *FakeStore) Selector() subsystems.Selector
func (*FakeStore) Snapshot ¶
func (s *FakeStore) Snapshot() (map[ldstoretypes.DataKind][]ldstoretypes.KeyedItemDescriptor, subsystems.Selector, error)
Click to show internal directories.
Click to hide internal directories.