server

package
v0.0.0-...-a7f6470 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2019 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActionHandler

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

ActionHandler handles operations on requests

func AgentsHandler

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

AgentsHandler returns list of known agents

func AuthHandler

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

AuthHandler authenticate incoming requests and route them to appropriate handler

func CentralCatalogHandler

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

CentralCatalogHandler return all records in our catalog

func DefaultHandler

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

DefaultHandler provides information about the agent

func DownloadHandler

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

DownloadHandler handles download agent's request

func FilesHandler

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

FilesHandler provides information about files in catalog

func HistoricalHandler

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

HistoricalHandler is endpoint to get the historical data

func Init

func Init()

Init is custom initialization function, we don't use init() because we want control of authentication from command line

func ListHandler

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

ListHandler lists all transfer Requests

func PullHandler

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

PullHandler handles pull acknowledge message from main agent.

func PushHandler

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

PushHandler performs pushing data from a source to destination agent

func RecordsHandler

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

RecordsHandler provides records for given dataset/block/file request

func RegisterAgentHandler

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

RegisterAgentHandler registers current agent with another one

func RegisterProtocolHandler

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

RegisterProtocolHandler registers current agent with another one

func RequestHandler

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

RequestHandler initiate transfer work for given request

func ResetHandler

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

ResetHandler resets current agent with default protocol and null backend/tool attributes

func Server

func Server(config Config)

Server implementation

func SnapshotHandler

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

SnapshotHandler return all records in our catalog as JSON structure the JSON is a map of table names and rows where each row is represented as comma separated list of values. This handler can be used by CentralCatalog to fetch data from individual agents

func StatusHandler

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

StatusHandler provides information about the agent

func TFCHandler

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

TFCHandler registers given record in local TFC

func TransfersHandler

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

TransfersHandler provides information about files in catalog

func UploadDataHandler

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

UploadDataHandler upload TransferRecord record and send back catalog entry to recipient http://sanatgersappa.blogspot.com/2013/03/handling-multiple-file-uploads-in-go.html

func VerboseHandler

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

VerboseHandler sets verbosity level for the server

Types

type AgentInfo

type AgentInfo struct {
	Agent string
	Alias string
}

AgentInfo data type

type AgentProtocol

type AgentProtocol struct {
	Protocol string `json:"protocol"` // protocol name, e.g. srmv2
	Backend  string `json:"backend"`  // backend storage end-point, e.g. srm://cms-srm.cern.ch:8443/srm/managerv2?SFN=
	Tool     string `json:"tool"`     // actual executable, e.g. /usr/local/bin/srmcp
	ToolOpts string `json:"toolopts"` // options for backend tool
}

AgentProtocol data type

type Config

type Config struct {
	Name           string `json:"name"`           // agent name, aka site name
	Url            string `json:"url"`            // agent url
	Catalog        string `json:"catalog"`        // catalog file name, e.g. catalog.json
	CentralCatalog string `json:"centralCatalog"` // central catalog file name, e.g. cc.json
	Protocol       string `json:"protocol"`       // backend protocol, e.g. srmv2
	Backend        string `json:"backend"`        // backend, e.g. srm
	Tool           string `json:"tool"`           // backend tool, e.g. srmcp
	ToolOpts       string `json:"toolopts"`       // options for backend tool
	Mfile          string `json:"mfile"`          // metrics file name
	Cfile          string `json:"csvfile"`        // historical data file
	Minterval      int64  `json:"minterval"`      // metrics interval
	Staticdir      string `json:"staticdir"`      // static dir defines location of static files, e.g. sql,js templates
	Workers        int    `json:"workers"`        // number of workers
	QueueSize      int    `json:"queuesize"`      // total size of the queue
	Port           int    `json:"port"`           // port number given server runs on, default 8989
	Base           string `json:"base"`           // URL base path for agent server, it will be extracted from Url
	Register       string `json:"register"`       // remote agent URL to register
	ServerKey      string `json:"serverkey"`      // server key file
	ServerCrt      string `json:"servercrt"`      // server crt file
	Type           string `json:"type"`           // Configure server type push/pull
	BufferSize     int    `json:"buffersize"`     // Size of buffered channels
	MonitorTime    int64  `json:"monitorTime"`    // Large time interval after which we need to reset monitoring calculation
	TrainInterval  string `json:"trinterval"`     // Time after which we need to retrain main agent
	RouterModel    bool   `json:"router"`         // Variable to enable the router model
	TransferDelay  int    `json:"transferDelay"`  // Transfer delay threshold in seconds
}

Config type holds server configuration

func (*Config) String

func (c *Config) String() string

String returns string representation of Config data type

Jump to

Keyboard shortcuts

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