Hello and welcome to the Go programming language course in the previous session, we could implement
get a student by the metal and in decision we want to implement, get the students by name function
first, uncomment these unimplemented method
and clear.
This venue and bright orange
set a variable like server by the type G.R. PC controller as implements the function server asterisk
G.R. PC controller, get a students by name and set a variable like name to point the search by name
message from political package name and set the asterisk.
And sit search by name message from political package protocol, search by name message.
And insert a variable like groups of students as a student service on their school, give the students
by name server from political package.
So we write G R P C is students from.
Portal call dot, the student service underscore give the students by name server.
And said return tide, that isn't there at all.
OK.
The method was created.
Now we have to implement its body by calling the server object from the GOP controller is right.
It has access to the DB connection field through which we can con the get the students by name method
to their exit and name variable as input parameter and return to values.
First, honest students whose name are equal to the input parameter and second values a URL.
So we define two variables like the students and arrow.
Collins equals set server object.
Dance and call Debbie Connection, object and dance, invoke, get a students base name
and can't get main function from the search by name message by calling name variable name.
Don't get name fonts.
First check area status if
they're not equals mean greeter.
All.
To iterate the values inside is to dance the youth, the range loop, so that we can display the values
inside each record separately.
So we for on the score comma a variable name like a student call and equals range in the student's.
Because the return value of the jet as students by name method is the least students of the modern package
while we need a students of our port to find.
So we need to convert each model student to party student.
So use a controller to your PC, a student function.
So first, define a variable like geography.
See a student.
Colin Equals and now Colin commented, Your a student function convert to democracy, student function
and pass each model a student as parameter for it and get the politics student is two students.
Now we sent each port a student to the G.R. PC Students Stream by calling send function from G.R. PC
Port of Fi that accept students from Port of Phi and return an error so define an error variable error
calling equals from your PC.
Student is calling send function G.R. PCs to this.
Calling send function and sit G.R. a student as prompter for it, G.R., see the students.
Okay.
And check Iran's status if
they're not equals mean return terror
and return, Neal, as return value of the function.
Peter Neal reformat the code and save the prices, OK in this session, neither able to complete the
package related to G.R. PC controller by entering the student on the school G.R. PC to that go fine
and receiving the all implemented metals related to the server section and implementing them in our
your service.
Now the client can use these functions and call them in order not to prolong the time of decision.
We will finish it and we will continue the content in the next session.
Goodbye.