web

package
v0.0.0-...-fd40de8 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: MIT Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DASTemplateMap map[string]*template.Template

global map of templates

View Source
var Time0 time.Time

Time0 represents initial time when we started the server

View Source
var TotalGetRequests uint64

TotalGetRequests counts total number of GET requests received by the server

View Source
var TotalPostRequests uint64

TotalPostRequests counts total number of POST requests received by the server

Functions

func ApisHandler

func ApisHandler(w http.ResponseWriter, r *http.Request)

ApisHandler handlers Apis requests

func AuthHandler

func AuthHandler(w http.ResponseWriter, r *http.Request)

AuthHandler authenticate incoming requests and route them to appropriate handler

func CliHandler

func CliHandler(w http.ResponseWriter, r *http.Request)

CliHandler hadnlers cli requests

func ExtractValue

func ExtractValue(data mongo.DASRecord, daskey string) string

ExtractValue helper function to extract value from das record

func FAQHandler

func FAQHandler(w http.ResponseWriter, r *http.Request)

FAQHandler handlers FAQ requests

func KeysHandler

func KeysHandler(w http.ResponseWriter, r *http.Request)

KeysHandler handlers Keys requests

func PresentData

func PresentData(path string, dasquery dasql.DASQuery, data []mongo.DASRecord, pmap mongo.DASRecord, nres, startIdx, limit int, procTime time.Duration) string

PresentData represents DAS records for web UI

func PresentDataPlain

func PresentDataPlain(path string, dasquery dasql.DASQuery, data []mongo.DASRecord) string

PresentDataPlain represents DAS records for web UI

func RequestHandler

func RequestHandler(w http.ResponseWriter, r *http.Request)

RequestHandler is used by web server to handle incoming requests

func Server

func Server(configFile string)

Server is proxy server. It defines /fetch public interface

func ServicesHandler

func ServicesHandler(w http.ResponseWriter, r *http.Request)

ServicesHandler handlers Services requests

func SettingsHandler

func SettingsHandler(w http.ResponseWriter, r *http.Request)

SettingsHandler handlers Settings requests

func StatusHandler

func StatusHandler(w http.ResponseWriter, r *http.Request)

StatusHandler handlers Status requests

func UserDN

func UserDN(r *http.Request) string

UserDN function parses user Distinguished Name (DN) from client's HTTP request

Types

type DASKeys

type DASKeys struct {
	System string
	DKey   string
	RKey   string
}

DASKeys provides information about DAS keys used by ServiceHandler

type DASTemplates

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

DASTemplates structure

func (DASTemplates) ApiRecord

func (q DASTemplates) ApiRecord(tdir string, tmplData map[string]interface{}) string

ApiRecord method for DASTemplates structure

func (DASTemplates) Bottom

func (q DASTemplates) Bottom(tdir string, tmplData map[string]interface{}) string

Bottom method for DASTemplates structure

func (DASTemplates) CLI

func (q DASTemplates) CLI(tdir string, tmplData map[string]interface{}) string

CLI method for DASTemplates structure

func (DASTemplates) Cards

func (q DASTemplates) Cards(tdir string, tmplData map[string]interface{}) string

Cards method for DASTemplates structure

func (DASTemplates) DASError

func (q DASTemplates) DASError(tdir string, tmplData map[string]interface{}) string

DASError method for DASTemplates structure

func (DASTemplates) DASRequest

func (q DASTemplates) DASRequest(tdir string, tmplData map[string]interface{}) string

DASRequest method for DASTemplates structure

func (DASTemplates) DASZeroResults

func (q DASTemplates) DASZeroResults(tdir string, tmplData map[string]interface{}) string

DASZeroResults method for DASTemplates structure

func (DASTemplates) DasKeys

func (q DASTemplates) DasKeys(tdir string, tmplData map[string]interface{}) string

DasKeys method for DASTemplates structure

func (DASTemplates) FAQ

func (q DASTemplates) FAQ(tdir string, tmplData map[string]interface{}) string

FAQ method for DASTemplates structure

func (DASTemplates) Keys

func (q DASTemplates) Keys(tdir string, tmplData map[string]interface{}) string

Keys method for DASTemplates structure

func (DASTemplates) Pagination

func (q DASTemplates) Pagination(tdir string, tmplData map[string]interface{}) string

Pagination method for DASTemplates structure

func (DASTemplates) SearchForm

func (q DASTemplates) SearchForm(tdir string, tmplData map[string]interface{}) string

SearchForm method for DASTemplates structure

func (DASTemplates) Services

func (q DASTemplates) Services(tdir string, tmplData map[string]interface{}) string

Services method for DASTemplates structure

func (DASTemplates) Status

func (q DASTemplates) Status(tdir string, tmplData map[string]interface{}) string

Status method for DASTemplates structure

func (DASTemplates) Top

func (q DASTemplates) Top(tdir string, tmplData map[string]interface{}) string

Top method for DASTemplates structure

type Mem

type Mem struct {
	Virtual Memory
	Swap    Memory
}

Mem structure keeps track of virtual/swap memory of the server

type MemStats

type MemStats struct {
	Sys        uint64 // is the total bytes of memory obtained from the OS.
	Alloc      uint64 // is bytes of allocated heap objects.
	TotalAlloc uint64 // is cumulative bytes allocated for heap objects.
	HeapSys    uint64 // is bytes of heap memory obtained from the OS.
	HeapInuse  uint64 // is bytes in in-use spans
	StackSys   uint64 // is bytes of stack memory obtained from the OS
	StackInuse uint64 // is bytes in stack spans
	GCSys      uint64 // is bytes of memory in garbage collection metadata.
}

MemStats represents runtime memory stats

type Memory

type Memory struct {
	Total       uint64  `json:"total"`
	Free        uint64  `json:"free"`
	Used        uint64  `json:"used"`
	UsedPercent float64 `json:"usedPercent"`
}

Memory structure keeps track of server memory

type ServerSettings

type ServerSettings struct {
	Level          int    `json:"level"`          // verbosity level
	RucioTokenCurl bool   `json:"rucioTokenCurl"` // use curl method to obtain Rucio Token
	ProfileFile    string `json:"profileFile"`    // send profile data to a given file
}

ServerSettings controls server parameters

type UserDNs

type UserDNs struct {
	DNs  []string
	Time time.Time
}

UserDNs structure holds information about user DNs

Jump to

Keyboard shortcuts

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