Hi Mahendra, allow me to point something, as far i can see on this matter, there are two things i would like to address separately:
1) Making a REST API for you application (that can be accessed through http (e.g: an app running in a web server) or, why not?, locally (e.g: an app running that uses stdin for receiving input)). 2) Long running task that executed in background, that may be canceled or query about it progress. 2.BIS) Making (2) part of the language elements so the devs have a solution at hand for dealing with something that is not trivial [I follow the conversation i saw that there is a debate over it, if i have to code less then i accept!! :P) *Key points* ** I don't see why you need to approach both things at the same time. * For (1) i will *strongly *suggest to read this article <https://dzone.com/articles/common-rest-design-pattern>, it really helps me when i face my first set of entry-points (or end-points). I do know that is not easy to define an URL with a name that is accordenly to the business domain and that provides granular access to the data that the client may require. * For start i would suggest to use the prefix "/api/v1/" for each URL that maps to an end-point. * Then you should start by providing the more granular points for getting data, thus allowing the client to combine the data according to the UI/UX needs (assuming that is a client app elsewhere) * For (2) you will find that the article i suggest above <https://dzone.com/articles/common-rest-design-pattern> has a suggestion for dealing with them, a solution that is langauge agnostic (serach for "Transaction Resource"), so i guess that would be a good starting point to think how to design the system not attached to a library instead attaching to bussiness domain logic that shall be reflected in the solution domain. Hope you can understand what i'm trying to explain and really hope that it helps a little at least. Greetings V El domingo, 13 de enero de 2019, 7:13:23 (UTC-3), Mahendra Bhoir escribió: > > Hi I am new to golang. I am writing some RESTful apis. I have read > somewhere that using context while writing RESTful apis is good practice. > But context seems very confusing to me and I can write restful apis > without context.I know the uses of context but same can be done without > using context. > Any suggestions.. Example codes will be appreciated. > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.