Group

public struct Group : Endpoint

A component capable of grouping multiple components conforming to Endpoint under a HTTP route defined by pathComponents. This path is successively within the tree hierarchy, meaning a Group's route path consists of its PathComponents and those of the Group's above it in the hierarchy.

  • The content of the BasicAuthGroup, which can be any kind of Corvus component.

    Declaration

    Swift

    public var content: Endpoint
  • Creates a Group from a path and a builder function passed as a closure.

    Declaration

    Swift

    public init(
        _ pathComponents: PathComponent...,
        @EndpointBuilder content: () -> Endpoint
    )

    Parameters

    pathComponents

    One or more objects describing the route.

    content

    An EndpointBuilder, which is a function builder that takes in multiple Endpoints and returns them as a single Endpoint.

  • Creates a Group from a path and a builder function passed as a closure.

    Declaration

    Swift

    public init(
        _ pathComponents: [PathComponent],
        @EndpointBuilder content: () -> Endpoint
    )

    Parameters

    pathComponents

    One or more objects describing the route.

    content

    An EndpointBuilder, which is a function builder that takes in multiple Endpoints and returns them as a single Endpoint.

  • A method that registers the content of the Group to the supplied RoutesBuilder.

    Declaration

    Swift

    public func register(to routes: RoutesBuilder)

    Parameters

    routes

    A RoutesBuilder containing all the information about the HTTP route leading to the current component.