routes

package
v0.0.0-...-9ebb391 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidFormat     = FT_Command{SentBy: "server", Command: "error", Payload: "Invalid Command Format"}
	ErrInvalidTransferID = FT_Command{SentBy: "server", Command: "error", Payload: "Invalid Transfer ID"}
)

Functions

func ApiGroup

func ApiGroup(group *echo.Group)

func BroadcastClientMessageAll

func BroadcastClientMessageAll(message utils.Message, client_id string)

Main chat broadcast General chat The client who sent the message is skipped

func BroadcastServerMessageAll

func BroadcastServerMessageAll(payload string)

For Server notification broadcasting When user joins/disconnects etc

func Chat

func Chat(c echo.Context) error

func ClientDisconnect

func ClientDisconnect(conn *websocket.Conn, client_id string, client *utils.Client)

Handle Client socket disconnection Graceful handling prevents error logs

func CronPing

func CronPing(c echo.Context) error

func DeleteJournalLog

func DeleteJournalLog(c echo.Context) error

func EchoBackBody

func EchoBackBody(c echo.Context) error

func EchoBackQuery

func EchoBackQuery(c echo.Context) error

func FileTransfer

func FileTransfer(c echo.Context) error

func FileTransferGroup

func FileTransferGroup(group *echo.Group)

func GetChatDebug

func GetChatDebug(c echo.Context) error

func GetChatLogs

func GetChatLogs(c echo.Context) error

func GetJournalLogs

func GetJournalLogs(c echo.Context) error

func GetLoggedData

func GetLoggedData(c echo.Context) error

func GetMarkdownFromSlug

func GetMarkdownFromSlug(c echo.Context) error

func GetNotesMedia

func GetNotesMedia(c echo.Context) error

func GetResume

func GetResume(c echo.Context) error

Initially download the file in ./data/files/resume.pdf If file exists at path then return the file Else download to the location Reduction in S3 fetching cost

func GetResumeHTML

func GetResumeHTML(c echo.Context) error

func GetResumePDF

func GetResumePDF(c echo.Context) error

func GetResumePNG

func GetResumePNG(c echo.Context) error

func GetRootInfo

func GetRootInfo(c echo.Context) error

func GetServerLogs

func GetServerLogs(c echo.Context) error

func GetUserLogs

func GetUserLogs(c echo.Context) error

func JournalLoggerGroup

func JournalLoggerGroup(group *echo.Group)

/api/journal

func LoginHandler

func LoginHandler(c echo.Context) error

func MiscGroup

func MiscGroup(group *echo.Group)

func NotesGroup

func NotesGroup(group *echo.Group)

func PostJournalLogEntry

func PostJournalLogEntry(c echo.Context) error

func RandomGreeting

func RandomGreeting(c echo.Context) error

func SendCommandToConn

func SendCommandToConn(command *FT_Command, conn *websocket.Conn)

func SendMessageToClient

func SendMessageToClient(message utils.Message, conn *websocket.Conn) error

Server to a single client Main method called by others

func ServerMessageToClient

func ServerMessageToClient(payload string, conn *websocket.Conn)

Simple wrapper to directly pass in strings and send to a conn

func SignupHandler

func SignupHandler(c echo.Context) error

func StreamVideoFile

func StreamVideoFile(c echo.Context) error

func UpdateApiData

func UpdateApiData(c echo.Context) error

Refreshes the local server Data

func UpdateJournalLog

func UpdateJournalLog(c echo.Context) error

func UserGroup

func UserGroup(group *echo.Group)

Types

type ClientUserLogReq

type ClientUserLogReq struct {
	Username string   `json:"username"`
	Password string   `json:"password"`
	Log      string   `json:"log"`
	Tags     []string `json:"tags"`
	Title    string   `json:"title"`
}

type DeleteLogReq

type DeleteLogReq struct {
	Username string `json:"username"`
	Password string `json:"password"`
	Log_Id   int    `json:"log_id"`
}

type FT_Command

type FT_Command struct {
	SentBy     string
	TransferID string
	Command    string
	Payload    interface{}
}

type FT_MetaData

type FT_MetaData struct {
	TransferID   string
	Filename     string
	FileByteSize int64
}

type FT_Packet

type FT_Packet struct {
	Payload    []byte
	Size       int
	TransferID string
}

type NewUserLogCreate

type NewUserLogCreate struct {
	User_id int      `json:"user_id"`
	Log     string   `json:"log_message"`
	Tags    []string `json:"tags"`
	Title   string   `json:"title"`
}

type UpdateLogReq

type UpdateLogReq struct {
	Username string   `json:"username"`
	Password string   `json:"password"`
	Log      string   `json:"log"`
	Tags     []string `json:"tags"`
	Title    string   `json:"title"`
	Log_Id   int      `json:"log_id"`
}

type UpdateLogReqDB

type UpdateLogReqDB struct {
	Log   string   `json:"log_message"`
	Tags  []string `json:"tags"`
	Title string   `json:"title"`
}

type UserAuthField

type UserAuthField struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type UserLogRes

type UserLogRes struct {
	Created_at string   `json:"created_at"`
	Log        string   `json:"log_message"`
	Title      string   `json:"title"`
	Tags       []string `json:"tags"`
	Log_Id     int      `json:"log_id"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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