gapi

package
v0.0.0-...-f34ca43 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 23, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthorizeUser

func AuthorizeUser(c context.Context, accessibleRoles []string) (*auth.Payload, error)

func ConvertUser

func ConvertUser(user database.User) *pb.User

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 HttpLogger

func HttpLogger(handler http.Handler) http.Handler

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 Metadata

type Metadata struct {
	UserAgent string
	ClientIP  string
	Host      string
}

type ResponseRecorder

type ResponseRecorder struct {
	http.ResponseWriter
	StatusCode int
	Body       []byte
}

func (*ResponseRecorder) Write

func (rec *ResponseRecorder) Write(body []byte) (int, error)

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 (*SimpleBankServer) LoginUser

func (*SimpleBankServer) UpdateUser

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL