RestModifier

public class RestModifier<R> : RestEndpoint where R : RestEndpoint

A class that wraps a RestEndpoint with additional functionalty. This allows Corvus to chain modifiers, as it gets treated as any other struct conforming to RestEndpoint.

  • The return value of the .query(), so the type being operated on in the current component.

    Declaration

    Swift

    public typealias QuerySubject = R.QuerySubject
  • The return type for the .handler() modifier.

    Declaration

    Swift

    public typealias Element = R.Element
  • The HTTP method of the functionality of the component.

    Declaration

    Swift

    public let operationType: OperationType
  • An array of PathComponent describing the path that the TypedEndpoint extends.

    Declaration

    Swift

    public let pathComponents: [PathComponent]
  • A default implementation of .query() for components that do not require customized database queries.

    Throws

    An error if something goes wrong.

    Declaration

    Swift

    public func query(_ req: Request) throws -> QueryBuilder<R.QuerySubject>

    Parameters

    req

    The incoming Request.

    Return Value

    A QueryBuilder object for further querying.

  • Declaration

    Swift

    public func handler(_ req: Request) throws -> EventLoopFuture<Element>