coreapi

package
v0.0.0-...-ce8d5b4 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListenForWebSocket

func ListenForWebSocket(conn *WebSocketConnection)

func ListenToWebSocketChannel

func ListenToWebSocketChannel()

Types

type AddParticipantRaffleRequest

type AddParticipantRaffleRequest struct {
	RaffleID    string                 `json:"raffle_id" binding:"required"`
	Participant core.RaffleParticipant `json:"participant" binding:"required"`
}

type AddTicketParticipantRaffleRequest

type AddTicketParticipantRaffleRequest struct {
	RaffleID        string `json:"raffle_id" binding:"required"`
	ParticipantName string `json:"participant_name" binding:"required"`
	IsRandom        bool   `json:"is_random"`
	Ticket          string `json:"ticket"`
}

type CreateRaffleRequest

type CreateRaffleRequest struct {
	Name       string `json:"name" binding:"required"`
	Prize      string `json:"prize" binding:"required"`
	FirstTaken bool   `json:"first_taken"`
	Turns      int    `json:"turns" binding:"required"`
	MaxTickets int    `json:"max_tickets"`
}

type DeleteParticipantRaffleRequest

type DeleteParticipantRaffleRequest struct {
	RaffleID string `json:"raffle_id" binding:"required"`
	// Participant core.Participant `json:"participant" binding:"required"`
	ParticipantId string `json:"participant_id" binding:"required"`
}

type GetRaffleByIdRequest

type GetRaffleByIdRequest struct {
	Id string `uri:"id" binding:"required"`
}

type RaffleByIdRequest

type RaffleByIdRequest struct {
	RaffleId string `json:"raffle_id" binding:"required"`
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(config util.Config, database *mongo.Database) (*Server, error)

func (*Server) MelSuggest

func (s *Server) MelSuggest(ctx *gin.Context)

func (*Server) Start

func (s *Server) Start(address string) error

func (*Server) TicketSuggest

func (s *Server) TicketSuggest(ctx *gin.Context)

func (*Server) WebSocketEndpoint

func (s *Server) WebSocketEndpoint(ctx *gin.Context)

type WebSocketConnection

type WebSocketConnection struct {
	*websocket.Conn
}

type WebSocketPayload

type WebSocketPayload struct {
	Action   string              `json:"action"`
	Username string              `json:"username"`
	Message  string              `json:"Message"`
	Conn     WebSocketConnection `json:"-"`
}

type WebSocketResponse

type WebSocketResponse struct {
	Action         string   `json:"action"`
	Message        string   `json:"message"`
	MessageType    string   `json:"message_type"`
	ConnectedUsers []string `json:"connected_users"`
}

Jump to

Keyboard shortcuts

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