Documentation ¶
Index ¶
- func AdvertiseOSDF() error
- func ConfigTTLCache(ctx context.Context, wg *sync.WaitGroup)
- func CreateAdvertiseToken(namespace string) (string, error)
- func CreateDirectorSDToken() (string, error)
- func CreateDirectorScrapeToken() (string, error)
- func CreateDirectorTestReportToken(originWebUrl string) (string, error)
- func DiscoverOrigins(ctx *gin.Context)
- func DownloadDB(localFile string) error
- func GetAdsForPath(reqPath string) (originNamespace NamespaceAd, originAds []ServerAd, cacheAds []ServerAd)
- func GetLatLong(addr netip.Addr) (lat float64, long float64, err error)
- func GetRegistryIssuerURL(prefix string) (string, error)
- func InitializeDB()
- func ListNamespaces(ctx *gin.Context)
- func PeriodicCacheReload()
- func PeriodicDirectorTest(ctx context.Context, originAd ServerAd)
- func PeriodicMaxMindReload()
- func RecordAd(ad ServerAd, namespaceAds *[]NamespaceAd)
- func RedirectToCache(ginCtx *gin.Context)
- func RedirectToOrigin(ginCtx *gin.Context)
- func RegisterCache(ctx *gin.Context)
- func RegisterDirector(router *gin.RouterGroup)
- func RegisterDirectorAuth(router *gin.RouterGroup)
- func RegisterDirectorWebAPI(router *gin.RouterGroup)
- func RegisterOrigin(ctx *gin.Context)
- func ShortcutMiddleware(defaultResponse string) gin.HandlerFunc
- func UpdateLatLong(ad *ServerAd) error
- func VerifyAdvertiseToken(token, namespace string) (bool, error)
- func VerifyDirectorSDToken(strToken string) (bool, error)
- func VerifyDirectorTestReportToken(strToken string) (bool, error)
- type DirectorTest
- type DiscoveryResponse
- type NamespaceAd
- type NamespaceCache
- type OriginAdvertise
- type PromDiscoveryItem
- type ServerAd
- type ServerType
- type StrategyType
- type SwapMap
- type SwapMaps
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigTTLCache ¶ added in v1.0.4
Configure TTL caches to enable cache eviction and other additional cache events handling logic
The `ctx` is the context for listening to server shutdown event in order to cleanup internal cache eviction goroutine and `wg` is the wait group to notify when the clean up goroutine finishes
func CreateAdvertiseToken ¶
func CreateDirectorSDToken ¶ added in v1.0.4
Create a token for director's Prometheus instance to access director's origins service discovery endpoint. This function is intended to be called only on a director server
func CreateDirectorScrapeToken ¶ added in v1.0.4
Create a token for director's Prometheus scraper to access discovered origins /metrics endpoint. This function is intended to be called on a director server
func CreateDirectorTestReportToken ¶ added in v1.0.4
Create a token for director to report the health status to the origin
func DiscoverOrigins ¶ added in v1.0.4
Return a list of available origins URL in Prometheus HTTP SD format for director's Prometheus service discovery
func DownloadDB ¶
func GetAdsForPath ¶
func GetAdsForPath(reqPath string) (originNamespace NamespaceAd, originAds []ServerAd, cacheAds []ServerAd)
func GetRegistryIssuerURL ¶ added in v1.0.4
func InitializeDB ¶
func InitializeDB()
func ListNamespaces ¶ added in v1.0.4
func PeriodicCacheReload ¶
func PeriodicCacheReload()
func PeriodicDirectorTest ¶ added in v1.0.4
Run a periodic test file transfer against an origin to ensure it's talking to the director
func PeriodicMaxMindReload ¶
func PeriodicMaxMindReload()
func RecordAd ¶
func RecordAd(ad ServerAd, namespaceAds *[]NamespaceAd)
func RedirectToCache ¶
func RedirectToOrigin ¶
func RegisterCache ¶ added in v1.0.4
func RegisterDirector ¶
func RegisterDirector(router *gin.RouterGroup)
func RegisterDirectorAuth ¶ added in v1.0.4
func RegisterDirectorAuth(router *gin.RouterGroup)
func RegisterDirectorWebAPI ¶ added in v1.0.4
func RegisterDirectorWebAPI(router *gin.RouterGroup)
func RegisterOrigin ¶
func ShortcutMiddleware ¶
func ShortcutMiddleware(defaultResponse string) gin.HandlerFunc
Middleware sends GET /foo/bar to the RedirectToCache function, as if the original request had been made to /api/v1.0/director/object/foo/bar
func UpdateLatLong ¶
func VerifyAdvertiseToken ¶
Given a token and a location in the namespace to advertise in, see if the entity is authorized to advertise an origin for the namespace
func VerifyDirectorSDToken ¶ added in v1.0.4
Verify that a token received is a valid token from director and has correct scope for accessing the service discovery endpoint. This function is intended to be called on the same director server that issues the token.
func VerifyDirectorTestReportToken ¶ added in v1.0.4
Verify that a token received is a valid token from director
Types ¶
type DirectorTest ¶ added in v1.0.4
type DiscoveryResponse ¶ added in v1.0.4
type NamespaceAd ¶
type NamespaceAd struct { RequireToken bool `json:"requireToken"` Path string `json:"path"` Issuer url.URL `json:"url"` MaxScopeDepth uint `json:"maxScopeDepth"` Strategy StrategyType `json:"strategy"` BasePath string `json:"basePath"` VaultServer string `json:"vaultServer"` DirlistHost string `json:"dirlisthost"` }
func ListNamespacesFromOrigins ¶ added in v1.0.4
func ListNamespacesFromOrigins() []NamespaceAd
List all namespaces from origins registered at the director
type NamespaceCache ¶ added in v1.0.4
type NamespaceCache interface { Register(u string, options ...jwk.RegisterOption) error Get(ctx context.Context, u string) (jwk.Set, error) }
Create interface Add it to namespacekeys in place of jwk.cache
type OriginAdvertise ¶
type OriginAdvertise struct { Name string `json:"name"` URL string `json:"url"` // This is the url for origin's XRootD service and file transfer WebURL string `json:"web_url,omitempty"` // This is the url for origin's web engine and APIs Namespaces []NamespaceAd `json:"namespaces"` }
type PromDiscoveryItem ¶ added in v1.0.4
type ServerAd ¶
type ServerAd struct { Name string AuthURL url.URL URL url.URL // This is server's XRootD URL for file transfer WebURL url.URL // This is server's Web interface and API Type ServerType Latitude float64 Longitude float64 }
func ListServerAds ¶ added in v1.0.4
func ListServerAds(serverTypes []ServerType) []ServerAd
List all serverAds in the cache that matches the serverType array
type ServerType ¶
type ServerType string
const ( CacheType ServerType = "Cache" OriginType ServerType = "Origin" )
type StrategyType ¶
type StrategyType string
const ( OAuthStrategy StrategyType = "OAuth2" VaultStrategy StrategyType = "Vault" )