Documentation ¶
Index ¶
- Variables
- type AccessDetails
- type AuthHandler
- type AuthService
- type MysqlClient
- type Product
- type ProductDTO
- type ProductHandler
- type ProductRepository
- type ProductService
- type RedisClient
- type TokenDetails
- type User
- type UserDTO
- type UserHandler
- type UserHandlerDynamoDb
- type UserRepository
- type UserRepositoryCtx
- type UserService
- type UserServiceDynamoDb
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type AccessDetails ¶
AccessDetails Access details
type AuthHandler ¶
AuthHandler Auth handler
type AuthService ¶
type AuthService interface { ValidateToken(r *http.Request) (*jwt.Token, error) TokenValid(r *http.Request) error CreateToken(userID uint) (*TokenDetails, error) CreateAuth(userID uint, td *TokenDetails) error DeleteTokens(authD *AccessDetails) error ExtractTokenMetadata(r *http.Request) (*AccessDetails, error) FetchAuth(authD *AccessDetails) (uint64, error) DeleteAuth(givenUUID string) (int64, error) }
AuthService Auth service
type Product ¶
type Product struct { gorm.Model Name string `json:"name" validate:"required,min=2,max=45"` Price float32 `json:"price" validate:"required"` Description string `json:"description" validate:"required"` }
Product Entity product swagger:model Product
type ProductDTO ¶
type ProductDTO struct { ID uint `json:"id,string,omitempty"` Name string `json:"name" validate:"required,min=2,max=45"` Price float32 `json:"price" validate:"required"` Description string `json:"description" validate:"required"` }
ProductDTO Product dto swagger:model ProductDTO
func ToProductDTOs ¶
func ToProductDTOs(products []Product) []ProductDTO
ToProductDTOs To_Product_Dtos
type ProductHandler ¶
type ProductHandler interface { GetAllProducts(c *gin.Context) GetProductByID(c *gin.Context) AddProduct(c *gin.Context) UpdateProduct(c *gin.Context) DeleteProduct(c *gin.Context) }
ProductHandler Product_Handler
type ProductRepository ¶
type ProductRepository interface { GetAllProducts() []Product GetProductByID(id uint) Product AddProduct(product Product) Product DeleteProduct(product Product) }
ProductRepository Product_Repository
type ProductService ¶
type ProductService interface { GetAllProducts() []Product GetProductByID(id uint) Product AddProduct(product Product) Product DeleteProduct(product Product) }
ProductService Product_Service
type RedisClient ¶
type RedisClient interface {
GetClient() *redis.Client
}
RedisClient Redis Client
type TokenDetails ¶
type TokenDetails struct { AccessToken string RefreshToken string AccessUUID string RefreshUUID string AtExpires int64 RtExpires int64 }
TokenDetails Token details
type User ¶
type User struct { gorm.Model Username string `json:"username" validate:"required"` Password string `json:"password" validate:"required"` }
User Entity_user swagger:model User
type UserDTO ¶
type UserDTO struct { ID uint `json:"id,string,omitempty"` Username string `json:"username" validate:"required"` Password string `json:"password" validate:"required"` }
UserDTO Dto_user swagger:model UserDTO
type UserHandler ¶
type UserHandler interface { GetAllUsers(c *gin.Context) GetUserByID(c *gin.Context) AddUser(c *gin.Context) UpdateUser(c *gin.Context) DeleteUser(c *gin.Context) }
UserHandler User_handler
type UserHandlerDynamoDb ¶
type UserHandlerDynamoDb interface { Update(c *gin.Context) Find(c *gin.Context) Insert(c *gin.Context) Delete(c *gin.Context) }
UserHandlerDynamoDb User_handler_dynamodb
type UserRepository ¶
type UserRepository interface { GetAllUsers() []User GetUserByID(id uint) User GetUserByUsername(username string) User AddUser(user User) User DeleteUser(user User) }
UserRepository User_repository
type UserRepositoryCtx ¶
type UserRepositoryCtx interface { Update(ctx context.Context, user User) error Find(ctx context.Context, id uint) (User, error) Insert(ctx context.Context, user User) error Delete(ctx context.Context, id uint) error }
UserRepositoryCtx User_repository_ctx
Click to show internal directories.
Click to hide internal directories.