Documentation ¶
Index ¶
- Variables
- type Cache
- func (c *Cache) AddEventHub(ctx context.Context, eventhub string, namespace *Namespace)
- func (c *Cache) GetLeastPopulatedNamespace() *Namespace
- func (c *Cache) GetNamespace(eventhub string) *Namespace
- func (c *Cache) RemoveEventHub(ctx context.Context, eventhub string)
- func (c *Cache) Update(ctx context.Context) error
- type CacheInterface
- type HubManagerInterface
- type Namespace
Constants ¶
This section is empty.
Variables ¶
View Source
var NewHubManagerFromConnectionStringWrapper = func(connectionString string) (HubManagerInterface, error) { return eventhub.NewHubManagerFromConnectionString(connectionString) }
Azure EventHub HubManager Function Reference Variable To Facilitate Mocking In Unit Tests
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Azure EventHubs Cache Struct
func (*Cache) AddEventHub ¶
Add The Specified EventHub / Namespace To The Cache
func (*Cache) GetLeastPopulatedNamespace ¶
Get The Namespace With The Least Number Of EventHubs
func (*Cache) GetNamespace ¶
Get The Namespace Associated With The Specified EventHub (Topic) Name
func (*Cache) RemoveEventHub ¶
Remove The Specified EventHub / Namespace From The Cache
type CacheInterface ¶
type CacheInterface interface { Update(ctx context.Context) error AddEventHub(ctx context.Context, eventhub string, namespace *Namespace) RemoveEventHub(ctx context.Context, eventhub string) GetNamespace(eventhub string) *Namespace GetLeastPopulatedNamespace() *Namespace }
Define An Interface For The EventHub Cache
type HubManagerInterface ¶
type HubManagerInterface interface { Delete(ctx context.Context, name string) error List(ctx context.Context) ([]*eventhub.HubEntity, error) Put(ctx context.Context, name string, opts ...eventhub.HubManagementOption) (*eventhub.HubEntity, error) }
Azure EventHub Client Doesn't Code To Interfaces Or Provide Mocks So We're Wrapping Our Usage Of The HubManager For Testing
type Namespace ¶
type Namespace struct { Name string Username string Password string Secret string HubManager HubManagerInterface Count int }
Azure EventHubs Namespace Struct
Click to show internal directories.
Click to hide internal directories.