Documentation ¶
Index ¶
- Constants
- func NewResolver(endpoints []string, service string) resolver.Builder
- func PrivateIPv4() (net.IP, error)
- type Resolver
- type Service
- type ServiceInfo
- type StudentSrv
- func (srv *StudentSrv) AllStudent(e *empty.Empty, rev api.StudentSrv_AllStudentServer) error
- func (srv *StudentSrv) NewStudent(ctx context.Context, s *model.Student) (*protos.Result, error)
- func (srv *StudentSrv) QueryStudents(student *api.QueryStudent, server api.StudentSrv_QueryStudentsServer) error
- func (srv *StudentSrv) StudentByID(context.Context, *api.QueryStudent) (*api.QueryStudentResponse, error)
- func (srv *StudentSrv) StudentInfo(stream api.StudentSrv_StudentInfoServer) error
Constants ¶
View Source
const (
ServName = "grpc_demo_srv"
)
Variables ¶
This section is empty.
Functions ¶
func NewResolver ¶
NewResolver return resolver builder service is service name
func PrivateIPv4 ¶
Types ¶
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
resolver is the implementaion of grpc.resolve.Builder Resolver 实现grpc的grpc.resolve.Builder接口的Build与Scheme方法
func (*Resolver) Build ¶
func (r *Resolver) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOptions) (resolver.Resolver, error)
Build to resolver.Resolver 实现grpc.resolve.Builder接口的方法
func (*Resolver) ResolveNow ¶
func (r *Resolver) ResolveNow(rn resolver.ResolveNowOptions)
ResolveNow
type Service ¶
type Service struct { ServiceInfo ServiceInfo // contains filtered or unexported fields }
func NewService ¶
func NewService(info ServiceInfo, etcdEndpoints []string) (service *Service, err error)
NewService 创建一个注册服务
type StudentSrv ¶
func (*StudentSrv) AllStudent ¶
func (srv *StudentSrv) AllStudent(e *empty.Empty, rev api.StudentSrv_AllStudentServer) error
func (*StudentSrv) NewStudent ¶
func (*StudentSrv) QueryStudents ¶
func (srv *StudentSrv) QueryStudents(student *api.QueryStudent, server api.StudentSrv_QueryStudentsServer) error
func (*StudentSrv) StudentByID ¶
func (srv *StudentSrv) StudentByID(context.Context, *api.QueryStudent) (*api.QueryStudentResponse, error)
func (*StudentSrv) StudentInfo ¶
func (srv *StudentSrv) StudentInfo(stream api.StudentSrv_StudentInfoServer) error
Click to show internal directories.
Click to hide internal directories.