director

package
v0.0.0-...-c116fac Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 46 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ParameterError       = errors.New("Invalid parameter, max_responses must be larger than min_responses")
	NoPrefixMatchError   = errors.New("No namespace prefixes match found")
	InsufficientResError = errors.New("Number of success responses is less than MinStatResponse required.")
)

Functions

func AdvertiseOSDF

func AdvertiseOSDF() error

Populate internal cache with origin/cache ads

func ConfigFilterdServers

func ConfigFilterdServers()

Populate internal filteredServers map by Director.FilteredServers

func ConfigTTLCache added in v1.0.4

func ConfigTTLCache(ctx context.Context, egrp *errgroup.Group)

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 InitializeDB

func InitializeDB(ctx context.Context)

func LaunchPeriodicDirectorTest

func LaunchPeriodicDirectorTest(ctx context.Context, serverAd server_structs.ServerAd)

Run a periodic test file transfer against an origin to ensure it's talking to the director

func PeriodicCacheReload

func PeriodicCacheReload(ctx context.Context)

func RegisterDirectorAPI

func RegisterDirectorAPI(ctx context.Context, router *gin.RouterGroup)

func RegisterDirectorOIDCAPI

func RegisterDirectorOIDCAPI(router *gin.RouterGroup)

func RegisterDirectorWebAPI added in v1.0.4

func RegisterDirectorWebAPI(router *gin.RouterGroup)

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

Types

type Coordinate

type Coordinate struct {
	Lat  float64 `mapstructure:"lat"`
	Long float64 `mapstructure:"long"`
}

type GeoIPOverride

type GeoIPOverride struct {
	IP         string     `mapstructure:"IP"`
	Coordinate Coordinate `mapstructure:"Coordinate"`
}

type HealthTestStatus

type HealthTestStatus string

status of director-based health tests to origins and caches

const (
	HealthStatusUnknown HealthTestStatus = "Unknown"
	HealthStatusInit    HealthTestStatus = "Initializing"
	HealthStatusOK      HealthTestStatus = "OK"
	HealthStatusError   HealthTestStatus = "Error"
)

type ObjectStat

type ObjectStat struct {
	ReqHandler func(objectName string, dataUrl url.URL, timeout time.Duration, maxCancelCtx context.Context) (*objectMetadata, error)
	Query      func(objectName string, cancelContext context.Context, mininum, maximum int) ([]*objectMetadata, string, error)
}

A struct to implement `object stat`, by querying against origins with namespaces match the prefix of an object name and return origins that have the object

func NewObjectStat

func NewObjectStat() *ObjectStat

Initialize a new stat instance and set default method implementations

type PromDiscoveryItem added in v1.0.4

type PromDiscoveryItem struct {
	Targets []string          `json:"targets"`
	Labels  map[string]string `json:"labels"`
}

Prometheus HTTP discovery endpoint struct, used by director to dynamically return available origin/cache servers for Prometheus to scrape

type SwapMap

type SwapMap struct {
	Distance float64
	Index    int
}

type SwapMaps

type SwapMaps []SwapMap

func (SwapMaps) Len

func (me SwapMaps) Len() int

func (SwapMaps) Less

func (me SwapMaps) Less(left, right int) bool

func (SwapMaps) Swap

func (me SwapMaps) Swap(left, right int)

Jump to

Keyboard shortcuts

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