Documentation ¶
Index ¶
- func AuthorizeUser(c context.Context, accessibleRoles []string) (*auth.Payload, error)
- func ConvertUser(user database.User) *pb.User
- func FieldViolation(field string, err error) *errdetails.BadRequest_FieldViolation
- func GrpcLogger(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (resp interface{}, err error)
- func HttpLogger(handler http.Handler) http.Handler
- func InvalidArgumentError(violations []*errdetails.BadRequest_FieldViolation) error
- func ValidateCreateUserRequest(req *pb.CreateUserRequest) (violations []*errdetails.BadRequest_FieldViolation)
- func ValidateLoginUserRequest(req *pb.LoginUserRequest) (violations []*errdetails.BadRequest_FieldViolation)
- func ValidateUpdateUserRequest(req *pb.UpdateUserRequest) (violations []*errdetails.BadRequest_FieldViolation)
- type Metadata
- type ResponseRecorder
- type SimpleBankServer
- func (server *SimpleBankServer) CreateUser(c context.Context, req *pb.CreateUserRequest) (*pb.CreateUserResponse, error)
- func (server *SimpleBankServer) LoginUser(c context.Context, req *pb.LoginUserRequest) (*pb.LoginUserResponse, error)
- func (server *SimpleBankServer) UpdateUser(c context.Context, req *pb.UpdateUserRequest) (*pb.UpdateUserResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthorizeUser ¶
func FieldViolation ¶
func FieldViolation(field string, err error) *errdetails.BadRequest_FieldViolation
func GrpcLogger ¶
func GrpcLogger( ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler, ) (resp interface{}, err error)
func InvalidArgumentError ¶
func InvalidArgumentError(violations []*errdetails.BadRequest_FieldViolation) error
func ValidateCreateUserRequest ¶
func ValidateCreateUserRequest(req *pb.CreateUserRequest) (violations []*errdetails.BadRequest_FieldViolation)
func ValidateLoginUserRequest ¶
func ValidateLoginUserRequest(req *pb.LoginUserRequest) (violations []*errdetails.BadRequest_FieldViolation)
func ValidateUpdateUserRequest ¶
func ValidateUpdateUserRequest(req *pb.UpdateUserRequest) (violations []*errdetails.BadRequest_FieldViolation)
Types ¶
type ResponseRecorder ¶
type ResponseRecorder struct { http.ResponseWriter StatusCode int Body []byte }
func (*ResponseRecorder) WriteHeader ¶
func (rec *ResponseRecorder) WriteHeader(statusCode int)
type SimpleBankServer ¶
type SimpleBankServer struct { pb.UnimplementedSimpleBankServer // contains filtered or unexported fields }
func NewSimpleBankServer ¶
func NewSimpleBankServer(store database.Store) *SimpleBankServer
func (*SimpleBankServer) CreateUser ¶
func (server *SimpleBankServer) CreateUser(c context.Context, req *pb.CreateUserRequest) (*pb.CreateUserResponse, error)
func (*SimpleBankServer) LoginUser ¶
func (server *SimpleBankServer) LoginUser(c context.Context, req *pb.LoginUserRequest) (*pb.LoginUserResponse, error)
func (*SimpleBankServer) UpdateUser ¶
func (server *SimpleBankServer) UpdateUser(c context.Context, req *pb.UpdateUserRequest) (*pb.UpdateUserResponse, error)
Click to show internal directories.
Click to hide internal directories.