models

package
v0.0.0-...-21bfe33 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Custom

type Custom struct {
	Dataset    string   `json:"dataset"`
	Rse        string   `json:"rse"`
	Tier       string   `json:"tier"`
	RseCountry string   `json:"rseCountry"`
	RseKind    string   `json:"rseKind"`
	Accounts   []string `json:"accounts"`
	RseType    []string `json:"rseType"`
}

Custom represents custom fields that added for details page

type DTReqColumn

type DTReqColumn struct {
	Data       string      `json:"data"`       // Column name
	Name       string      `json:"name"`       // Column name to be used in page if it is different from source data
	Searchable bool        `json:"searchable"` //
	Orderable  bool        `json:"orderable"`  //
	Search     DTReqSearch `json:"search"`     // If client requested search against individual column
}

DTReqColumn represents client column selections like; sort order, search text for that column

type DTReqOrder

type DTReqOrder struct {
	Column int    `json:"column"`                       // Column index number in the columns list (order not changes)
	Dir    string `json:"dir" binding:"oneof=asc desc"` // asc or desc
}

DTReqOrder represents the selected column direction.

type DTReqSearch

type DTReqSearch struct {
	Regex bool   `json:"regex"`
	Value string `json:"value"`
}

DTReqSearch represents main search text which client entered and can be regex or not.

In default in this service, all search text will be behaved as "REGEX" instead of fuzzy search.
TODO separate regex and fuzzy search by providing option in the frontend

type DataSourceTS

type DataSourceTS struct {
	Id        primitive.ObjectID `bson:"_id"` // do not send in the json
	CreatedAt string             `bson:"created_at,omitempty" validate:"required"`
}

DataSourceTS struct contains data production time means; alas hadoop dumps time-stamp

type DataTableCustomRequest

type DataTableCustomRequest struct {
	Draw    int           `json:"draw" validate:"required" binding:"required"`    // Just a counter that should be return exactly in the response
	Columns []DTReqColumn `json:"columns" validate:"required" binding:"required"` // Includes user input for columns (like search text for the column)
	Length  int64         `json:"length"`                                         // Number of records that the table can display in the current draw.
	Orders  []DTReqOrder  `json:"order"`                                          //
	Search  DTReqSearch   `json:"search"`                                         //
	Start   int64         `json:"start"`                                          //
	Custom  Custom        `json:"custom"`                                         // Custom
}

DataTableCustomRequest customized ajax request that come from DataTable

type DataTableRequest

type DataTableRequest struct {
	Draw    int           `json:"draw" validate:"required" binding:"required"`    // Just a counter that should be return exactly in the response
	Columns []DTReqColumn `json:"columns" validate:"required" binding:"required"` // Includes user input for columns (like search text for the column)
	Length  int64         `json:"length"`                                         // Number of records that the table can display in the current draw.
	Orders  []DTReqOrder  `json:"order"`                                          //
	Search  DTReqSearch   `json:"search"`                                         //
	Start   int64         `json:"start"`                                          //
}

DataTableRequest main ajax request that come from DataTable, which includes user inputs

For full field descriptions, please see https://datatables.net/manual/server-side#Sent-parameters

type DataTableSearchBuilderRequest

type DataTableSearchBuilderRequest struct {
	Draw          int                  `json:"draw" validate:"required" binding:"required"`                     // Just a counter that should be return exactly in the response
	Columns       []DTReqColumn        `json:"columns" validate:"required" binding:"required"`                  // Includes user input for columns (like search text for the column)
	Length        int64                `json:"length"`                                                          // Number of records that the table can display in the current draw.
	Orders        []DTReqOrder         `json:"order"`                                                           //
	Search        DTReqSearch          `json:"search"`                                                          //
	Start         int64                `json:"start"`                                                           //
	SearchBuilder SearchBuilderRequest `json:"search_builder,omitempty" validate:"required" binding:"required"` // SearchBuilder
}

DataTableSearchBuilderRequest customized ajax request that come from DataTable

type Dataset

type Dataset struct {
	RseType      string  `bson:"RseType,omitempty" validate:"required"`
	Dataset      string  `bson:"Dataset,omitempty" validate:"required"`
	LastAccess   string  `bson:"LastAccess"`
	LastAccessMs int64   `bson:"LastAccessMs"`
	Max          float64 `bson:"Max"`
	Min          float64 `bson:"Min"`
	Avg          float64 `bson:"Avg"`
	Sum          float64 `bson:"Sum"`
	RSEs         string  `bson:"RSEs"`
}

Dataset struct which includes Rucio and DBS calculated values

type DatasetsResp

type DatasetsResp struct {
	Draw            int       `json:"draw" validate:"required"`            // The value that came in DataTable request, same should be returned
	RecordsTotal    int64     `json:"recordsTotal" validate:"required"`    // Total records which will be showed in the footer
	RecordsFiltered int64     `json:"recordsFiltered" validate:"required"` // Filtered record count which will be showed in the footer
	Data            []Dataset `json:"data" validate:"required"`            // Data itself that contains datasets
}

DatasetsResp datatable response struct. Full description https://datatables.net/manual/server-side#Returned-data

type DetailedDataset

type DetailedDataset struct {
	Type       string  `bson:"Type" validate:"required"`
	Dataset    string  `bson:"Dataset,omitempty" validate:"required"`
	RSE        string  `bson:"RSE,omitempty" validate:"required"`
	Tier       string  `bson:"Tier" validate:"required"`
	C          string  `bson:"C" validate:"required"` // Country
	RseKind    string  `bson:"RseKind" validate:"required"`
	SizeBytes  int64   `json:"SizeBytes"`
	LastAcc    string  `bson:"LastAcc"`    // Last access to dataset in ISO8601 format
	LastAccMs  int64   `bson:"LastAccMs"`  // Last access to dataset in unix ts
	Fpct       float64 `bson:"Fpct"`       // File percentage over total files of dataset definition
	Fcnt       int64   `bson:"Fcnt"`       // File count of the dataset in the RSE
	TotFcnt    int64   `bson:"TotFcnt"`    // File count of the dataset in definition
	AccFcnt    int64   `bson:"AccFcnt"`    // Accessed file count of dataset in the RSE
	ProdLckCnt int64   `bson:"ProdLckCnt"` // Count of files, locked by production accounts
	OthLckCnt  int64   `bson:"OthLckCnt"`  // Count of files, locked by non-production accounts
	ProdAccts  string  `bson:"ProdAccts"`  // Production accounts that locked the files
}

DetailedDataset struct which includes Rucio and DBS calculated values for detailed datasets info

type DetailedDatasetsResp

type DetailedDatasetsResp struct {
	Draw            int          `json:"draw" validate:"required"`            // The value that came in DataTable request, same should be returned
	RecordsTotal    int64        `json:"recordsTotal" validate:"required"`    // Total records which will be showed in the footer
	RecordsFiltered int64        `json:"recordsFiltered" validate:"required"` // Filtered record count which will be showed in the footer
	Data            []DetailedDs `json:"data" validate:"required"`            // Data itself that contains datasets
}

DetailedDatasetsResp datatable response struct.

type DetailedDs

type DetailedDs struct {
	Id         primitive.ObjectID `bson:"-" json:"-"` // do not send in the json
	Type       string             `bson:"Type,omitempty" validate:"required"`
	Dataset    string             `bson:"Dataset,omitempty" validate:"required"`
	RSE        string             `bson:"RSE,omitempty" validate:"required"`
	Tier       string             `bson:"Tier,omitempty" validate:"required"`
	C          string             `bson:"C,omitempty" validate:"required"` // Country
	RseKind    string             `bson:"RseKind,omitempty" validate:"required"`
	SizeBytes  int64              `json:"SizeBytes,omitempty"`
	LastAcc    string             `bson:"LastAcc"`    // Last access to dataset in ISO8601 format
	LastAccMs  int64              `bson:"LastAccMs"`  // Last access to dataset in unix ts
	Fpct       float64            `bson:"Fpct"`       // File percentage over total files of dataset definition
	Fcnt       int64              `bson:"Fcnt"`       // File count of the dataset in the RSE
	TotFcnt    int64              `bson:"TotFcnt"`    // File count of the dataset in definition
	AccFcnt    int64              `bson:"AccFcnt"`    // Accessed file count of dataset in the RSE
	ProdLckCnt int64              `bson:"ProdLckCnt"` // Count of files, locked by production accounts
	OthLckCnt  int64              `bson:"OthLckCnt"`  // Count of files, locked by non-production accounts
	ProdAccts  string             `bson:"ProdAccts"`  // Production accounts that locked the files
}

DetailedDs struct which includes Rucio and DBS calculated values for detailed datasets info

type SearchBuilderRequest

type SearchBuilderRequest struct {
	Criteria []SingleCriteria `json:"criteria"`
	// There are  "OR" and "AND" options.
	Logic string `json:"logic"`
}

SearchBuilderRequest datatables search builder request format

type ServerInfoResp

type ServerInfoResp struct {
	ServiceVersion string `json:"version"`
	Server         string `json:"server"`
}

ServerInfoResp custom response struct for service information

type ShortUrl

type ShortUrl struct {
	HashId     string                 `bson:"hash_id,omitempty" validate:"required"`
	Request    DataTableCustomRequest `bson:"dt_request,omitempty" validate:"required"`
	SavedState map[string]interface{} `bson:"saved_state"` // Saved state of datatables
}

ShortUrl struct is used for key:value couples of unique id and datatables request

type ShortUrlRequest

type ShortUrlRequest struct {
	Request    DataTableCustomRequest `json:"dt_request"`
	SavedState map[string]interface{} `json:"saved_state"`
}

type SingleCriteria

type SingleCriteria struct {
	// "contains" renamed as "regex" in the page and regex search will be applied
	Condition string `json:"condition"`
	// Column display name
	Data string `json:"data"`
	// Actual column name
	OrigData string `json:"origData"`
	// Data type that is comprehended by DT
	Type string `json:"type"`
	// List of user values
	Value []string `json:"value"`
}

SingleCriteria condition object of SearchBuilder

Ref: https://datatables.net/extensions/searchbuilder/examples/
Datatables search builder does not support GoLang backend, but here we're :)
We're catching the JSON of SB from .getDetails() function and use it for our needs.

type SingleDetailedDatasetsRequest

type SingleDetailedDatasetsRequest struct {
	Dataset string `json:"dataset" validate:"required" binding:"required"` // dataset name
	Type    string `json:"type" validate:"required" binding:"required"`    // RSE type name
}

SingleDetailedDatasetsRequest accepts dataset and its RSE type

Jump to

Keyboard shortcuts

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