rest

package
v0.0.0-...-6b04d54 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2020 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultMaxIncomingConnections = 0

DefaultMaxIncomingConnections : No limit by default

View Source
var ServerReadTimeout = 200

ServerReadTimeout : Timeout limit on read requests

View Source
var ServerWriteTimeout = 200

ServerWriteTimeout : Timeout limit on write requests

Functions

func CreatePublicHandler

func CreatePublicHandler(sc *ServerContext) http.Handler

CreatePublicHandler : Public Method handler

func ListenAndServeHTTP

func ListenAndServeHTTP(addr string, connLimit int, readTimeout int, writeTimeout int, Handler http.Handler) error

ListenAndServeHTTP : Listen to HTTP requests

func RatedListen

func RatedListen(protocol string, addr string, limit int) (net.Listener, error)

RatedListen : Listener method

func StartServer

func StartServer(listenIP string, listenPort int, isSSL bool, configPath string)

StartServer : Initiates Master server afte injecting config params

func ValidateMethod

func ValidateMethod(request, expected string) error

ValidateMethod : check if HTTP method is permitted

Types

type ContainerImageInfo

type ContainerImageInfo struct {
	*types.ContainerImage
}

ContainerImageInfo : API Object for sending / receiving ContainerImage

type Handler

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

Handler : HTTP Request Handler

func (*Handler) SessionUser

func (h *Handler) SessionUser() *types.User

SessionUser : Returns loggeed in User

type HandlerMethod

type HandlerMethod func(*Handler) error

HandlerMethod : Generic handler method

type HandlerPrivs

type HandlerPrivs int

HandlerPrivs : HandlerPrivs

type Master

type Master struct {
	Config *config.Config
	IP     string
	Port   int32
	SSL    bool
}

Master : Master Server that handlers all REST calls

func NewMasterServer

func NewMasterServer(ip string, port int32, ssl bool, c *config.Config) *Master

NewMasterServer : Handles creation of a new Master

func (*Master) ListenAddress

func (m *Master) ListenAddress() string

ListenAddress : Returns the listening address for the server from config

func (*Master) Serve

func (m *Master) Serve(Handler http.Handler)

Serve : Serves the Master

type NotebookInfo

type NotebookInfo struct {
	PodInfo
}

NotebookInfo : API Object for POD with jupyter LAB

type PodInfo

type PodInfo struct {
	// User POD ID
	ID uint64

	// Resource Profile ID
	ResourceProfileID uint64

	// Resources
	ResourceProfile *types.ResourceProfile

	// Container Image ID
	ContainerImageID uint64

	// ContainerImage
	ContainerImage *types.ContainerImage

	// Pod Workspace Params
	Params *types.PODParams

	// UserPOD (optional)
	POD *types.POD

	// POD Status message
	Status string

	// Pod Phase message
	Phase string
}

PodInfo : API Object for User POD

type ResourceGroupInfo

type ResourceGroupInfo struct {
	ID              uint64
	Name            string
	ResourceProfile []ResourceProfInfo
}

ResourceGroupInfo :

type ResourceProfInfo

type ResourceProfInfo struct {
	*types.ResourceProfile
}

ResourceProfInfo : API Object for sending/receiving ResourceProfInfo

type ResourceProfsInfo

type ResourceProfsInfo []types.ResourceProfile

ResourceProfsInfo : List of Resource Profile messages

type ServerContext

type ServerContext struct {
	DBContext db.DatabaseContext

	HTTPClient *http.Client

	DisablePodRequest bool
	// contains filtered or unexported fields
}

ServerContext : Retains Server Context Parameters

func NewServerContext

func NewServerContext(config *constants.Config) (*ServerContext, error)

NewServerContext : Initiates a new server context

func (*ServerContext) ReadyForRequests

func (sc *ServerContext) ReadyForRequests() bool

ReadyForRequests : Disable pod requests in Safe Mode

type SessionInfo

type SessionInfo struct {
	UserName string
	Email    string
	JWT      string
	Status   string
}

SessionInfo :

type UserInfo

type UserInfo struct {
	Name string
}

UserInfo : API Info Object for User

type UserSignupInfo

type UserSignupInfo struct {
	UserName string
	Email    string
	Password string
}

UserSignupInfo :

Jump to

Keyboard shortcuts

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