Documentation ¶
Index ¶
- func NewDB() *memdb.MemDB
- type HealthImpl
- type UserImpl
- func (svc *UserImpl) Create(ctx context.Context, req *pb.CreateReq) (*pb.CreateResp, error)
- func (svc *UserImpl) GetByEmail(ctx context.Context, req *pb.GetByEmailReq) (*pb.GetByEmailResp, error)
- func (svc *UserImpl) List(ctx context.Context, req *pb.ListReq) (*pb.SearchResp, error)
- func (svc *UserImpl) LoadSampleUsers() error
- func (svc *UserImpl) SearchAge(ctx context.Context, req *pb.SearchAgeReq) (*pb.SearchResp, error)
- func (svc *UserImpl) SearchName(ctx context.Context, req *pb.SearchNameReq) (*pb.SearchResp, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type HealthImpl ¶
type HealthImpl struct{}
HealthImpl implements the HealthServer interface (see health.pb.go file).
func (*HealthImpl) Check ¶
func (h *HealthImpl) Check(ctx context.Context, args *v1.HealthCheckRequest) (*v1.HealthCheckResponse, error)
Check returns SERVING.
func (*HealthImpl) Watch ¶
func (h *HealthImpl) Watch(*v1.HealthCheckRequest, v1.Health_WatchServer) error
Watch is not implemented for now.
type UserImpl ¶
UserImpl implements my users-grpc service. If I also wanted to be able to trace my service (e.g. using jaeger), I would also make sure to store opentracing.Tracer there.
func (*UserImpl) GetByEmail ¶
func (svc *UserImpl) GetByEmail(ctx context.Context, req *pb.GetByEmailReq) (*pb.GetByEmailResp, error)
GetByEmail returns a user by its email.
func (*UserImpl) LoadSampleUsers ¶
LoadSampleUsers loads some hard-coded users into database.
func (*UserImpl) SearchAge ¶
func (svc *UserImpl) SearchAge(ctx context.Context, req *pb.SearchAgeReq) (*pb.SearchResp, error)
SearchAge searches all users in the range [from, to_included].
func (*UserImpl) SearchName ¶
func (svc *UserImpl) SearchName(ctx context.Context, req *pb.SearchNameReq) (*pb.SearchResp, error)
SearchName searches a user by a part of its first or last name.
Click to show internal directories.
Click to hide internal directories.