statusservice

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2026 License: GPL-3.0 Imports: 19 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartStatusHandler

func StartStatusHandler(ctx context.Context, data *HandlerData) (chan struct{}, error)

StartStatusHandler starts the event queue listener for status events returns channel for tracking if all jobs are finished

func StartWebServer

func StartWebServer(data *Data) error

StartWebServer starts echo web service

Types

type DB

type DB interface {
	LoadStatus(ctx context.Context, id string) (*persistence.Status, error)
}

DB loads status info

type Data

type Data struct {
	Port      int
	DB        DB
	WSHandler WSConnHandler
}

Data keeps data required for service work

type HandlerData

type HandlerData struct {
	GueClient   *gue.Client
	WorkerCount int
	DB          StatusDB
	WSHandler   WSConnHandler
}

HandlerData keeps data required for handler

type StatusDB

type StatusDB interface {
	LoadStatus(ctx context.Context, id string) (*persistence.Status, error)
}

StatusDB provides persistance functionality

type WSConnHandler

type WSConnHandler interface {
	HandleConnection(WsConn) error
	GetConnections(id string) ([]WsConn, bool)
}

WSConnHandler WwbSocketConnection wrapper

type WSConnKeeper

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

WSConnKeeper implements connection management

func NewWSConnKeeper

func NewWSConnKeeper() *WSConnKeeper

NewWSConnKeeper creates manager

func (*WSConnKeeper) GetConnections

func (kp *WSConnKeeper) GetConnections(id string) ([]WsConn, bool)

GetConnections returns saved connections by provided id

func (*WSConnKeeper) HandleConnection

func (kp *WSConnKeeper) HandleConnection(conn WsConn) error

HandleConnection loops until connection active and save connection with provided ID as key

type WsConn

type WsConn interface {
	ReadMessage() (messageType int, p []byte, err error)
	Close() error
	WriteJSON(v interface{}) error
}

WsConn is interface for websocket handling in status service

Jump to

Keyboard shortcuts

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