controller
import "budget-tracker-api-v2/internal/http/controller"
Index
- func GenerateJWTAccessToken(ctx context.Context, jwtKey string, sub string, login string) (string, error)
- func GenerateJWTRefreshToken(ctx context.Context, jwtKey string, sub string) (string, error)
- func SwaggerRegisterRouter(r *mux.Router)
- type AuthController
- func (uc *AuthController) CreateToken(w http.ResponseWriter, r *http.Request)
- func (ac *AuthController) RegisterRoutes(r *mux.Router)
- type CardDeletedMessage
- type CardsController
- func (uc *CardsController) CreateCard(w http.ResponseWriter, r *http.Request)
- func (uc *CardsController) DeleteCard(w http.ResponseWriter, r *http.Request)
- func (uc *CardsController) GetCard(w http.ResponseWriter, r *http.Request)
- func (uc *CardsController) GetCards(w http.ResponseWriter, r *http.Request)
- func (uc *CardsController) RegisterRoutes(r *mux.Router)
- type CardsCreatedMessage
- type CardsErrorMessage
- type HealthController
- func (uc *HealthController) HealthCheck(w http.ResponseWriter, r *http.Request)
- func (uc *HealthController) RegisterRoutes(r *mux.Router)
- type TransactionCreatedMessage
- type TransactionErrorMessage
- type TransactionsController
- func (tc *TransactionsController) CreateTransaction(w http.ResponseWriter, r *http.Request)
- func (tc *TransactionsController) Getransaction(w http.ResponseWriter, r *http.Request)
- func (uc *TransactionsController) RegisterRoutes(r *mux.Router)
- type UsersController
- func (uc *UsersController) CreateUser(w http.ResponseWriter, r *http.Request)
- func (uc *UsersController) GetUser(w http.ResponseWriter, r *http.Request)
- func (uc *UsersController) RegisterRoutes(r *mux.Router)
func GenerateJWTAccessToken
func GenerateJWTAccessToken(ctx context.Context, jwtKey string, sub string, login string) (string, error)
GenerateJWTAccessToken will generate a JWT access token
func GenerateJWTRefreshToken
func GenerateJWTRefreshToken(ctx context.Context, jwtKey string, sub string) (string, error)
GenerateJWTRefreshToken will generate a new refresh token
func SwaggerRegisterRouter
func SwaggerRegisterRouter(r *mux.Router)
type AuthController
type AuthController struct {
Tracer trace.Tracer
UserRepo repository.UserCollectionInterface
}
func (*AuthController) CreateToken
func (uc *AuthController) CreateToken(w http.ResponseWriter, r *http.Request)
GetCards handler list of all card within the platform without filters. Deprecated.
func (*AuthController) RegisterRoutes
func (ac *AuthController) RegisterRoutes(r *mux.Router)
RegisterRoutes register router for handling Card operations
type CardDeletedMessage
type CardDeletedMessage struct {
Message string `json:"message"`
ID string `json:"id"`
StatusCode int32 `json:"status_code,omitempty"`
}
type CardsController
CardsController injects CardRepository to controllers
type CardsController struct {
Tracer trace.Tracer
Repo repository.CardCollectionInterface
}
func (*CardsController) CreateCard
func (uc *CardsController) CreateCard(w http.ResponseWriter, r *http.Request)
func (*CardsController) DeleteCard
func (uc *CardsController) DeleteCard(w http.ResponseWriter, r *http.Request)
func (*CardsController) GetCard
func (uc *CardsController) GetCard(w http.ResponseWriter, r *http.Request)
func (*CardsController) GetCards
func (uc *CardsController) GetCards(w http.ResponseWriter, r *http.Request)
GetCards handler list of all card within the platform without filters. Deprecated.
func (*CardsController) RegisterRoutes
func (uc *CardsController) RegisterRoutes(r *mux.Router)
RegisterRoutes register router for handling Card operations
type CardsCreatedMessage
type CardsCreatedMessage struct {
Message string `json:"message"`
ID string `json:"id"`
OwnerID string `json:"owner_id"`
StatusCode int32 `json:"status_code"`
Card model.Card `json:"card"`
}
type CardsErrorMessage
type CardsErrorMessage struct {
Message string `json:"message"`
Details string `json:"details"`
StatusCode int32 `json:"status_code,omitempty"`
}
type HealthController
type HealthController struct {
Tracer trace.Tracer
HealthRepo repository.HealthCollectionInterface
}
func (*HealthController) HealthCheck
func (uc *HealthController) HealthCheck(w http.ResponseWriter, r *http.Request)
Ping handler list of all card within the platform without filters. Deprecated.
func (*HealthController) RegisterRoutes
func (uc *HealthController) RegisterRoutes(r *mux.Router)
RegisterRoutes register router for handling healthcheck operations
type TransactionCreatedMessage
type TransactionCreatedMessage struct {
Message string `json:"message"`
ID string `json:"id"`
OwnerID string `json:"owner_id"`
StatusCode int32 `json:"status_code"`
Transaction model.Transaction `json:"transaction"`
}
type TransactionErrorMessage
type TransactionErrorMessage struct {
Message string `json:"message"`
Details string `json:"details"`
StatusCode int32 `json:"status_code,omitempty"`
}
type TransactionsController
TransactionsController injects CardRepository to controllers
type TransactionsController struct {
Tracer trace.Tracer
TransactionRepo repository.TransactionCollectionInterface
CardsRepo repository.CardCollectionInterface
}
func (*TransactionsController) CreateTransaction
func (tc *TransactionsController) CreateTransaction(w http.ResponseWriter, r *http.Request)
func (*TransactionsController) Getransaction
func (tc *TransactionsController) Getransaction(w http.ResponseWriter, r *http.Request)
func (*TransactionsController) RegisterRoutes
func (uc *TransactionsController) RegisterRoutes(r *mux.Router)
RegisterRoutes register router for handling Card operations
type UsersController
UsersController injects UserRepository to controllers
type UsersController struct {
Tracer trace.Tracer
Repo repository.UserCollectionInterface
}
func (*UsersController) CreateUser
func (uc *UsersController) CreateUser(w http.ResponseWriter, r *http.Request)
CreateUser create a new user within the platform
func (*UsersController) GetUser
func (uc *UsersController) GetUser(w http.ResponseWriter, r *http.Request)
GetUser will find a single user based on ID
func (*UsersController) RegisterRoutes
func (uc *UsersController) RegisterRoutes(r *mux.Router)
RegisterRoutes register router for handling User operations
Generated by gomarkdoc