Go API Tutorial - Make An API With Go

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hello everybody and welcome to another youtube video in today's video i will be showing you how to make an api in go now specifically we're going to be using a framework called jin this is a high performance and relatively simple web framework that allows us to very quickly design and create an api in go now before i get into the actual content here and start writing any code i just want to give you some prerequisites because this tutorial is not for absolute beginners so i'm going to assume that you have some familiarity with go if you do not and you want to learn go i have an entire tutorial series on this channel so i'll put something on the screen and there'll be a link in the description to that series but i'm going to assume you have some familiarity with the language and with apis now i will explain a lot of the api concepts like a get request a po post request a response a request but it will be helpful to have some of that knowledge already and that's pretty much it for the prerequisites so with that said let's go ahead and get into the video after a quick word from our sponsor thanks to server pronto for sponsoring this video server pronto provides dedicated bare metal servers and private cloud hosting that you can rely on server pronto's unique data center is a service model that lets you get the benefits of having your own data center like customization full access and the security and reliability of a private environment without the huge upfront investment with server pronto you select the setup that is perfect for your use case and pay a fixed monthly fee with no surprise costs server pronto will even help you set up your server provide 24 7 support give you full root access and personalized solutions whether you're building the next tech startup deploying a hobby project hosting mission critical business tools or just looking for an affordable place to back up your data server pronto has a solution for you you can get started with server pronto today by clicking the link in the description and get 10 off by using the promo code creator 21. thanks again to server pronto for sponsoring this video now let's get into it alright so let's go ahead and get started now in front of me i have visual studio code this is the editor i'm going to use for this video you can use whatever you want but i will recommend vs code just because of the built-in terminal that's going to be helpful when we're actually testing our api i've also created a go file called main.go you can name it whatever you want but please put it in a folder so i have a folder on my desktop called go api tutorial now you can ignore the vs code it's just storing some settings related to my vs code environment anyways other than that i'm going to assume that you have go installed already and it's all set up on your machine because what we need to do now is install some dependencies for this project specifically the gin framework that i mentioned in the intro so we're going to be using jin high performance high productivity web framework pretty popular in the go community however it's typically for simple apis or simple web applications if you're doing something more advanced there's lots of other frameworks that you can look at but for something like this just a very simple api gin is great so that's why we're going to use it now to install this dependency the first thing we need to do is set up dependency tracking for our go project so to do that i'm going to go to my command line so my terminal or command prompt depending on your operating system i'm going to go inside of the folder where my go file is here i'm going to type the following go mod init and then example slash and then the name of my folder which in this case is go if i can type this correctly api to torque so you can see my folder is go api tutorial and i have go mod init example slash go api tutorial now this is going to create a go.mod file which is going to keep track of the different dependencies now the example here is what i would recommend you use as well usually this is supposed to be the path to where you could download this go package from i don't know exactly how this works but essentially since we're not actually going to be releasing this package for other people to install we just put example and then the name of our folder someone else in the comments can probably clarify exactly why we do this but for now just do example slash and then the name of your folder so i'm going to type enter here and then notice it's going to create a go.mod file you can see it right here all right so now that we've done that we're going to use the go get command to download the dependency that we need which is the gin framework so i'm going to type go get and then this is going to be github dot com slash gin hyphen jonic like that slash and then gym let me make sure this is correct looks good to me i'm going to type enter this is going to take a second once it's finished we should see that it actually installs this framework and then we'll be good to go and we can start writing the uh the go api all right so the gin framework is now installed so what i'm going to do is quickly describe the example we're going to go through here for actually building an api then we'll do all the import statements and everything that we need so for this api i want to build kind of a library api where we store a bunch of books and we're able to check in a book check out a book add books view all the different books get a book by its id all of that kind of stuff that'll give us a few different functions we can write and routes that we can have for our api so to get started i'm going to have my import statements here now i want to have net slash http this is built into go we also want to have the one that we installed so github dot com slash gin jonic jin and then we want to have errors which we'll use later on now we're getting red lines because we're not using these right now that's fine we'll use them later now since we're going to have a library we want to store books now to store our books we're going to use a struct so i'm going to create a type here i'm going to say type book struct and then i'm going to put a bunch of field names here now it's important that the field names start with a capital letter i'll explain this in a second but this will make it an exported field name and for our api we need that so i'm going to say id this is going to be a string i'm going to say title this will be a string as well did i spell title correctly of course i did okay title that's going to be a string we want an author for our book okay this will be a string as well and then lastly we want a quantity because a library probably has like you know two or three versions of the book okay now we'll go with int for that now before we go any further i'm going to add a few things to this struct which are going to allow it to be serialized and converted to json so our api can actually return the struct directly or it can take in kind of the json version of the struct and convert it to a struct in go i know this seems a little bit weird but essentially we're going to be using json for our api so javascript object notation that's kind of the standard thing we use in apis and we're going to be returning that we're also going to be receiving that as data if we wanted to say add a new book so here i need to make sure that this can be kind of represented in json and the way i do that is by adding another uh i don't even know entry here at the end which is going to be the json representation or the json field name for all of these fields in our struct so i'm going to put backticks so backtick json colon then i'm going to put in double quotation marks the lowercase version of this field okay so let's continue here this is going to be json and then title uh it's going to give it to me nice json and then author and then what else do we want json and quantity okay so let's explain this for a second why is this i need the other backtick okay there we go so the reason i have the uppercase names here is because this makes this an exported field and that essentially means that it's a public field or that it can be viewed by modules outside of this module that we're in right now or outside of this go file so that's why i had to make these names uppercase however in our json we want them to be lowercase so we add this field here that essentially says when we are serializing this with json convert this field name to lowercase or if we're taking a json object and turning it into the book struct then we're going to look for the id lowercase field and convert it to the id uppercase field hopefully that makes sense again you need to make sure all of these are capitals so that they're all exported if you want to see what happens if you don't do that then you can make them lowercase and you'll notice that every time you try to return books it's just going to be an empty json object because it wasn't actually able to read all of the different field names from this struct okay i'm hoping that makes sense i understand that might be a little bit confusing now i'm just going to copy in something here which is a list of books or a slice of books uh you can you know pause the video and copy this in if you want also i'll leave the code in the description but we just want to have a data structure that represents all of our different books because for this api we're not going to implement a database we're just going to do all of it in memory now if you had a real api you would use a database but that's kind of beyond the scope of this tutorial so i've just created a slice of the book struct we have a bunch of books here so we have you know in search of lost time the great gatsby war and peace and we have our quantities as well now we're going to allow people to check in and check out the books that will just increase the quantity or decrease the quantity of course i'll show you how to do that okay so now that we've ridden this what we're going to do is write our main function so we're going to say function main now inside of here we're going to set up our router which is going to be responsible for handling different routes and kind of the different endpoints of our api so what i'm going to do is say my router is cool and equal and then this is going to be gin dot default like that let me make sure that's correct okay that looks good now what we can do with the router variable is we can route a specific route to a function so for now i'm going to write a function i'm going to call this function get books and what this is going to do is simply handle the root of getting all of the different books right so it's going to return the json version of all of these books now the way we do that is we need to accept and hear something known as a context i'll explain this in a second but for now we're going to say g.context is the type that we want to accept specifically a pointer to it sorry this is going to be gin.context not g.context and then all we're going to do is c dot and then indented json and we're going to return here http dot status okay and then the json that we want to return which in this case is just going to be our slice of books okay i understand there's a lot of stuff that i haven't explained i just need to write kind of this boilerplate code and then i can go through all of it okay so now here i'm going to type type router.get and my root is going to be slash books and then i'm going to route this to my getbooks function okay then i'm going to say router.run and is this a capital yes this is a capital and i'm going to run this on localhost port 8080. okay there we go so let's take a step back let me explain what i just did because we've actually just implemented an api here so what i did is i created a router now the router is coming from gin and that's going to allow us to handle different routes now the route that i want to handle here is slash books which means when you go to local host colon 8080 slash books it's going to call this function and this function is going to take in a gin context the gin context is essentially all of the information about the request and it allows you to return a response so here i'd do c dot indented json this just means we're going to get nicely formatted json that has the proper indentation the status code of this response that we're sending here is status ok and then what we're sending as the data is our books so since i added these fields here right i added my json id my json title my json author my json quantity this book struct here is able to be serialized and we can also serialize a slice of this struct so what's going to happen is we're going to return a json object that has all of these books in it from this function right here now notice that i had a get request so that means if you're sending a get request to this route then it will handle or it will call this function however if you send a post request it's not going to handle that because well this says get now in terms of running our router or running our web server here we just do router.run and then we put the ip address that we want to run this on now in this case i'm just doing localhost i'm running this on port 8080 you can pick pretty much any port that you want okay hopefully that makes a bit of sense but that is the basics for creating kind of a very simple get request or very simple get endpoint on our api again the indented json is just giving us a nice format of json we also can return files we can return html we can return all kinds of stuff the status okay here is coming from this net http module this is just going to go to 200 we need to first return a status response saying okay what was the status of the request well it was okay so that's why we're using status okay and then what's the data well that's books which will be automatically serialized for us into json all right now i'm just going to comment out errors here because we're not using this quite yet we'll use that in a second so what i want to do now is test this api and see if it's working so the way that i can do that is simply run my go file so i'm just going to type go run and i can type dot or i can type main.go so i'm going to do main.go let's give it a second here and you can see that it's listening and serving http on localhost colon 8080. now to test this we need to use the curl command so i'm just going to open up another terminal by splitting this here let's move this all over i'm going to use the curl command you can use this on mac linux windows and we're just going to curl the endpoint that we created which is slash books so i'm going to say curl local host colon 8080 slash books let's go like that okay so when i do that you're going to see that we get our indented json right and we get all of our books being returned to us here and notice we have the lowercase field name not the uppercase field name again because we have our json stuff right here okay and then you can see the response came in here we have status code 200 we got or we're getting the slash books endpoint perfect now let's quit this so i'm just going to ctrl c to get out of that and we can now close this and we'll get back to that later okay so we have now just created a get endpoint what i want to do next is add an endpoint that allows us to actually add a book to this slice so to do that i'm going to say function add book or actually let's go with create book again we're going to take in our context so gin.context just to reiterate this stores all of the information related to a specific request so if you had query parameters if you had a data payload if you add headers all of that type of stuff is going to be in this variable here which is c so i'll show you how we actually get query parameters and how we can get the data associated with a specific book so we have create book and inside of here what i need to do is get the data of the book that we're going to be creating right from the request so to do this i'm going to create a variable i'm going to say var new book is of type book and then i'm going to use something from c here so from our context to actually bind the json that was a part of the data payload of this request to this book object or who this book struct so i'm going to say if error colon equals and then this is going to be c dot bind json like that and we're going to try to bind the json again that's a part of this request to the new book struct now we're passing the pointer to new books that we can actually directly modify the field values and then we're going to check if we got an error or not so if the error is not equal to null that means that we did actually get an error and if that's the case we'll simply return now when we return this will automatically pass a uh what he called a status message as a response so if we just return from a function without actually using the like indented json or something else that i'll show you in a second then what's going to happen is it will just automatically give kind of an error response now we'll test that out in a second to see how that works but for now i'm just going to return inside of here however though if i don't end up returning then we will have bound the json to this new book struct so now we have a struct that contains all of the data that was passed to this function or to this endpoint so what i can now do is append this to our books slice and then i can simply return a status message and a response so i'm going to say append and i'm going to append i forget what order i do this but i think i do book two books let's see if that's correct or if it's the other way around nope i did it wrong so it's going to be books 2 and then new book like that and then what i want to do is c dot and then again we're going to do indented json except this time for the status message we're going to say http dot status and this is going to be created like that okay status created and then for the data we'll just pass a new book now what is the error here um value of type book is not used ah my apologies here i totally forgot that i need to do books is equal to and then append books new book i come from many other programming languages so often i make the mistake income anyways there we go we have books is equal to append books new book what is the problem here function create book is not used okay we're going to use that in one second okay so just to quickly recap what we did here we created the variable new book which is of type book we then try to bind the json of the request data to the new book by passing its pointer if we got an error from doing that we simply returned which is going to automatically pass kind of an error response message back to whoever sent this then we're going to have books is equal to append books new book so if we didn't get an error and we were successfully able to bind the json to this book struct then we have a new book that we're creating so we're going to create that book by simply appending it to the books slice we then are going to return the book that we just created with the status message or status code status created great okay so now all we need to do is actually add a root for this so we're going to say router dot and then this is going to be post and we'll post to slash books and then create books we'll use the same endpoint but we'll just have a post request here that's going to create the book and a get request is going to give you the different books alright so now we can actually test this api so to do so i'm going to run the go code again so let's go go run and then this is going to be main.go i'm going to split the terminal and we're going to use the curl command however since we need to send json data to the create book endpoint what i'm going to do is create a file here that's going to contain kind of the data that we want to send as json it's just going to be easier to write it in a file than it would be to write it directly in here it's going to get really messy so we're going to create a new file uh let's just call this body dot json let's not save it as django text let's save it as all files okay and inside of here we'll define our json so we want an id the id is going to be a string this will be equal to 4. we want a title we can go with hamlet for the title here we want an author so let's type that in here this is going to be william shake sphere i think that's how you spell his name okay and then we'll go with a quantity and this will be equal to two now again make this whatever you want i'm just doing a real book i think that makes sense for this example okay so that is our body.json so now our api is running let me just close the file view and let's now send a curl request to it let's get rid of this untitled file too so i'm going to say curl local host colon 8080 slash books now we're going to do an include so we're going to say that we want to include a header this header is going to be content hyphen type application slash json because that's the type of data that we're sending and we're going to do hyphen d for data and then we're going to do the at sign and it's going to be body dot json now i think that's actually all we need to do we might need to make it so that the type is a post request so let's just do that as well in case this isn't going to work so i'm going to say hi for knife and request and then in double quotes we're going to do all capitals post okay so let's hit enter here and see if this works and notice that it does so we get a 201 we have post and then slash books so 201 status created and we get our book back id4 title hamlet author william shakespeare quantity two awesome okay so i think that is it for testing that just to quickly go through this curl command because i went through this fast we are curling to localhost 8080 books we are going to include the header i actually don't even think you need to have the include to be honest the header is content type application json defining the type of data that we're sending hyphen d stands for data the ad symbol means a file so we're going to say at body.json because that's the file that we want to use for the data and then we specify the request type as a post request and there we go we send the request using great we have now created that so now let's send a curl request and look at all the books so http actually we don't need http we just do local host colon 8080 slash books and when we do that we now have id4 hamlet has been added as a book great okay so let's continue here and let's now look at how we could do something like checking out a book checking in a book uh getting a book by id let's actually do getting a book by id first all right so to get the book by id i'm going to write a helper function that will return to us the book object represented by a specific id then we'll write a separate function that handles the root so i'm going to say function get book by id we want an id of type string and then we're actually going to return a pointer to a book and we're going to return an error now the error could potentially be nil or null or whatever you want to call it and the reason why we're doing this is because if the book that you requested or the id that you requested doesn't exist then we need to return an error right so let's re-import errors because we're going to use that in here okay so let's do a loop and look for the book so we're going to say 4 i comma book and then colon equals and actually i can't even do book after b colon equals and then range books like this will loop over all of the books we want to check if the book id is equal to this id so we're going to say if b dot id is equal to id then we want to return and we're actually going to return books at i but we're going to return a pointer to it so we're going to turn ampersand books at i and nil like that because we don't have an error if we actually find the successful book then the reason i'm returning the pointer to the book is that we can modify the attributes of this book or the fields of this struct from a different function okay hopefully that makes sense that looks good to me and then here we will simply return nil and then this is going to be errors dot new and then book not found great so i think that's all we need for get book by id just telling us that's unused that's fine so now let's write a function that will get the book by id so we'll just say book by id okay and then here we're going to take c and this is going to be gin.context and then what we want to do is say that our book is colon equal to and this is going to be get book by id and we're going to pass for the id the id which we now need to get so i'm going to say id is equal to c dot param now param means that this is going to be a path parameter i will show you that in one second but essentially it would be something like slash books slash 2. now that would be the id 2 would be the id right i'll show you how we set that up in the group okay so that's the id so we're going to say book is equal to get book by id going to pass the id however we also could potentially have an error so we're going to say book comma error is equal to this and then we're going to check if we have an error if we do have an error then we need to well return an error to the user so we're going to say if error does not equal nil like that then simply return this will just give us a bad request automatically as we saw before otherwise we'll just return the book so we'll say c dot indented json http dot status okay and then this will be book okay now i think that is going to be good uh i don't think i need to de-reference the book i might need to we'll see if this is going to work though okay so we have book by id now let's set up the root for this so let's go to main and we'll do another get we're going to say router dot get and we're going to say slash books slash and then colon id now this is how you set up a path parameter so as you saw here we had c dot param now this is going to access whatever is associated with the id parameter in the path so if i want this to be a parameter i just do colon id it's going to default to a string type and then it will give me that when i'm actually handling the root hopefully that makes sense i think that's straightforward enough though let's now make this go to book by id okay now we can test this out so let's re-run our api okay go run main.go let's clear this let's send a curl request to slash books slash and let's just go with id2 notice we get id2 now of course id4 is not going to work so we're going to get uh wait gave us 200 that should have given us a bad request okay i'll look at that in a second but book four i just wanted to show you wasn't going to give us something because we were storing them in memory so even even though we added a book in the previous test run of the api it wasn't going to be there that points out an error so let's see how we can fix that so i was just looking into this error here and i realized what the problem was so what we were having was we were getting a status code of 200 when we actually wanted to get the status code of 404 not found so it wasn't returning us any data but it wasn't giving us the correct status code and well i'm going to explain the reason so first let's look at create book so we can create a book i kind of falsely mentioned before that since we were returning it was automatically giving us a bad request status code and giving a response now the return statement is not what's doing that it's the c dot bind json that's doing that so since this was getting an error it was automatically returning a response saying that the request was bad and then we were just returning from the function so we didn't end up doing any of this now what i did was i kind of thought that we could just return here and that would automatically give us a bad request that was incorrect because again the c dot bind json is doing that learning experience for both of us so what we need to do in here is we need to actually return a custom response saying bad request we're saying 404 not found and then whatever data we want to return with that and then return so we're going to say c dot indented json and we're going to do http dot and then status actually i don't want to go with bad request i want to go with not found that seems to make more sense here and then what we want to return is the following we're going to do gen dot h and we're going to say message and for the message we can just say book not found okay exclamation point like that or we just go with the period now the gin.h is kind of a shortcut to allow us to just write our own custom json like that it actually maps to a type that has string to an interface i'm not going to explain exactly how that works but just for now you can type gin.h and that allows you just to write here the json that you want to return okay so now we can test this out and see if it's going to work so let's run our api let's then send a request here with an id that doesn't exist and notice now that we're getting 404 and it says message book not found very good we have now fixed that okay so let's just shut off the api and now what i want to do is write two more routes one to allow us to check in a book and to check out a book or i guess return a book and shut up check out a book now what these methods are going to do is they're not going to validate that the correct person is checking them in or checking them out or whatever it's just going to subtract one from the quantity of the book and then add one to the quantity and it's not going to let you check out a book if there's no books available right so if the quantity is zero hopefully that makes sense but that's kind of what i'm going to go with here so let's write a function here and let's call this check out is check out one word yeah i think we can do that check out book let's take in our context so gin.context and then what i want to check in here is what book we want to check out we're going to do that by the id of the book except this time i'm going to accept that as a query parameter rather than a path parameter just to show you how we handle those now the query parameters are what comes after the question marks you have question mark like x equals two that's a query parameter in your path right so let's see how we get that so i'm going to say id colon equals and then it's going to be c dot get and then query like that and we're going to look for id now what this also returns is an error so it has id error is equal to c dot get query so if this id does not exist as a query parameter then we get an error so the first thing we can check is if error does not equal nil so if it doesn't equal nil then we need to return a indented json so we're going to say http status and then this is going to be bad request because you didn't pass the correct correct query parameter and then we're going to say gin.h and for the message this time we will say invalid our missing id query parameter okay there we go that's good and then we can recheck so what's the error here it's saying cannot convert nil to bool okay so error sorry this actually okay my apologies so we're going to say if ok is equal to false meaning that this key does not actually exist as a query parameter then we'll do this it's not giving us an error instead it's giving us a boolean telling us if the key exists okay so we're going to check that now if we do actually have an id then we're going to try to get the book so we're going to say book colon equals get book by id but we're gonna do book comma error like that and we'll get the id and then similarly to before we're gonna say if error does not equal nil then we can just return what we already have here which is book not found so let's go book like that and then lastly we can actually return the book and we can subtract the quantity from the book saying that okay like we've reduced the quantity because you've checked out one book that reminds me though we need to check to make sure that there is at least one book for them to check out so let's check that we're going to say if book dot quantity is equal to zero let's just see less than equal to zero then we want to return a message very similar here so we're going to say c dot index json status i guess we can just go bad request uh we can say book not available okay and then return and then lastly we can say book dot quantity minus equals one to reduce the quantity if they were able to check one out and then we'll return what book it was that they had so we'll say status okay and we'll say gin dot h and then this will be a message or not a message sorry what am i doing we're just going to return the book okay so i think that is good let's quickly recap what we did here so we tried to get from the query parameter the id uh we checked if we had an id or not what is it saying here should omit comparison can okay so let's just do what they say here let's do not okay rather than okay equals false so we're going to check if we actually had id as a query parameter if we did not we're going to return the message missing id query parameter and then if this is not the case we are going to try to get the book by the id if the book does not exist we're going to say that and then we're going to check the quantity so if the quantity of the book is less than zero you can't check it out so we return an error message now if all of those things are false so we don't get into any of these conditions then we're going to subtract the quantity by one because we're going to check out this book and we're going to return that this was okay and we're going to give them the book now we also could give a message maybe and say something like book checked out but for now i'll just give them the book that's fine okay so let's add a root for this so this time since we're going to be updating something that currently exists i can use a patch request and we're just going to do slash check out and then we will put this to checkout book okay so let's test this before we move on to checking in a book or returning a book so let's go go run main.go okay and then we want to send a request here now this is going to be a little bit more complicated than before localhost colon8080 check out question mark and then we want id equal to let's check out book two and we're going to do hyphen knife and request and this is going to be patch i think that's all we need let's run this and there we go okay we were able to check out a book now when we get the book is the quantity less than it was before let's see so the quantity that we had was 5 and when it returns to us the quantity it's giving us 4 which is telling us okay we did indeed update the quantity of this book sweet so that seems to be working now that we have checkout function let's actually just try this a few more times so i'm going to check out quantities 3 check out quantities 2 1 0 and now book not available perfect so that is working let's try with an id that doesn't exist so id 4 says book not found let's try without the query parameter id and missing id query parameter perfect okay so that is all working let's close this and now let's write the return book so let's go function return book okay this is going to take in our context so gen dot context let's look for the query parameter for the id that they're going to be returning or yeah i guess we'll just do it as a query parameter we'll let them return by just saying the id of the book they want to return so we'll do what we did before i'm just going to copy actually all of this okay so let's go ctrl c and ctrl v because if they try to return a book that doesn't exist well we can say book not found and after we do all of that what we want to do is update the quality by adding one and then return i guess book return successfully or just the book so we'll say book dot quantity and this will be plus equals one okay and then we'll say c dot indented json status okay and then return the book now i am just noticing here that we are doing a lot of repetitive work in both of these functions now i think for now this is fine i'm not really going to clean it up but you could probably separate this out into another function and then uh kind of use that you know from here as well as from here because we are doing the exact same thing twice at least for these i don't know 10-ish lines of code anyways i'm going to leave it like this for now i think that's fine let's implement the root now for this so let's say router dot patch and let's go slash and then for this one we will go return and then this will be return book now while i'm here i realize that i forgot to mention get post and patch requests so the get request is getting information the post request is adding information or creating something new and the patch request is updating something so we are updating the quantity of the book that's why i'm using patch you might be able to argue for using a different type of request here but i think this is fine for now okay so let's test the api and see if we can return books as well now so let's go go run main.go let's now send a curl and let's check out a book we can check out let's say book with id2 so id is equal to two okay now let's try to return it so rather than check out let's just go return and looks like the quantity gets updated and we added one now to test some of the errors here let's go id 8 okay book not found let's try to do it without the query parameter okay we get the error message and now let's try to reduce the quantity so much that we can't do it so id2 or actually sorry i guess we can't even do that because we're just returning a book so it should just keep going up okay awesome so with that said i think that's going to wrap up this video again i just want to give you an introduction to this framework and show you how to make a simple api there's of course a lot more stuff that you can do with this i would encourage you to read through the documentation which i will link in the description but i think this was a good start we have get post patch we know how to send json data how to receive json data we know how to serialize a struct which is what we did right here uh we also know how to get the context how to return different status codes we understand how to handle the errors uh yeah we did quite a few things here and hopefully this was a good introduction to the gin framework and creating a go api with that said i will end the video here i hope you guys enjoyed if you did make sure to leave a like subscribe to the channel i will see you in another one [Music]
Info
Channel: Tech With Tim
Views: 171,539
Rating: undefined out of 5
Keywords: tech with tim, golang, go api tutorial, make an api with go, how to make an api with go, tech with tim go api, tech with tim go programming, programming with go, coding with go, what is an api, application programming interface, GET requests, POST requests, PATCH requests, API, gin framework, what is gin framework, how to setup gin router, gin router, programming expert, go for beginners, go tutorial, golang tutorial, go programming language
Id: bj77B59nkTQ
Channel Id: undefined
Length: 38min 3sec (2283 seconds)
Published: Fri Jan 28 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.