Structures
The following structures are available globally.
-
The Configuration is used to configure Cauli at initialization time. The
See moreConfiguration.standard
is a sensibly chosen configuration set.Declaration
Swift
public struct Configuration
-
A RecordSelector defines a selection of a Record object. It is used in the
See moreConfiguration.recordSelector
to define a subset of Records that should be handled by a Cauli instance.Declaration
Swift
public struct RecordSelector
-
A record represents a full roundtrip of a URLRequest and it’s response.
See moreDeclaration
Swift
public struct Record
extension Record: Codable
-
The
See moreResponse
wrapps theURLResponse
and the data received from the server.Declaration
Swift
public struct Response : Codable
-
A
Mapping
is a declaration of a single mapping. All urls that match the description of thesourceLocation
will be changed according to the description in thedestinationLocation
. Allnil
values are ignored in this case.Examples
This
Mapping
will update all http requests to https requests.Mapping(name: "https-ify", sourceLocation: MappingLocation(scheme: "http"), destinationLocation: MappingLocation(scheme: "https"))
This mapping will redirect all requests to localhost.
See moreMapping(name: "map local", sourceLocation: MappingLocation(), destinationLocation: MappingLocation(host: "localhost")
Declaration
Swift
public struct Mapping
-
A mapping location describes a given part of a url. The mapping location can be used to either filter urls, or to apply changes on the url.
See moreDeclaration
Swift
public struct MappingLocation
-
A RecordModifier defines the modification of a Record
See moreDeclaration
Swift
public struct RecordModifier