server

package
v0.1.0-5e6070b Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

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

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 CoopSaaSAPIServer

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

func NewServer

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

func (*CoopSaaSAPIServer) ListenAndServe

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

type GetUserIDFromRequest

type GetUserIDFromRequest func(r *http.Request) (string, 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 coophive 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