Documentation ¶
Overview ¶
Package server contains our gRPC server implementation for the pet store.
Index ¶
- type API
- func (a *API) AddPets(ctx context.Context, req *pb.AddPetsReq) (resp *pb.AddPetsResp, err error)
- func (a *API) ChangeSampler(ctx context.Context, req *pb.ChangeSamplerReq) (resp *pb.ChangeSamplerResp, err error)
- func (a *API) DeletePets(ctx context.Context, req *pb.DeletePetsReq) (resp *pb.DeletePetsResp, err error)
- func (a *API) SearchPets(req *pb.SearchPetsReq, stream pb.PetStore_SearchPetsServer) (err error)
- func (a *API) Start() error
- func (a *API) Stop()
- func (a *API) UpdatePets(ctx context.Context, req *pb.UpdatePetsReq) (resp *pb.UpdatePetsResp, err error)
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct { pb.UnimplementedPetStoreServer // contains filtered or unexported fields }
API implements our gRPC server's API.
func (*API) AddPets ¶
func (a *API) AddPets(ctx context.Context, req *pb.AddPetsReq) (resp *pb.AddPetsResp, err error)
AddPets adds pets to the pet store.
func (*API) ChangeSampler ¶
func (a *API) ChangeSampler(ctx context.Context, req *pb.ChangeSamplerReq) (resp *pb.ChangeSamplerResp, err error)
ChangeSampler changes the OTEL sampling type.
func (*API) DeletePets ¶
func (a *API) DeletePets(ctx context.Context, req *pb.DeletePetsReq) (resp *pb.DeletePetsResp, err error)
DeletePets deletes pets from the pet store.
func (*API) SearchPets ¶
func (a *API) SearchPets(req *pb.SearchPetsReq, stream pb.PetStore_SearchPetsServer) (err error)
SearchPets finds pets in the pet store.
func (*API) UpdatePets ¶
func (a *API) UpdatePets(ctx context.Context, req *pb.UpdatePetsReq) (resp *pb.UpdatePetsResp, err error)
UpdatePets updates pets in the pet store.
type Option ¶
type Option func(a *API)
Option is an optional arguments to New().
func WithGRPCOpts ¶
func WithGRPCOpts(opts ...grpc.ServerOption) Option
WithGRPCOpts creates the gRPC server with the options passed.
Directories ¶
Path | Synopsis |
---|---|
Package errors is a replacement for the golang standard library "errors".
|
Package errors is a replacement for the golang standard library "errors". |
Package log is a replacement for the standard library log package that logs to OTEL spans contained in Context objects.
|
Package log is a replacement for the standard library log package that logs to OTEL spans contained in Context objects. |
mem
Package mem contains an in-memory storage implementation of storage.Data.
|
Package mem contains an in-memory storage implementation of storage.Data. |
telemetry
|
|
metrics
Package metrics provides setup of metrics that can be used internally to measure various application states.
|
Package metrics provides setup of metrics that can be used internally to measure various application states. |
tracing
Package tracing provides functions for starting and stopping our Open Telemetry tracing.
|
Package tracing provides functions for starting and stopping our Open Telemetry tracing. |
tracing/sampler
Package sampler offers a Sampler that looks for a TraceID.Valid() == true or a gRPC metadata key called "trace" and if they exist will sample.
|
Package sampler offers a Sampler that looks for a TraceID.Valid() == true or a gRPC metadata key called "trace" and if they exist will sample. |
Click to show internal directories.
Click to hide internal directories.