MCPcopy Create free account

hub / github.com/bagashiz/go-pos / functions

Functions350 in github.com/bagashiz/go-pos

↓ 148 callersMethodEXPECT
EXPECT returns an object that allows the caller to indicate expected use.
internal/core/port/mock/cache.go:39
↓ 81 callersMethodSet
Set stores the value in the cache
internal/core/port/cache.go:13
↓ 60 callersMethodGet
Get retrieves the value from the cache
internal/core/port/cache.go:15
↓ 59 callersMethodEXPECT
EXPECT returns an object that allows the caller to indicate expected use.
internal/core/port/mock/category.go:39
↓ 53 callersMethodGetCategoryByID
GetCategoryByID selects a category by id
internal/core/port/category.go:16
↓ 44 callersMethodDelete
Delete removes the value from the cache
internal/core/port/cache.go:17
↓ 43 callersFunctionGenerateCacheKey
GenerateCacheKey generates a cache key based on the input parameters
internal/core/util/cache.go:9
↓ 42 callersMethodEXPECT
EXPECT returns an object that allows the caller to indicate expected use.
internal/core/port/mock/product.go:39
↓ 41 callersMethodDeleteByPrefix
DeleteByPrefix removes the value from the cache with the given prefix
internal/core/port/cache.go:19
↓ 41 callersMethodEXPECT
EXPECT returns an object that allows the caller to indicate expected use.
internal/core/port/mock/user.go:39
↓ 38 callersFunctionSerialize
Serialize marshals the input data into an array of bytes
internal/core/util/cache.go:30
↓ 36 callersMethodEXPECT
EXPECT returns an object that allows the caller to indicate expected use.
internal/core/port/mock/payment.go:39
↓ 31 callersMethodGetProductByID
GetProductByID selects a product by id
internal/core/port/product.go:16
↓ 28 callersFunctionvalidationError
validationError sends an error response for some specific request validation error
internal/adapter/handler/http/response.go:226
↓ 26 callersMethodGetPaymentByID
GetPaymentByID selects a payment by id
internal/core/port/payment.go:16
↓ 26 callersMethodGetUserByID
GetUserByID selects a user by id
internal/core/port/user.go:16
↓ 24 callersFunctionhandleError
handleError determines the status code of an error and returns a JSON response with the error message and status code
internal/adapter/handler/http/response.go:233
↓ 24 callersFunctionhandleSuccess
handleSuccess sends a success response with the specified status code and optional data
internal/adapter/handler/http/response.go:286
↓ 20 callersFunctionNewMockCacheRepository
NewMockCacheRepository creates a new mock instance.
internal/core/port/mock/cache.go:32
↓ 11 callersFunctionDeserialize
Deserialize unmarshals the input data into the output interface
internal/core/util/cache.go:35
↓ 10 callersFunctionNewMockCategoryRepository
NewMockCategoryRepository creates a new mock instance.
internal/core/port/mock/category.go:32
↓ 9 callersFunctionGenerateCacheKeyParams
GenerateCacheParams generates a cache params based on the input parameters
internal/core/util/cache.go:14
↓ 9 callersFunctionnullString
nullString converts a string to sql.NullString for empty string check
internal/adapter/storage/postgres/repository/helper.go:8
↓ 8 callersMethodErrorCode
ErrorCode returns the error code of the given error
internal/adapter/storage/postgres/db.go:85
↓ 8 callersMethodUpdateCategory
UpdateCategory updates a category
internal/core/port/category.go:34
↓ 8 callersMethodUpdatePayment
UpdatePayment updates a payment
internal/core/port/payment.go:34
↓ 8 callersMethodUpdateProduct
UpdateProduct updates a product
internal/core/port/product.go:34
↓ 8 callersMethodUpdateUser
UpdateUser updates a user
internal/core/port/user.go:36
↓ 7 callersMethodCreateCategory
CreateCategory creates a new category
internal/core/port/category.go:28
↓ 7 callersMethodCreatePayment
CreatePayment creates a new payment
internal/core/port/payment.go:28
↓ 7 callersMethodCreateProduct
CreateProduct creates a new product
internal/core/port/product.go:28
↓ 7 callersMethodListProducts
ListProducts returns a list of products with pagination
internal/core/port/product.go:32
↓ 6 callersMethodCreateUser
CreateUser inserts a new user into the database
internal/core/port/user.go:14
↓ 6 callersMethodGetUserByEmail
GetUserByEmail selects a user by email
internal/core/port/user.go:18
↓ 6 callersFunctionNewCategoryService
NewCategoryService creates a new category service instance
internal/core/service/category.go:22
↓ 6 callersFunctionNewMockUserRepository
NewMockUserRepository creates a new mock instance.
internal/core/port/mock/user.go:32
↓ 6 callersFunctionNewPaymentService
NewPaymentService creates a new payment service instance
internal/core/service/payment.go:22
↓ 6 callersFunctionNewProductService
NewProductService creates a new product service instance
internal/core/service/product.go:23
↓ 6 callersFunctionNewUserService
NewUserService creates a new user service instance
internal/core/service/user.go:22
↓ 5 callersMethodClose
Close closes the connection to the cache server
internal/core/port/cache.go:21
↓ 5 callersFunctionHashPassword
HashPassword hashes input password using bcrypt
internal/core/util/password.go:6
↓ 5 callersMethodListCategories
ListCategories returns a list of categories with pagination
internal/core/port/category.go:32
↓ 5 callersMethodListPayments
ListPayments returns a list of payments with pagination
internal/core/port/payment.go:32
↓ 5 callersMethodListUsers
ListUsers returns a list of users with pagination
internal/core/port/user.go:34
↓ 5 callersFunctionNewMockPaymentRepository
NewMockPaymentRepository creates a new mock instance.
internal/core/port/mock/payment.go:32
↓ 5 callersFunctionNewMockProductRepository
NewMockProductRepository creates a new mock instance.
internal/core/port/mock/product.go:32
↓ 5 callersFunctionauthMiddleware
authMiddleware is a middleware to check if the user is authenticated
internal/adapter/handler/http/middleware.go:21
↓ 5 callersFunctionhandleAbort
handleAbort sends an error response and aborts the request with the specified status code and error message
internal/adapter/handler/http/response.go:245
↓ 5 callersFunctionnewCategoryResponse
newCategoryResponse is a helper function to create a response body for handling category data
internal/adapter/handler/http/response.go:102
↓ 5 callersFunctionnewMeta
newMeta is a helper function to create metadata for a paginated response
internal/adapter/handler/http/response.go:37
↓ 5 callersFunctionnewPaymentResponse
newPaymentResponse is a helper function to create a response body for handling payment data
internal/adapter/handler/http/response.go:86
↓ 5 callersFunctionnewProductResponse
newProductResponse is a helper function to create a response body for handling product data
internal/adapter/handler/http/response.go:123
↓ 5 callersFunctiontoMap
toMap is a helper function to add meta and data to a map
internal/adapter/handler/http/helper.go:23
↓ 4 callersMethodDeleteCategory
DeleteCategory deletes a category
internal/core/port/category.go:36
↓ 4 callersMethodDeletePayment
DeletePayment deletes a payment
internal/core/port/payment.go:36
↓ 4 callersMethodDeleteProduct
DeleteProduct deletes a product
internal/core/port/product.go:36
↓ 4 callersMethodDeleteUser
DeleteUser deletes a user
internal/core/port/user.go:38
↓ 4 callersFunctionadminMiddleware
adminMiddleware is a middleware to check if the user is an admin
internal/adapter/handler/http/middleware.go:60
↓ 4 callersFunctionnewUserResponse
newUserResponse is a helper function to create a response body for handling user data
internal/adapter/handler/http/response.go:67
↓ 4 callersFunctionstringToUint64
stringToUint64 is a helper function to convert a string to uint64
internal/adapter/handler/http/helper.go:11
↓ 3 callersMethodCreateToken
CreateToken creates a new token for a given user
internal/core/port/auth.go:14
↓ 3 callersFunctionnewErrorResponse
newErrorResponse is a helper function to create an error response body
internal/adapter/handler/http/response.go:278
↓ 3 callersFunctionnewOrderResponse
newOrderResponse is a helper function to create a response body for handling order data
internal/adapter/handler/http/response.go:154
↓ 3 callersFunctionparseError
parseError parses error messages from the error object and returns a slice of error messages
internal/adapter/handler/http/response.go:257
↓ 2 callersMethodCreateOrder
CreateOrder creates a new order
internal/core/port/order.go:24
↓ 2 callersMethodEXPECT
EXPECT returns an object that allows the caller to indicate expected use.
internal/core/port/mock/auth.go:39
↓ 2 callersMethodListOrders
ListOrders returns a list of orders with pagination
internal/core/port/order.go:28
↓ 2 callersFunctionNewAuthService
NewAuthService creates a new auth service instance
internal/core/service/auth.go:22
↓ 2 callersMethodRegister
Register registers a new user
internal/core/port/user.go:30
↓ 2 callersFunctiongetAuthPayload
getAuthPayload is a helper function to get the auth payload from the context
internal/adapter/handler/http/helper.go:18
↓ 1 callersFunctionComparePassword
ComparePassword compares input password with hashed password
internal/core/util/password.go:16
↓ 1 callersMethodCreateCategory
CreateCategory creates a new category
internal/core/service/category.go:30
↓ 1 callersMethodCreatePayment
CreatePayment creates a new payment
internal/core/service/payment.go:30
↓ 1 callersMethodCreateProduct
CreateProduct creates a new product
internal/core/service/product.go:32
↓ 1 callersMethodDeleteCategory
DeleteCategory deletes a category
internal/core/service/category.go:178
↓ 1 callersMethodDeletePayment
DeletePayment deletes a payment
internal/core/service/payment.go:180
↓ 1 callersMethodDeleteProduct
DeleteProduct deletes a product
internal/core/service/product.go:235
↓ 1 callersMethodDeleteUser
DeleteUser deletes a user by ID
internal/core/service/user.go:200
↓ 1 callersMethodGetCategory
GetCategory retrieves a category by id
internal/core/service/category.go:59
↓ 1 callersMethodGetCategory
GetCategory returns a category by id
internal/core/port/category.go:30
↓ 1 callersMethodGetOrder
GetOrder returns an order by id
internal/core/port/order.go:26
↓ 1 callersMethodGetOrderByID
GetOrderByID selects an order by id
internal/core/port/order.go:16
↓ 1 callersMethodGetPayment
GetPayment retrieves a payment by id
internal/core/service/payment.go:59
↓ 1 callersMethodGetPayment
GetPayment returns a payment by id
internal/core/port/payment.go:30
↓ 1 callersMethodGetProduct
GetProduct retrieves a product by id
internal/core/service/product.go:71
↓ 1 callersMethodGetProduct
GetProduct returns a product by id
internal/core/port/product.go:30
↓ 1 callersMethodGetUser
GetUser gets a user by ID
internal/core/service/user.go:66
↓ 1 callersMethodGetUser
GetUser returns a user by id
internal/core/port/user.go:32
↓ 1 callersMethodListCategories
ListCategories retrieves a list of categories
internal/core/service/category.go:94
↓ 1 callersMethodListPayments
ListPayments retrieves a list of payments
internal/core/service/payment.go:95
↓ 1 callersMethodListProducts
ListProducts retrieves a list of products
internal/core/service/product.go:116
↓ 1 callersMethodListUsers
ListUsers lists all users
internal/core/service/user.go:101
↓ 1 callersMethodLogin
Login gives a registered user an access token if the credentials are valid
internal/core/service/auth.go:30
↓ 1 callersMethodLogin
Login authenticates a user by email and password and returns a token
internal/core/port/auth.go:22
↓ 1 callersMethodMigrate
Migrate runs the database migration
internal/adapter/storage/postgres/db.go:65
↓ 1 callersFunctionNew
New creates a new paseto instance
internal/adapter/auth/paseto/paseto.go:25
↓ 1 callersFunctionNew
New creates a new PostgreSQL database instance
internal/adapter/storage/postgres/db.go:35
↓ 1 callersFunctionNew
New creates a new instance of Redis
internal/adapter/storage/redis/redis.go:21
↓ 1 callersFunctionNew
New creates a new container instance
internal/adapter/config/config.go:51
↓ 1 callersFunctionNewAuthHandler
NewAuthHandler creates a new AuthHandler instance
internal/adapter/handler/http/auth.go:14
next →1–100 of 350, ranked by callers