Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RareRest #64

Open
TheNitesWhoSay opened this issue Aug 21, 2020 · 0 comments
Open

RareRest #64

TheNitesWhoSay opened this issue Aug 21, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@TheNitesWhoSay
Copy link
Owner

Add another library to RareCpp for REST - using annotation driven methods as endpoints; e.g. in a controller class you might have an update method

    NOTE(update,
        Rest::Method::PATCH,
        Rest::Url{"/update/{value}/{otherValue}"},
        Rest::PathParam<int>{"value"},
        Rest::PathParam<long>{"otherValue"})
    std::string update(int value, long otherValue) {
        this->value = value;
        this->otherValue = otherValue;
        this->status = Status::Cached;
        return "";
    }

Preliminary thoughts on the separate pieces:

Rest::Glass: Everything that necessarily appears in client code (method markup, potentially marking as controller, controller registration if not automatic)
Rest::Controller: Controllers contain one or more methods marked up for REST; controllers must be somehow registered to the engine
Rest::Inpoint: A function within a controller which represents a REST endpoint; with annotations defining the http method, URL component, and parameters
Rest::Engine: That to which the driver registers itself and to which controllers get registered, when an endpoint is hit the driver shall send data to the engine, which shall serialize the data as the appropriate C++ types based on the settings in the controller, then call the appropriate Rest::Inpoint function within the controller
Rest::Driver: The generalized template for system-specific networking code as well as common driver helper methods
MyDriver : Rest::Driver: System-specific networking code
@TheNitesWhoSay TheNitesWhoSay added the enhancement New feature or request label Aug 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant