SwiftBMLSDK_Query

public struct SwiftBMLSDK_Query

This struct is for generating queries to instances of LGV_MeetingServer, and returning the parsed results.

It is designed for minimal filtering. Most filter parameters are for paging the search, or filtering for specific meeting types. Most filtering should be performed on the results.

This is the “working” part of the SwiftBMLSDK system. You instantiate an instance of this struct, and everything else comes from that.

Supported Systems

This will support iOS 16 (and greater), iPadOS 16 (and greater), tvOS 16 (and greater), macOS 13 (and greater), and watchOS 9 (and greater)

This requires Swift 5 or greater.

Usage

Instantiate this struct with a URL to an LGV_MeetingServer implementation.

For example:

SwiftBMLSDK_Query(serverBaseURI: URL(string: "https://littlegreenviper.com/LGV_MeetingServer/Tests/entrypoint.php"))

creates an instance, based on the LGV test server.

Once the struct is instantiated, it can then be queried. Responses to queries are a SwiftBMLSDK_Parser instance, which contains and interprets the found set.

There are limited parameters to queries, as it is expected that most of the filtering and sorting will be performed on the found set of meeting instances.

Querying the Server

There are only two public query methods:

  • serverInfo(completion:) This is a method that fetches the general information structure from the server, and presents it as a ServerInfo struct.

  • meetingSearch(specification:completion:) This actually queries the server for a set of meetings, based on a SearchSpecification instance, and provides an instance of SwiftBMLSDK_Parser to a completion function.

Dependencies

This type has no dependencies, other than the Foundation and CoreLocation SDKs, provided by Apple.

  • This is the completion function for the server info query.

    Note

    The completion may be called in any thread!

    Declaration

    Swift

    public typealias ServerInfoResultCompletion = (ServerInfo?, Error?) -> Void
  • This is the completion function for the meeting search query.

    Note

    The completion may be called in any thread!

    Declaration

    Swift

    public typealias QueryResultCompletion = (SwiftBMLSDK_Parser?, Error?) -> Void

Server Info Struct

  • This is the response to the general server info query. It contains information about all the individual servers, represented by the aggregator server.

    See more

    Declaration

    Swift

    public struct ServerInfo

Search Specification Struct

  • This struct is what we use to prescribe the search spec.

    Search specifications are quite simple. We only have the meeting type, location/radius (for in-person meetings), and paging options (to break up large found sets).

    See more

    Declaration

    Swift

    public struct SearchSpecification
  • Default initializer.

    Declaration

    Swift

    public init(serverBaseURI inServerBaseURI: URL? = nil)

    Parameters

    serverBaseURI

    The URL to the “base (main directory) of an instance of LGV_MeetingServer. Optional. Can be omitted.

Computed Properties

  • Accessor for the base URI.

    Declaration

    Swift

    public var serverBaseURI: URL? { get set }

Instance Methods