Skip to content
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

docs: backfill missing inline API docs #92

Merged
merged 1 commit into from
Aug 7, 2023
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
5 changes: 5 additions & 0 deletions Sources/MuxUploadSDK/PublicAPI/DirectUpload.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import AVFoundation
import Foundation

/// Indicates whether a finished upload failed due to an error
/// or succeeded along with details
public typealias DirectUploadResult = Result<DirectUpload.SuccessDetails, DirectUploadError>

///
Expand Down Expand Up @@ -341,6 +343,9 @@ public final class DirectUpload {
*/
public var progressHandler: StateHandler?

/**
Details about a ``DirectUpload`` after it successfully finished
*/
public struct SuccessDetails : Sendable, Hashable {
public let finalState: TransportStatus
}
Expand Down
55 changes: 33 additions & 22 deletions Sources/MuxUploadSDK/PublicAPI/Options/DirectUploadOptions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,43 @@

import Foundation

// MARK: - Direct Upload Options

/// Options for the direct upload
public struct DirectUploadOptions {

// MARK: - Transport Options

/// Options to control the SDK network operations to
/// transport the direct upload input to Mux
/// Options to adjust ``DirectUpload`` chunk transport
/// over the network.
public struct Transport {

/// At least 8M is recommended
/// The size of each file chunk in bytes sent by the
/// SDK during an upload. At least 8MB is recommended.
public var chunkSizeInBytes: Int

/// Number of retry attempts per chunk if the
/// associated request fails
/// Number of retry attempts per chunk if its upload
/// request is unsuccessful
public var retryLimitPerChunk: Int

/// A default set of transport options: 8MB chunk
/// size and chunk request retry limit of 3
/// Default options for ``DirectUpload`` chunk transport
/// over the network. The chunk size is 8MB and the
/// per-chunk retry limit is 3.
public static var `default`: Transport {
Transport(
chunkSizeInBytes: 8 * 1024 * 1024,
retryLimitPerChunk: 3
)
}

/// Initializes options that govern network transport
/// by the SDK
/// Initializes options for upload chunk transport
/// over the network
///
/// - Parameters:
/// - chunkSize: the size of each file chunk in
/// - chunkSizeInBytes: the size of each file chunk in
/// bytes the SDK sends when uploading, default
/// value is 8MB
/// - retriesPerChunk: number of retry attempts
/// - retryLimitPerChunk: number of retry attempts
/// if the chunk request fails, default value is 3
public init(
chunkSizeInBytes: Int = 8 * 1024 * 1024,
Expand All @@ -52,7 +56,9 @@ public struct DirectUploadOptions {

// MARK: - Input Standardization Options

/// Options controlling direct upload input standardization
/// Options for adjusments made by ``DirectUpload``
/// to some inputs to minimize processing time during
/// ingestion
public struct InputStandardization {

/// If requested the SDK will attempt to detect
Expand Down Expand Up @@ -124,8 +130,8 @@ public struct DirectUploadOptions {
maximumResolution: .default
)

// Kept private to an invalid combination of parameters
// being used for initialization
// Kept private to avoid an invalid combination of
// parameters being used for initialization
private init(
isRequested: Bool,
maximumResolution: MaximumResolution
Expand All @@ -134,10 +140,8 @@ public struct DirectUploadOptions {
self.maximumResolution = maximumResolution
}

/// Used to initialize ``DirectUploadOptions.InputStandardization``
/// with that enables input standardization with
/// a maximum resolution
///
/// Initializes options that request input
/// standardization with a custom maximum resolution
/// - Parameters:
/// - maximumResolution: the maximum resolution
/// of the standardized input
Expand Down Expand Up @@ -213,11 +217,18 @@ public struct DirectUploadOptions {
/// disable standardizing the format of the direct
/// upload inputs, it is requested by default. To
/// prevent the SDK from making any changes to the
/// - Parameters:
/// - eventTracking: event tracking options for the
/// direct upload
/// - inputStandardization: options to enable or
/// disable standardizing the format of the direct
/// upload inputs. True by default.
/// To prevent the SDK from making any changes to the
/// format of the input use ``DirectUploadOptions.InputStandardization.skipped``
/// - chunkSize: the size of each file chunk in
/// bytes the SDK sends when uploading, default
/// value is 8MB
/// - retriesPerChunk: number of retry attempts
/// - chunkSizeInBytes: The size of each file chunk
/// in bytes sent by the SDK during an upload.
/// Defaults to 8MB.
/// - retryLimitPerChunk: number of retry attempts
/// if the chunk request fails, default value is 3
public init(
eventTracking: EventTracking = .default,
Expand Down
1 change: 1 addition & 0 deletions Sources/MuxUploadSDK/PublicAPI/Version.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import Foundation

/// Version information about the SDK
public struct Version {
/// Major version.
public static let major = 0
Expand Down