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

USER: User instance specs #5

Open
seitbekir opened this issue Sep 10, 2017 · 0 comments
Open

USER: User instance specs #5

seitbekir opened this issue Sep 10, 2017 · 0 comments

Comments

@seitbekir
Copy link
Owner

For current user an instance might be available from req.user. Any another user has to be available from req.socket.user(userId). For unavailable user it has to return undefined. If no user connection -- user instance has to be destroyed.

User instance has to contain few vars and methods.

interface User {
    get id() { } // returns userId

    get session() { } // get session data for user
    set session() { } // set session data for user

    get length() { } // returns a number of user connection in current state.
    get connections() { } // returns a list of available connection instances

    get(url, body) { } // make get request to client
    post(url, body) { } // make post request to client
    put(url, body) { } // make put request to client
    patch(url, body) { } // make patch request to client
    delete(url, body) { } // make delete request to client
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant