Documentation
¶
Index ¶
- func Info() string
- type AIChat
- type Authz
- type CHESSMetaData
- type DID
- type DOI
- type DataBookkeeping
- type DataManagement
- type Datacite
- type Discovery
- type Embed
- type Encryption
- type FS
- type Frontend
- type GinOptions
- type Globus
- type Kerberos
- type LDAP
- type ML
- type MLApi
- type MLBackend
- type MLHub
- type MaterialsCommons
- type MetaData
- type MongoDB
- type OAuthRecord
- type OpenTelemetry
- type OreCastMetaData
- type Publication
- type QL
- type S3
- type Services
- type SpecScans
- type SrvConfig
- type Sync
- type TrustedUser
- type WebServer
- type Zenodo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AIChat ¶ added in v0.7.5
type AIChat struct { Host string `mapstructure:"host"` Port int `mapstructure:"port"` Model string `mapstructure:"model"` }
AIChat configuration
type Authz ¶
type Authz struct { WebServer `mapstructure:"WebServer"` Encryption `mapstructure:"Encryption"` TestMode bool `mapstructure:"TestMode"` // test mode CheckLDAP bool `mapstructure:"CheckLDAP"` // check users scope in LDAP DBFile string `mapstructure:"DBFile"` ClientID string `mapstructure:"ClientId"` ClientSecret string `mapstructure:"ClientSecret"` Domain string `mapstructure:"Domain"` TokenExpires int64 `mapstructure:"TokenExpires"` // token expiration in seconds }
Authz represents authz service configuration
type CHESSMetaData ¶
type CHESSMetaData struct { WebServer `mapstructure:"WebServer"` MongoDB `mapstructure:"MongoDB"` SchemaRenewInterval int `mapstructure:"SchemaRenewInterval"` // schema renew interval WebSectionsFile string `mapstructure:"WebSectionsFile"` // file for web form sections LexiconFile string `mapstructure:"LexiconFile"` // lexicon file TestMode bool `mapstructure:"TestMode"` // test mode DataLocationAttributes []string `mapstructure:"DataLocationAttributes"` // data location attributes to use SchemaFiles []string `mapstructure:"SchemaFiles"` // schema files OrderedSections []string `mapstructure:"OrderedSections"` // ordered sections for web UI SkipKeys []string `mapstructure:"SkipKeys"` // keys to skip for web forms SpecScanBeamlines []string `mapstructure:"SpecScanBeamlines"` // list of beamlines that uses spec scan service }
CHESSMetaData represents CHESS MetaData configuration
type DID ¶ added in v0.1.6
type DID struct { Attributes string `mapstructure:"attributes"` // did attributes, comma separated, default beamline,btr,cycle,sample Separator string `mapstructure:"separator"` // did separator, default "/" Divider string `mapstructure:"divider"` // did key-value divider, default "=" }
DID structure
type DOI ¶ added in v0.4.1
type DOI struct { Provider string `mapstructure:"Provider"` // doi provider, e.g. Zenodo or MaterialsCommons ProjectName string `mapstructure:"ProjectName"` // name of the project (only valid for MaterialsCommons) Zenodo Zenodo `mapstructure:"Zenodo"` Datacite Datacite `mapstructure:"Datacite"` MaterialsCommons MaterialsCommons `mapstructure:"MaterialsCommons"` WebServer }
DOI attributes
type DataBookkeeping ¶
type DataBookkeeping struct { WebServer `mapstructure:"WebServer"` DBFile string `mapstructure:"DBFile"` // dbs db file with secrets LexiconFile string `mapstructure:"LexiconFile"` // dbs lexicon file MaxDBConnections int `mapstructure:"MaxDbConnections"` // maximum number of DB connections MaxIdleConnections int `mapstructure:"MaxIdleConnections"` // maximum number of idle connections }
DataBookkeeping represents data-bookkeeping service configuration
type DataManagement ¶
type DataManagement struct { S3 FS FileExtensions []string `mapstructure:"FileExtensions"` WebServer `mapstructure:"WebServer"` }
DataManagement represents data-management service configuration
type Datacite ¶ added in v0.6.1
type Datacite struct { Url string `mapstructure:"Url"` AccessToken string `mapstructure:"AccessToken"` AccessKey string `mapstructure:"AccessKey"` AccessSecret string `mapstructure:"AccessSecret"` Username string `mapstructure:"Username"` Password string `mapstructure:"Password"` Prefix string `mapstructure:"Prefix"` }
Datacite represents Datacite service configuration
type Discovery ¶
type Discovery struct { WebServer `mapstructure:"WebServer"` MongoDB `mapstructure:"MongoDB"` Encryption `mapstructure:"Encryption"` }
Discovery represents discovery service configuration
type Encryption ¶
type Encryption struct { Secret string `mapstructure:"Secret"` Cipher string `mapstructure:"Cipher"` }
Encryption represents encryption configuration parameters
type FS ¶ added in v0.6.8
type FS struct { Name string `mapstructure:"Name"` Kind string `mapstructure:"Kind"` Storage string `mapstructure:"Storage"` }
FS defines FileSystem backend
type Frontend ¶
type Frontend struct { WebServer `mapstructure:"WebServer"` // Aggregate results from all FOXDEN services AggregateResults bool `mapstructure:"AggregateResults` // OAuth parts OAuth []OAuthRecord `mapstructure:"OAuth"` // oauth configurations // captcha parts CaptchaSecretKey string `mapstructure:"CaptchaSecretKey"` // re-captcha secret key CaptchaPublicKey string `mapstructure:"CaptchaPublicKey"` // re-captcha public key CaptchaVerifyUrl string `mapstructure:"CaptchaVerifyUrl"` // re-captcha verify url // cookies parts UserCookieExpires int64 `mapstructure:"UserCookieExpires"` // expiration of user cookie // other options TestMode bool `mapstructure:"TestMode"` // test mode CheckBtrs bool `mapstructure:"CheckBtrs"` // enable check for CHESS btrs CheckAdmins bool `mapstructure:"CheckAdmins"` // enable check for FOXDEN admins AllowAllRecords bool `mapstructure:"AllowAllRecords"` // allow all records to be seen DefaultEndPoint string `mapstructure:"DefaultEndPoint"` DocUrl string `mapstructure:"DocUrl"` // documentation url }
Frontend stores frontend configuration parameters
type GinOptions ¶
type GinOptions struct { DisableConsoleColor bool `mapstructure:"DisableConsoleColor"` // gin console color mode Production bool `mapstructure:"Production"` // production mode Mode string `mapstructure:"Mode"` // gin mode: test, debug, release }
GinOptions controls go-gin specific options
type Globus ¶ added in v0.3.9
type Globus struct { ClientID string `mapstructure:"client_id"` // client id ClientSecret string `mapstructure:"client_secret"` // client secret TransferURL string `mapstructure:"transfer_url"` // globus transfer url AuthURL string `mapstructure:"auth_url"` // globus auth url OriginID string `mapstructure:"origin_id"` // globus origin ID for CHESS Raw data collection }
Globug represents globus information
type Kerberos ¶
type Kerberos struct { Krb5Conf string `mapstructure:"Krb5Conf"` Keytab string `mapstructure:"Keytab"` Realm string `mapstructure:"Realm"` }
Kerberos defines kerberos optinos
type LDAP ¶ added in v0.2.0
type LDAP struct { URL string `mapstructure:"url"` // ldap url BaseDN string `mapstructure:"baseDN` // ldap baseDN Login string `mapstructure:"login"` // LDAP login to use Password string `mapstructure:"password"` // LDAP password to use Expire int `mapstructure:"expire"` // LDAP cache record expire (in seconds) }
LDAP attributes
type ML ¶ added in v0.1.0
type ML struct { MLBackends []MLBackend `mapstructure:"MLBackends"` // ML backends StorageDir string `mapstructure:"StorageDir"` }
ML defines ML configuration options
type MLApi ¶ added in v0.1.0
type MLApi struct { Name string `mapstructure:"name"` Method string `mapstructure:"method"` Endpoint string `mapstructure:"endpoint"` Accept string `mapstructure:"accept"` }
MLAPI defines ML API structure
type MLBackend ¶ added in v0.1.0
type MLBackend struct { Name string `mapstructure:"name"` // ML backend name, e.g. TFaaS Type string `mapstructure:"type"` // ML backebd type, e.g. TensorFlow URI string `mapstructure:"uri"` // ML backend URI, e.g. http://localhost:port Apis []MLApi // ML APIs }
MLBackend represents ML backend engine
type MLHub ¶ added in v0.1.0
type MLHub struct { WebServer `mapstructure:"WebServer"` MongoDB `mapstructure:"MongoDB"` Encryption `mapstructure:"Encryption"` ML `mapstructure:"ML"` }
MLHub represents ML service configuration
type MaterialsCommons ¶ added in v0.6.1
type MaterialsCommons struct { Url string `mapstructure:"Url"` AccessToken string `mapstructure:"AccessToken"` ProjectName string `mapstructure:"ProjectName"` // name of the project (only valid for MaterialsCommons) }
MaterialsCommons represents MaterialsCommons service configuration
type MetaData ¶
type MetaData struct { WebServer `mapstructure:"WebServer"` MongoDB `mapstructure:"MongoDB"` LexiconFile string `mapstructure:"LexiconFile"` // lexicon file DataLocationAttributes []string `mapstructure:"DataLocationAttributes"` // data location attributes to use }
MetaData represents metadata service configuration
type MongoDB ¶
type MongoDB struct { DBName string `mapstructure:"DBName"` // database name DBColl string `mapstructure:"DBColl"` // database collection DBUri string `mapstructure:"DBUri"` // database URI }
MongoDB represents MongoDB parameters
type OAuthRecord ¶
type OAuthRecord struct { Provider string `mapstructure:"Provider"` // name of the provider ClientID string `mapstructure:"ClientId"` // client id ClientSecret string `mapstructure:"ClientSecret"` // client secret RedirectURL string `mapstructure:"RedirectUrl"` // redirect url }
OAuthRecord defines OAuth provider's credentials
type OpenTelemetry ¶ added in v0.7.5
type OpenTelemetry struct { ServiceName string `mapstructure:"ServiceName"` JaegerEndpoint string `mapstructure:"JaegerEndpoint"` OTLPEndpoint string `mapstructure:"OtlpEndpoint"` EnableStdout bool `mapstructure:"EnableStdout"` }
OpenTelemetry configuration
type OreCastMetaData ¶
type OreCastMetaData struct { WebServer `mapstructure:"WebServer"` MongoDB `mapstructure:"MongoDB"` }
OreCastMetaData represents OreCast MetaData configuration
type Publication ¶ added in v0.1.2
type Publication struct {
WebServer `mapstructure:"WebServer"`
}
Publication represents Publication service configuration
type QL ¶ added in v0.2.1
type QL struct { ServiceMapFile string `mapstructure:"ServiceMapFile"` // service map file name Separator string `mapstructure:"separator"` // ql separator, default ":" Verbose int `mapstructure:"verbose"` // verbosity level }
QL structure
type S3 ¶ added in v0.0.9
type S3 struct { Name string `mapstructure:"Name"` AccessKey string `mapstructure:"AccessKey"` AccessSecret string `mapstructure:"AccessSecret"` Endpoint string `mapstructure:"Endpoint"` UseSSL bool `mapstructure:"UseSSL"` Region string `mapstructure:"region"` }
S3 defines s3 structure
type Services ¶
type Services struct { FrontendURL string `mapstructure:"FrontendUrl"` DiscoveryURL string `mapstructure:"DiscoveryUrl"` MetaDataURL string `mapstructure:"MetaDataUrl"` MLHubURL string `mapstructure:"MLHubUrl"` DataManagementURL string `mapstructure:"DataManagementUrl"` DataBookkeepingURL string `mapstructure:"DataBookkeepingUrl"` AuthzURL string `mapstructure:"AuthzUrl"` SpecScansURL string `mapstructure:"SpecScansUrl"` PublicationURL string `mapstructure:"PublicationUrl"` CHAPBookURL string `mapstructure:"CHAPBookUrl"` DOIServiceURL string `mapstructure:"DOIServiceUrl"` SyncServiceURL string `mapstructure:"SyncServiceUrl"` }
Services represents services structure
type SpecScans ¶ added in v0.1.0
type SpecScans struct { WebServer `mapstructure:"WebServer"` MongoDB `mapstructure:"MongoDB"` DBFile string `mapstructure:"DBFile"` SchemaFile string `mapstructure:"SchemaFile"` }
SpecScans represents SpecScansService configuration
type SrvConfig ¶
type SrvConfig struct { AIChat `mapstructure:"AIChat"` S3 `mapstructure:"S3"` QL `mapstructure:"QL"` DID `mapstructure:"DID"` LDAP `mapstructure:LDAP` Frontend `mapstructure:"Frontend"` Discovery `mapstructure:"Discovery"` MetaData `mapstructure:"MetaData"` MLHub `mapstructure:"MLHub"` DataManagement `mapstructure:"DataManagement"` DataBookkeeping `mapstructure:"DataBookkeeping"` Authz `mapstructure:"Authz"` Kerberos `mapstructure:"Kerberos"` Services `mapstructure:"Services"` Encryption `mapstructure:"Encryption"` CHESSMetaData `mapstructure:"CHESSMetaData"` OreCastMetaData `mapstructure:"OreCastMetaData"` SpecScans `mapstructure:"SpecScansService"` Publication `mapstructure:"PublicationService"` Globus `mapstructure:"Globus"` DOI `mapstructure:"DOI"` Sync `mapstructure:"Sync"` Embed `mapstructure:"Embed"` OpenTelemetry `mapstructure:"OpenTelemetry"` TrustedUsers []TrustedUser `mapstructure:"TrustedUsers"` }
SrvConfig represents configuration structure
var Config *SrvConfig
Config represents configuration instance object
func ParseConfig ¶
ParseConfig provides method to parse given configuration file
type TrustedUser ¶ added in v0.3.5
type TrustedUser struct { User string `mapstructure:"user"` IP string `mapstructure:"ip"` MAC string `mapstructure:"mac"` }
TrustedUser represents single trusted user information
type WebServer ¶
type WebServer struct { // git server options GinOptions `mapstructure:"GinOptions"` // basic options Port int `mapstructure:"Port"` // server port number Verbose int `mapstructure:"Verbose"` // verbose output Base string `mapstructure:"Base"` // base URL StaticDir string `mapstructure:"StaticDir"` // specify static dir location LogFile string `mapstructure:"LogFile"` // server log file LogLongFile bool `mapstructure:"LogLongFile"` // server log structure // middleware server parts LimiterPeriod string `mapstructure:"Rate"` // limiter rate value LimiterHeader string `mapstructure:"limiter_header"` // limiter header to use LimiterSkipList []string `mapstructure:"limiter_skip_list"` // limiter skip list MetricsPrefix string `mapstructure:"metrics_prefix"` // metrics prefix used for Prometheus // etag options Etag string `mapstructure:"etag"` // etag value to use for ETag generation CacheControl string `mapstructure:"cache_control"` // Cache-Control value, e.g. max-age=300 // proxy parts XForwardedHost string `mapstructure:"X-Forwarded-Host"` // X-Forwarded-Host field of HTTP request XContentTypeOptions string `mapstructure:"X-Content-Type-Options"` // X-Content-Type-Options option // TLS server parts RootCAs string `mapstructure:"RootCAs"` // server Root CAs path ServerCrt string `mapstructure:"ServerCert"` // server certificate ServerKey string `mapstructure:"ServerKey"` // server certificate DomainNames []string `mapstructure:"DomainNames"` // LetsEncrypt domain names }
WebServer represents common web server configuration