Documentation ¶
Index ¶
- Variables
- type LoggerUsage
- type Payload
- type Service
- func (s *Service) Close() (multiErr error)
- func (s *Service) GetBatchStorages(tokenID string) (storages []storages.StorageProxy)
- func (s *Service) GetConsumers(tokenID string) (consumers []events.Consumer)
- func (s *Service) GetDestinationByID(id string) (storages.StorageProxy, bool)
- func (s *Service) GetDestinationIDs(tokenID string) map[string]bool
- func (s *Service) GetDestinations(tokenID string) (storages []storages.StorageProxy)
- func (s *Service) GetEventsConsumerByDestinationID(destinationID string) (events.Consumer, bool)
- func (s *Service) GetFactory() storages.Factory
- func (s *Service) GetSynchronousStorages(tokenID string) (storages []storages.StorageProxy)
- func (s *Service) PostHandle(id string, event events.Event) error
- type Status
- type TokenizedConsumers
- type TokenizedIDs
- type TokenizedStorages
- type Unit
Constants ¶
This section is empty.
Variables ¶
var StatusInstance = &Status{Reloading: false}
Functions ¶
This section is empty.
Types ¶
type LoggerUsage ¶
type LoggerUsage struct {
// contains filtered or unexported fields
}
LoggerUsage is used for counting when logger isn't used
type Payload ¶
type Payload struct {
Destinations map[string]config.DestinationConfig `json:"destinations,omitempty"`
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is a reloadable service of events destinations per token
func NewService ¶
func NewService(destinations *viper.Viper, destinationsSource string, storageFactory storages.Factory, loggerFactory *logevents.Factory, strictAuth bool) (*Service, error)
NewService returns loaded Service instance and call resources.Watcher() if destinations source is http url or file path
func NewTestService ¶
func NewTestService(unitsByID map[string]*Unit, consumersByTokenID TokenizedConsumers, storagesByTokenID TokenizedStorages, destinationsIDByTokenID TokenizedIDs, queueConsumerByDestinationID map[string]events.Consumer) *Service
NewTestService returns test instance. It is used only for tests
func (*Service) GetBatchStorages ¶
func (s *Service) GetBatchStorages(tokenID string) (storages []storages.StorageProxy)
func (*Service) GetConsumers ¶
func (*Service) GetDestinationByID ¶
func (s *Service) GetDestinationByID(id string) (storages.StorageProxy, bool)
func (*Service) GetDestinationIDs ¶
func (*Service) GetDestinations ¶
func (s *Service) GetDestinations(tokenID string) (storages []storages.StorageProxy)
func (*Service) GetEventsConsumerByDestinationID ¶
func (*Service) GetFactory ¶
func (*Service) GetSynchronousStorages ¶
func (s *Service) GetSynchronousStorages(tokenID string) (storages []storages.StorageProxy)
type Status ¶
type Status struct {
Reloading bool
}
Status is a singleton struct for storing destinations reloading state. Uploader checks this flag and doesn't upload batch files if Reloading = true
type TokenizedConsumers ¶
map["tokenID"]map["tokenID | destination_name"]interface because 1 token id = 1logger but ∞ event.queue
func (TokenizedConsumers) Add ¶
func (tc TokenizedConsumers) Add(tokenID, name string, proxy events.Consumer)
func (TokenizedConsumers) AddAll ¶
func (tc TokenizedConsumers) AddAll(other TokenizedConsumers)
type TokenizedIDs ¶
map["tokenID"]map["destination_name"]true
func (TokenizedIDs) Add ¶
func (ti TokenizedIDs) Add(tokenID, name string)
func (TokenizedIDs) AddAll ¶
func (ti TokenizedIDs) AddAll(other TokenizedIDs)
type TokenizedStorages ¶
type TokenizedStorages map[string]map[string]storages.StorageProxy
map["tokenID"]map["destination_name"]interface because 1 token id = ∞ storages
func (TokenizedStorages) Add ¶
func (ts TokenizedStorages) Add(tokenID, name string, proxy storages.StorageProxy)
func (TokenizedStorages) AddAll ¶
func (ts TokenizedStorages) AddAll(other TokenizedStorages)
type Unit ¶
type Unit struct {
// contains filtered or unexported fields
}
Unit holds storage bundle for closing at once
func NewTestUnit ¶
func NewTestUnit(storage storages.StorageProxy) *Unit
NewTestUnit returns test unit with test storage. Only for tests
func (*Unit) CloseStorage ¶
CloseStorage runs storages.StorageProxy Close() returns err if occurred