server

package
v0.0.0-...-376b802 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const CLIENT_ID = "api"
View Source
const REALM = "lilypad"

Variables

This section is empty.

Functions

func StartWebSocketServer

func StartWebSocketServer(
	ctx context.Context,
	r *mux.Router,
	path string,
	jobUpdatesChan chan *types.Job,
	getUserIDFromRequest GetUserIDFromRequest,
)

StartWebSocketServer starts a WebSocket server

Types

type ConnectionWrapper

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

type GetUserIDFromRequest

type GetUserIDFromRequest func(r *http.Request) (string, error)

type LilysaasAPIServer

type LilysaasAPIServer struct {
	Options    ServerOptions
	Store      store.Store
	Controller *controller.Controller
}

func NewServer

func NewServer(
	options ServerOptions,
	store store.Store,
	controller *controller.Controller,
) (*LilysaasAPIServer, error)

func (*LilysaasAPIServer) ListenAndServe

func (apiServer *LilysaasAPIServer) ListenAndServe(ctx context.Context, cm *system.CleanupManager) error

type RunJobResults

type RunJobResults struct {
	JobOffer data.JobOfferContainer `json:"job_offer"`
	Result   data.Result            `json:"result"`
}

type ServerOptions

type ServerOptions struct {
	URL           string
	Host          string
	Port          int
	KeyCloakURL   string
	KeyCloakToken string
	// this is for when we are running localfs filesystem
	// and we need to add a route to view files based on their path
	// we are assuming all file storage is open right now
	// so we just deep link to the object path and don't apply auth
	// (this is so lilypad nodes can see files)
	// later, we might add a token to the URLs
	LocalFilestorePath string
}

Jump to

Keyboard shortcuts

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