FSTDatabaseInfo.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * Copyright 2017 Google
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #import <Foundation/Foundation.h>
  17. @class FSTDatabaseID;
  18. NS_ASSUME_NONNULL_BEGIN
  19. /** FSTDatabaseInfo contains data about the database. */
  20. @interface FSTDatabaseInfo : NSObject
  21. /**
  22. * Creates and returns a new FSTDatabaseInfo.
  23. *
  24. * @param databaseID The project/database to use.
  25. * @param persistenceKey A unique identifier for this Firestore's local storage. Usually derived
  26. * from -[FIRApp appName].
  27. * @param host The hostname of the datastore backend.
  28. * @param sslEnabled Whether to use SSL when connecting.
  29. * @return A new instance of FSTDatabaseInfo.
  30. */
  31. + (instancetype)databaseInfoWithDatabaseID:(FSTDatabaseID *)databaseID
  32. persistenceKey:(NSString *)persistenceKey
  33. host:(NSString *)host
  34. sslEnabled:(BOOL)sslEnabled;
  35. /** The database info. */
  36. @property(nonatomic, strong, readonly) FSTDatabaseID *databaseID;
  37. /** The application name, taken from FIRApp. */
  38. @property(nonatomic, copy, readonly) NSString *persistenceKey;
  39. /** The hostname of the backend. */
  40. @property(nonatomic, copy, readonly) NSString *host;
  41. /** Whether to use SSL when connecting. */
  42. @property(nonatomic, readonly, getter=isSSLEnabled) BOOL sslEnabled;
  43. @end
  44. NS_ASSUME_NONNULL_END