# Functions
AppendIdentityToOutgoingStreamContext appends identity to outgoing context
https://godoc.org/google.golang.org/grpc#WithStreamInterceptor
conn, err := grpc.Dial("localhost:5000", grpc.WithStreamInterceptor(AppendIdentityToOutgoingStreamContext())).
AppendIdentityToOutgoingUnaryContext appends identity to outgoing context
https://godoc.org/google.golang.org/grpc#WithUnaryInterceptor
conn, err := grpc.Dial("localhost:5000", grpc.WithUnaryInterceptor(AppendIdentityToOutgoingUnaryContext())).
GrantAccessForStreamRequest returns error if Identity not set within context or user does not have required permission
https://godoc.org/google.golang.org/grpc#StreamInterceptor
opts := []grpc.ServerOption{ grpc.StreamInterceptor(GrantAccessForStreamRequest(identity.PermissionUserRead)), } s := grpc.NewServer(opts...) pb.RegisterGreeterServer(s, &server{}).
CheckAccessForUnaryRequest returns error if Identity not set within context or user does not have required permission
https://godoc.org/google.golang.org/grpc#UnaryInterceptor
opts := []grpc.ServerOption{ grpc.UnaryInterceptor(CheckAccessForUnaryRequest(identity.PermissionUserRead)), } s := grpc.NewServer(opts...) pb.RegisterGreeterServer(s, &server{}).
SetIdentityFromStreamRequest updates context with identity
https://godoc.org/google.golang.org/grpc#StreamInterceptor
opts := []grpc.ServerOption{ grpc.UnaryInterceptor(SetIdentityFromStreamRequest()), } s := grpc.NewServer(opts...) pb.RegisterGreeterServer(s, &server{}).
SetIdentityFromUnaryRequest updates context with identity
https://godoc.org/google.golang.org/grpc#UnaryInterceptor
opts := []grpc.ServerOption{ grpc.UnaryInterceptor(SetIdentityFromUnaryRequest()), } s := grpc.NewServer(opts...) pb.RegisterGreeterServer(s, &server{}).