Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIServer ¶
type APIServer struct {
// contains filtered or unexported fields
}
APIServer handles HTTP/WebSocket requests/connections defined for kontex-atn
func NewAPIServer ¶
func NewAPIServer(hub *Hub, conf *Config, taskMaster TaskMaster, cacheRootPath string) *APIServer
NewAPIServer creates a properly initialized instance of APIServer
type ConcStatusResponse ¶
type ConcStatusResponse struct { FullSize int `json:"fullsize"` ConcSize int `json:"concsize"` RelConcSize float32 `json:"relconcsize"` ConcPersistenceOpID string `json:"conc_persistence_op_id"` Messages []string `json:"messages"` UserOwnsConc bool `json:"user_owns_conc"` Q []string `json:"Q"` Finished bool `json:"finished"` ARF float32 `json:"arf"` }
ConcStatusResponse specifies a conc. calculation status as required by KonText client.
func NewConcStatusResponse ¶
func NewConcStatusResponse(evt *kcache.ConcCacheEvent) *ConcStatusResponse
NewConcStatusResponse creates a properly initialized ConcStatusResponse
type Config ¶
type Config struct { Address string `json:"address"` URLPathRoot string `json:"urlPathRoot"` AllowedOrigins []string `json:"allowedOrigins"` SSLCertFile string `json:"sslCertFile"` SSLKeyFile string `json:"sslKeyFile"` StaticFilesDir string `json:"staticFilesDir"` }
Config defines a configuration required by konserver to run the embedded WebSocket server.
type Hub ¶
type Hub struct { Register chan *WSClient Unregister chan *WSClient // contains filtered or unexported fields }
Hub controls the communication between calculation watchdogs and WebSocket clients.
func NewHub ¶
func NewHub(cacheDB *taskdb.ConcCacheDB) *Hub
NewHub creates a proper instance of the Hub with all the channels initialized
type InfoPageData ¶
type InfoPageData struct { Date string MasterInfo *workpool.MasterInfo }
type TaskMaster ¶
type TaskMaster interface { Info() *workpool.MasterInfo GetTask(taskID string) *workpool.Task SendTask(name string, jsonArgs []byte) *workpool.Task Start() Stop() }
TaskMaster represents a general task queue as seen from the APIServer perspective.
type WSClient ¶
type WSClient struct { Incoming chan *kcache.ConcCacheEvent // contains filtered or unexported fields }
WSClient keeps connection with actual remote client (= browser) and sends data it recieves from a respective channel.
func NewWSClient ¶
NewWSClient creates a proper instance of Client with all the channels initialized.
func (*WSClient) CacheIdent ¶
func (c *WSClient) CacheIdent() *kcache.CacheIdent
CacheIdent returns a complete concordance cache identification based on how KonText works.
func (*WSClient) Run ¶
func (c *WSClient) Run()
Run starts to listen on all the channels. This method must be used within a goroutine.