Documentation ¶
Index ¶
- func AdvertiseOSDF() error
- func CreateAdvertiseToken(namespace string) (string, error)
- func DownloadDB(localFile string) error
- func GetAdsForPath(reqPath string) (originNamespace NamespaceAd, originAds []ServerAd, cacheAds []ServerAd)
- func GetIssuerURL(prefix string) (string, error)
- func GetLatLong(addr netip.Addr) (lat float64, long float64, err error)
- func InitializeDB()
- func PeriodicCacheReload()
- func PeriodicMaxMindReload()
- func RecordAd(ad ServerAd, namespaceAds *[]NamespaceAd)
- func RedirectToCache(ginCtx *gin.Context)
- func RedirectToOrigin(ginCtx *gin.Context)
- func RegisterDirector(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)
- type CredentialGeneration
- type Namespace
- type NamespaceAd
- type NamespaceJSON
- type OriginAdvertise
- type Server
- type ServerAd
- type ServerType
- type StrategyType
- type SwapMap
- type SwapMaps
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateAdvertiseToken ¶
func DownloadDB ¶
func GetAdsForPath ¶
func GetAdsForPath(reqPath string) (originNamespace NamespaceAd, originAds []ServerAd, cacheAds []ServerAd)
func GetIssuerURL ¶
func InitializeDB ¶
func InitializeDB()
func PeriodicCacheReload ¶
func PeriodicCacheReload()
func PeriodicMaxMindReload ¶
func PeriodicMaxMindReload()
func RecordAd ¶
func RecordAd(ad ServerAd, namespaceAds *[]NamespaceAd)
func RedirectToCache ¶
func RedirectToOrigin ¶
func RegisterDirector ¶
func RegisterDirector(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
Types ¶
type CredentialGeneration ¶
type Namespace ¶
type Namespace struct { Caches []Server `json:"caches"` Origins []Server `json:"origins"` CredentialGeneration CredentialGeneration `json:"credential_generation"` DirlistHost string `json:"dirlisthost"` Path string `json:"path"` ReadHTTPS bool `json:"readhttps"` UseTokenOnRead bool `json:"usetokenonread"` WritebackHost string `json:"writebackhost"` }
type NamespaceAd ¶
type NamespaceJSON ¶
type OriginAdvertise ¶
type OriginAdvertise struct { Name string `json:"name"` URL string `json:"url"` Namespaces []NamespaceAd `json:"namespaces"` }
type ServerAd ¶
type ServerType ¶
type ServerType string
const ( CacheType ServerType = "Cache" OriginType ServerType = "Origin" )
type StrategyType ¶
type StrategyType string
const ( OAuthStrategy StrategyType = "OAuth2" VaultStrategy StrategyType = "Vault" )
Click to show internal directories.
Click to hide internal directories.