controller

package
v0.0.0-...-262e94b Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ActionAdd is action to add point.
	ActionAdd = "add"
	// ActionSubtract is action to subtract point.
	ActionSubtract = "subtract"
)

Variables

This section is empty.

Functions

func GetRoutesV1

func GetRoutesV1(cfg config.Config) (r http.Handler, err error)

GetRoutesV1 to get all v1 routes.

func RegisterBaseRoutes

func RegisterBaseRoutes(router *chi.Mux)

RegisterBaseRoutes registers base routes.

Types

type PointHandler

type PointHandler struct {
	DB     *gorm.DB
	Rabbit *amqp.Channel
}

PointHandler to handle all point activities.

type RabbitQueue

type RabbitQueue struct {
	UserID      int       `json:"user_id"`
	Action      string    `json:"action"`
	Point       int       `json:"point"`
	RequestedAt time.Time `json:"requested_at"`
}

RabbitQueue is model data for rabbitmq queue.

Jump to

Keyboard shortcuts

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