Skip to content

Added a client ip into controller instance #1069

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

Merged
merged 1 commit into from
Jun 25, 2016

Conversation

jeevatkm
Copy link
Contributor

Implementation for #1068

@jeevatkm jeevatkm added topic-controller type-enhancement New enhancement of existing feature labels Jun 18, 2016
@jeevatkm jeevatkm added this to the v0.14 milestone Jun 18, 2016
@jeevatkm jeevatkm self-assigned this Jun 18, 2016
@brendensoares
Copy link
Member

We should consider the field name. Revel was inspired from the Rails and Play web frameworks. We can also consider the naming in other popular web frameworks like Node.JS and PHP:

Does anyone have any preference? I feel there is value in choosing a naming convention that will be familiar to developers who have used other web frameworks.

@jeevatkm
Copy link
Contributor Author

jeevatkm commented Jun 18, 2016

I have read your inputs, below is equivalent to Go http.Request.RemoteAddr and it's language level-

Below one, customized by respective framework-

Now, let's come to Revel. It can provide -

  • ServerIP - comes from app.conf - http.addr or local loopback address
    • Or We call this as IP and add documentation explaining this is server ip. Like Ruby SO question
  • ClientIP or RemoteIP in the Controller
    • Both terms is known in the industry and developers familiar to it

@jeevatkm
Copy link
Contributor Author

@brendensoares what is the final take on this?

@brendensoares
Copy link
Member

Thanks for taking the time to consider our options on this. Let's merge this!

@brendensoares
Copy link
Member

PS - what can we do to document this new API addition?

@jeevatkm
Copy link
Contributor Author

ClientIP method already has godoc, all we need to do is updating controller attributes in the manual.

@jeevatkm jeevatkm merged commit cb9d72e into develop Jun 25, 2016
@jeevatkm jeevatkm deleted the add-clientip-to-controller branch June 26, 2016 02:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-controller type-enhancement New enhancement of existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy