1 00:00:12,000 --> 00:00:18,030 Hello and welcome to the Go programming language course in the previous session, we could implement 2 00:00:18,060 --> 00:00:25,440 get a student by the metal and in decision we want to implement, get the students by name function 3 00:00:27,030 --> 00:00:30,540 first, uncomment these unimplemented method 4 00:00:33,180 --> 00:00:34,950 and clear. 5 00:00:37,190 --> 00:00:41,900 This venue and bright orange 6 00:00:46,340 --> 00:00:56,000 set a variable like server by the type G.R. PC controller as implements the function server asterisk 7 00:00:56,990 --> 00:01:09,200 G.R. PC controller, get a students by name and set a variable like name to point the search by name 8 00:01:09,200 --> 00:01:14,690 message from political package name and set the asterisk. 9 00:01:17,360 --> 00:01:25,790 And sit search by name message from political package protocol, search by name message. 10 00:01:27,790 --> 00:01:34,930 And insert a variable like groups of students as a student service on their school, give the students 11 00:01:34,930 --> 00:01:37,330 by name server from political package. 12 00:01:37,630 --> 00:01:44,710 So we write G R P C is students from. 13 00:01:47,250 --> 00:01:57,440 Portal call dot, the student service underscore give the students by name server. 14 00:01:59,240 --> 00:02:04,310 And said return tide, that isn't there at all. 15 00:02:07,530 --> 00:02:07,930 OK. 16 00:02:07,950 --> 00:02:09,480 The method was created. 17 00:02:09,510 --> 00:02:17,720 Now we have to implement its body by calling the server object from the GOP controller is right. 18 00:02:18,000 --> 00:02:24,900 It has access to the DB connection field through which we can con the get the students by name method 19 00:02:25,170 --> 00:02:29,720 to their exit and name variable as input parameter and return to values. 20 00:02:29,730 --> 00:02:36,810 First, honest students whose name are equal to the input parameter and second values a URL. 21 00:02:37,230 --> 00:02:45,030 So we define two variables like the students and arrow. 22 00:02:45,540 --> 00:02:48,350 Collins equals set server object. 23 00:02:50,270 --> 00:03:01,100 Dance and call Debbie Connection, object and dance, invoke, get a students base name 24 00:03:06,080 --> 00:03:14,600 and can't get main function from the search by name message by calling name variable name. 25 00:03:14,880 --> 00:03:17,750 Don't get name fonts. 26 00:03:18,080 --> 00:03:21,260 First check area status if 27 00:03:24,920 --> 00:03:30,770 they're not equals mean greeter. 28 00:03:33,130 --> 00:03:33,370 All. 29 00:03:37,640 --> 00:03:44,620 To iterate the values inside is to dance the youth, the range loop, so that we can display the values 30 00:03:44,620 --> 00:03:46,870 inside each record separately. 31 00:03:47,020 --> 00:04:00,070 So we for on the score comma a variable name like a student call and equals range in the student's. 32 00:04:04,160 --> 00:04:10,910 Because the return value of the jet as students by name method is the least students of the modern package 33 00:04:11,210 --> 00:04:14,120 while we need a students of our port to find. 34 00:04:14,300 --> 00:04:18,230 So we need to convert each model student to party student. 35 00:04:18,440 --> 00:04:21,860 So use a controller to your PC, a student function. 36 00:04:22,160 --> 00:04:24,280 So first, define a variable like geography. 37 00:04:24,290 --> 00:04:25,220 See a student. 38 00:04:29,120 --> 00:04:37,670 Colin Equals and now Colin commented, Your a student function convert to democracy, student function 39 00:04:37,790 --> 00:04:46,400 and pass each model a student as parameter for it and get the politics student is two students. 40 00:04:48,610 --> 00:04:56,590 Now we sent each port a student to the G.R. PC Students Stream by calling send function from G.R. PC 41 00:04:56,600 --> 00:05:06,120 Port of Fi that accept students from Port of Phi and return an error so define an error variable error 42 00:05:06,580 --> 00:05:08,790 calling equals from your PC. 43 00:05:08,850 --> 00:05:13,870 Student is calling send function G.R. PCs to this. 44 00:05:16,270 --> 00:05:26,920 Calling send function and sit G.R. a student as prompter for it, G.R., see the students. 45 00:05:30,640 --> 00:05:30,930 Okay. 46 00:05:32,500 --> 00:05:36,220 And check Iran's status if 47 00:05:39,340 --> 00:05:45,130 they're not equals mean return terror 48 00:05:47,770 --> 00:05:51,160 and return, Neal, as return value of the function. 49 00:05:52,620 --> 00:06:04,100 Peter Neal reformat the code and save the prices, OK in this session, neither able to complete the 50 00:06:04,100 --> 00:06:12,590 package related to G.R. PC controller by entering the student on the school G.R. PC to that go fine 51 00:06:12,860 --> 00:06:20,330 and receiving the all implemented metals related to the server section and implementing them in our 52 00:06:20,480 --> 00:06:21,620 your service. 53 00:06:22,190 --> 00:06:29,060 Now the client can use these functions and call them in order not to prolong the time of decision. 54 00:06:29,210 --> 00:06:33,020 We will finish it and we will continue the content in the next session. 55 00:06:33,290 --> 00:06:33,890 Goodbye.