AWSService
public protocol AWSService
Protocol for services objects. Contains a client to communicate with AWS and config for defining how to communicate
-
Client used to communicate with AWS
Declaration
Swift
var client: AWSClient { get }
-
Service context details
Declaration
Swift
var config: AWSServiceConfig { get }
-
Patch initialization
Declaration
Swift
init(from: Self, patch: AWSServiceConfig.Patch)
-
region
Extension methodRegion where service is running
Declaration
Swift
public var region: Region { get }
-
endpoint
Extension methodThe url to use in requests
Declaration
Swift
public var endpoint: String { get }
-
eventLoopGroup
Extension methodThe EventLoopGroup service is using
Declaration
Swift
public var eventLoopGroup: EventLoopGroup { get }
-
signURL(url:
Extension methodhttpMethod: headers: expires: logger: ) Generate a signed URL
Declaration
Swift
public func signURL( url: URL, httpMethod: HTTPMethod, headers: HTTPHeaders = HTTPHeaders(), expires: TimeAmount, logger: Logger = AWSClient.loggingDisabled ) -> EventLoopFuture<URL>
Parameters
url
URL to sign
httpMethod
HTTP method to use (.GET, .PUT, .PUSH etc)
headers
Headers that are to be used with this URL. Be sure to include these headers when you used the returned URL
expires
How long before the signed URL expires
logger
Logger to output to
Return Value
A signed URL
-
signHeaders(url:
Extension methodhttpMethod: headers: body: logger: ) Generate signed headers
Declaration
Swift
public func signHeaders( url: URL, httpMethod: HTTPMethod, headers: HTTPHeaders = HTTPHeaders(), body: AWSPayload = .empty, logger: Logger = AWSClient.loggingDisabled ) -> EventLoopFuture<HTTPHeaders>
Parameters
url
URL to sign
httpMethod
HTTP method to use (.GET, .PUT, .PUSH etc)
headers
Headers that are to be used with this URL. Be sure to include these headers when you used the returned URL
body
body payload to sign as well. While it is unnecessary to provide the body for S3 other services require it
logger
Logger to output to
Return Value
A series of signed headers including the original headers provided to the function
-
with(middlewares:
Extension methodtimeout: byteBufferAllocator: options: ) Return new version of Service with edited parameters
Declaration
Swift
public func with( middlewares: [AWSServiceMiddleware] = [], timeout: TimeAmount? = nil, byteBufferAllocator: ByteBufferAllocator? = nil, options: AWSServiceConfig.Options? = nil ) -> Self
Parameters
middlewares
Additional middleware to add
timeout
Time out value for HTTP requests
byteBufferAllocator
byte buffer allocator used throughout AWSClient
options
options used by client when processing requests
Return Value
New version of the service
-
with(region:
Extension methodmiddlewares: timeout: byteBufferAllocator: options: ) Return new version of Service with edited parameters
Declaration
Swift
public func with( region: Region, middlewares: [AWSServiceMiddleware] = [], timeout: TimeAmount? = nil, byteBufferAllocator: ByteBufferAllocator? = nil, options: AWSServiceConfig.Options? = nil ) -> Self
Parameters
region
Server region
middlewares
Additional middleware to add
timeout
Time out value for HTTP requests
byteBufferAllocator
byte buffer allocator used throughout AWSClient
options
options used by client when processing requests
Return Value
New version of the service
-
signURL(url:
Extension method, asynchronoushttpMethod: headers: expires: logger: ) Generate a signed URL
Declaration
Swift
public func signURL( url: URL, httpMethod: HTTPMethod, headers: HTTPHeaders = HTTPHeaders(), expires: TimeAmount, logger: Logger = AWSClient.loggingDisabled ) async throws -> URL
Parameters
url
URL to sign
httpMethod
HTTP method to use (.GET, .PUT, .PUSH etc)
headers
Headers that are to be used with this URL. Be sure to include these headers when you used the returned URL
expires
How long before the signed URL expires
logger
Logger to output to
Return Value
A signed URL
-
signHeaders(url:
Extension method, asynchronoushttpMethod: headers: body: logger: ) Generate signed headers
Declaration
Swift
public func signHeaders( url: URL, httpMethod: HTTPMethod, headers: HTTPHeaders = HTTPHeaders(), body: AWSPayload = .empty, logger: Logger = AWSClient.loggingDisabled ) async throws -> HTTPHeaders
Parameters
url
URL to sign
httpMethod
HTTP method to use (.GET, .PUT, .PUSH etc)
headers
Headers that are to be used with this URL. Be sure to include these headers when you used the returned URL
body
body payload to sign as well. While it is unnecessary to provide the body for S3 other services require it
logger
Logger to output to
Return Value
A series of signed headers including the original headers provided to the function