server

package
v0.0.0-...-f72932a Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetErrorResponse

func SetErrorResponse(ctx *gin.Context, code int, msg string, err error)

Types

type Config

type Config struct {
	Variables  variables.Variables
	Database   database.Client
	DiscordBot discord.BotClient
}

type DefaultResponse

type DefaultResponse struct {
	Status  string `json:"status"`
	Message string `json:"message"`
}

type HealthCheck

type HealthCheck struct {
	Status string `json:"status"`
}

type MessageData

type MessageData struct {
	Subject   database.Subject
	Activites []database.Activity
}

type Server

type Server struct {
	Router *gin.Engine
	Config Config
}

func NewServer

func NewServer(config Config) Server

func (Server) AddActivity

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

func (Server) AddSubject

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

func (Server) GetActivities

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

func (Server) GetActivity

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

func (Server) GetSubject

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

func (Server) GetSubjects

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

func (Server) Liveness

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

func (Server) Readiness

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

func (Server) RemoveActivity

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

func (Server) RemoveSubject

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

func (Server) RouteNotFound

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

func (Server) SendDiscordNotification

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

func (Server) SetupRoutes

func (s Server) SetupRoutes()

func (Server) Start

func (s Server) Start() error

Jump to

Keyboard shortcuts

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