Skip to content

Updated access levels on storage classes. #306

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/Segment/Utilities/HTTPClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Foundation
import FoundationNetworking
#endif

enum HTTPClientErrors: Error {
public enum HTTPClientErrors: Error {
case badSession
case failedToOpenBatch
case statusCode(code: Int)
Expand Down
2 changes: 1 addition & 1 deletion Sources/Segment/Utilities/Storage/TransientDB.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
import Foundation

internal class TransientDB {
public class TransientDB {
// our data store
internal let store: any DataStore
// keeps items added in the order given.
Expand Down
12 changes: 10 additions & 2 deletions Sources/Segment/Utilities/Storage/Types/DirectoryStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,23 @@

import Foundation

internal class DirectoryStore: DataStore {
typealias StoreConfiguration = Configuration
public class DirectoryStore: DataStore {
public typealias StoreConfiguration = Configuration

public struct Configuration {
let writeKey: String
let storageLocation: URL
let baseFilename: String
let maxFileSize: Int
let indexKey: String

public init(writeKey: String, storageLocation: URL, baseFilename: String, maxFileSize: Int, indexKey: String) {
self.writeKey = writeKey
self.storageLocation = storageLocation
self.baseFilename = baseFilename
self.maxFileSize = maxFileSize
self.indexKey = indexKey
}
}

public var hasData: Bool {
Expand Down
6 changes: 6 additions & 0 deletions Sources/Segment/Utilities/Storage/Types/MemoryStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ public class MemoryStore: DataStore {
let writeKey: String
let maxItems: Int
let maxFetchSize: Int

public init(writeKey: String, maxItems: Int, maxFetchSize: Int) {
self.writeKey = writeKey
self.maxItems = maxItems
self.maxFetchSize = maxFetchSize
}
}

internal struct ItemData {
Expand Down