Documentation ¶
Index ¶
- func ClientError(status int, message string) (events.APIGatewayProxyResponse, error)
- func GenerateShortURLID(length int) string
- func HandleAPIGatewayRequest(ctx context.Context, req events.APIGatewayV2HTTPRequest) (events.APIGatewayProxyResponse, error)
- func HandleSQSMessage(ctx context.Context, message events.SQSMessage) error
- func IsValidLink(u string) bool
- func PostMessageToSlack(ctx context.Context, message string) error
- func ServerError(err error) (events.APIGatewayProxyResponse, error)
- func SlackHandler(ctx context.Context, event json.RawMessage) error
- type DeleteFunctionHandler
- type GenerateLinkFunctionHandler
- type RedirectFunctionHandler
- type RequestBody
- type StatsFunctionHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClientError ¶
func ClientError(status int, message string) (events.APIGatewayProxyResponse, error)
func GenerateShortURLID ¶
func HandleAPIGatewayRequest ¶
func HandleAPIGatewayRequest(ctx context.Context, req events.APIGatewayV2HTTPRequest) (events.APIGatewayProxyResponse, error)
func HandleSQSMessage ¶
func HandleSQSMessage(ctx context.Context, message events.SQSMessage) error
func IsValidLink ¶
func ServerError ¶
func ServerError(err error) (events.APIGatewayProxyResponse, error)
func SlackHandler ¶
func SlackHandler(ctx context.Context, event json.RawMessage) error
Types ¶
type DeleteFunctionHandler ¶
type DeleteFunctionHandler struct {
// contains filtered or unexported fields
}
func NewDeleteFunctionHandler ¶
func NewDeleteFunctionHandler(l *services.LinkService, s *services.StatsService) *DeleteFunctionHandler
func (*DeleteFunctionHandler) Delete ¶
func (s *DeleteFunctionHandler) Delete(ctx context.Context, req events.APIGatewayV2HTTPRequest) (events.APIGatewayProxyResponse, error)
type GenerateLinkFunctionHandler ¶
type GenerateLinkFunctionHandler struct {
// contains filtered or unexported fields
}
func NewGenerateLinkFunctionHandler ¶
func NewGenerateLinkFunctionHandler(l *services.LinkService, s *services.StatsService) *GenerateLinkFunctionHandler
func (*GenerateLinkFunctionHandler) CreateShortLink ¶
func (h *GenerateLinkFunctionHandler) CreateShortLink(ctx context.Context, req events.APIGatewayV2HTTPRequest) (events.APIGatewayProxyResponse, error)
type RedirectFunctionHandler ¶
type RedirectFunctionHandler struct {
// contains filtered or unexported fields
}
func NewRedirectFunctionHandler ¶
func NewRedirectFunctionHandler(l *services.LinkService, s *services.StatsService) *RedirectFunctionHandler
func (*RedirectFunctionHandler) Redirect ¶
func (h *RedirectFunctionHandler) Redirect(ctx context.Context, req events.APIGatewayV2HTTPRequest) (events.APIGatewayProxyResponse, error)
type RequestBody ¶
type RequestBody struct {
Long string `json:"long"`
}
type StatsFunctionHandler ¶
type StatsFunctionHandler struct {
// contains filtered or unexported fields
}
func NewStatsFunctionHandler ¶
func NewStatsFunctionHandler(l *services.LinkService, s *services.StatsService) *StatsFunctionHandler
func (*StatsFunctionHandler) Stats ¶
func (s *StatsFunctionHandler) Stats(ctx context.Context, req events.APIGatewayV2HTTPRequest) (events.APIGatewayProxyResponse, error)
Click to show internal directories.
Click to hide internal directories.