2018-11-19 12:44:58 +03:00
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
|
|
|
|
#import "MSChannelProtocol.h"
|
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
|
|
|
@class MSChannelUnitConfiguration;
|
|
|
|
|
|
|
|
@protocol MSIngestionProtocol;
|
|
|
|
@protocol MSChannelUnitProtocol;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* `MSChannelGroupProtocol` represents a kind of channel that contains constituent MSChannelUnit objects. When an operation from the
|
|
|
|
* `MSChannelProtocol` is performed on the group, that operation should be propagated to its constituent MSChannelUnit objects.
|
|
|
|
*/
|
|
|
|
@protocol MSChannelGroupProtocol <MSChannelProtocol>
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Initialize a channel unit with the given configuration.
|
|
|
|
*
|
|
|
|
* @param configuration channel configuration.
|
|
|
|
*
|
|
|
|
* @return The added `MSChannelUnitProtocol`. Use this object to enqueue logs.
|
|
|
|
*/
|
|
|
|
- (id<MSChannelUnitProtocol>)addChannelUnitWithConfiguration:(MSChannelUnitConfiguration *)configuration;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Initialize a channel unit with the given configuration.
|
|
|
|
*
|
|
|
|
* @param configuration channel configuration.
|
|
|
|
* @param ingestion The alternative ingestion object
|
|
|
|
*
|
|
|
|
* @return The added `MSChannelUnitProtocol`. Use this object to enqueue logs.
|
|
|
|
*/
|
|
|
|
- (id<MSChannelUnitProtocol>)addChannelUnitWithConfiguration:(MSChannelUnitConfiguration *)configuration
|
|
|
|
withIngestion:(nullable id<MSIngestionProtocol>)ingestion;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Change the base URL (schema + authority + port only) used to communicate with the backend.
|
|
|
|
*
|
|
|
|
* @param logUrl base URL to use for backend communication.
|
|
|
|
*/
|
|
|
|
- (void)setLogUrl:(NSString *)logUrl;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the app secret.
|
|
|
|
*
|
|
|
|
* @param appSecret The app secret.
|
|
|
|
*/
|
|
|
|
- (void)setAppSecret:(NSString *)appSecret;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the maximum size of the internal storage. This method must be called before App Center is started.
|
|
|
|
*
|
|
|
|
* @discussion The default maximum database size is 10485760 bytes (10 MiB).
|
|
|
|
*
|
2018-12-02 22:31:00 +03:00
|
|
|
* @param sizeInBytes Maximum size of the internal storage in bytes. This will be rounded up to the nearest multiple of a SQLite page size
|
2019-02-13 00:00:16 +03:00
|
|
|
* (default is 4096 bytes). Values below 20480 bytes (20 KiB) will be ignored.
|
2018-11-19 12:44:58 +03:00
|
|
|
* @param completionHandler Callback that is invoked when the database size has been set. The `BOOL` parameter is `YES` if changing the size
|
|
|
|
* is successful, and `NO` otherwise.
|
|
|
|
*/
|
|
|
|
- (void)setMaxStorageSize:(long)sizeInBytes completionHandler:(nullable void (^)(BOOL))completionHandler;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return a channel unit instance for the given groupId.
|
|
|
|
*
|
|
|
|
* @param groupId The group ID for a channel unit.
|
|
|
|
*
|
|
|
|
* @return A channel unit instance or `nil`.
|
|
|
|
*/
|
|
|
|
- (id<MSChannelUnitProtocol>)channelUnitForGroupId:(NSString *)groupId;
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_END
|