Documentation ¶
Index ¶
- Variables
- func CopyZipkinHeaders(next http.Handler) http.Handler
- func IsAlreadyExistsError(err error) bool
- func IsInvalidArgumentError(err error) bool
- func IsNotFoundError(err error) bool
- func NewAlreadyExistsError(kind, name string) error
- func NewDefaultLogger() (*zap.Logger, error)
- func NewInvalidArgumentError(kind, name string) error
- func NewNotFoundError(kind, name string) error
- func UnaryClientInterceptor() func(ctx context.Context, method string, req, reply interface{}, ...) error
- func UnaryServerInterceptor() grpc.UnaryServerInterceptor
- func UnaryServerSleeperInterceptor(t time.Duration) grpc.UnaryServerInterceptor
- type Server
Constants ¶
This section is empty.
Variables ¶
var SampleOrders = []order.Order{ order.Order{ Id: "22f4ee36-2c3e-450f-bb65-36e52656b183", User: "0a30cbc7-91f1-4637-832f-9ddb9978e1c5", Items: []string{ "6ab9e0c2-e7be-4120-a3e9-62c39b7dbfd7", "4415fede-7462-4f12-b87f-ede596ec6ee2", }, }, order.Order{ Id: "034735ae-b5c8-47dd-9b59-30eacc62473a", User: "0a30cbc7-91f1-4637-832f-9ddb9978e1c5", Items: []string{ "6962f4ff-b752-4103-b90c-1f9bcec30913", "dff79aa1-6b13-4aeb-8dca-22a45322a293", }, }, order.Order{ Id: "4b2f25c3-f0fb-4640-9fc8-a3066a8022f6", User: "d6dd61c4-75a6-4424-91b2-ab740501c94f", Items: []string{ "5d210689-cca7-4e81-8437-05b20f658ad0", }, }, }
SampleOrders is sample order data for testing.
var SampleUsers = []user.User{ user.User{ Id: "0a30cbc7-91f1-4637-832f-9ddb9978e1c5", Name: "User One", Address: "1234 5th Street", }, user.User{ Id: "d6dd61c4-75a6-4424-91b2-ab740501c94f", Name: "User Two", Address: "6th Ave", }, user.User{ Id: "32cc174b-3586-4263-9c67-fce988d246ca", Name: "User Three", Address: "Down by the river", }, }
SampleUsers is sample user data for testing.
Functions ¶
func CopyZipkinHeaders ¶
CopyZipkinHeaders copies request headers to the request context.
func IsAlreadyExistsError ¶
IsAlreadyExistsError determines if the error is a AlreadyExists grpc error
func IsInvalidArgumentError ¶
IsInvalidArgumentError determines if the error is a InvalidArgument grpc error
func IsNotFoundError ¶
IsNotFoundError determines if the error is a NotFound grpc error
func NewAlreadyExistsError ¶
NewAlreadyExistsError creates a new AlreadyExists grpc error
func NewDefaultLogger ¶
NewDefaultLogger creates a new logger with our prefered options
func NewInvalidArgumentError ¶
NewInvalidArgumentError creates a new InvalidArgument grpc error
func NewNotFoundError ¶
NewNotFoundError creates a new NotFound grpc error
func UnaryClientInterceptor ¶
func UnaryClientInterceptor() func(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error
UnaryClientInterceptor returns a new unary client interceptor for copying metadata
func UnaryServerInterceptor ¶
func UnaryServerInterceptor() grpc.UnaryServerInterceptor
UnaryServerInterceptor returns a new unary server interceptor for copying metadata
func UnaryServerSleeperInterceptor ¶
func UnaryServerSleeperInterceptor(t time.Duration) grpc.UnaryServerInterceptor
UnaryServerSleeperInterceptor returns a new unary server interceptor that sleeps for a random amount of time