origin

package
v0.0.0-...-1827884 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RegStatusNotSupported regStatusEnum = "Not Supported"      // Registry does not support this function
	RegCompleted          regStatusEnum = "Completed"          // Registration is completed
	RegIncomplete         regStatusEnum = "Incomplete"         // Registered, but registration is incomplete
	RegError              regStatusEnum = "Registration Error" // Failed to register
)

Variables

View Source
var RegistryNotImplErr = errors.New("the running version of the registry didn't implmenet this function")

Functions

func ConfigOriginTTLCache

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

func ConfigureXrootdMonitoringDir

func ConfigureXrootdMonitoringDir() error

Configure XrootD directory for both self-based and director-based file transfer tests

func FetchAndSetRegStatus

func FetchAndSetRegStatus(prefix string) error

Fetch the registration status, generate access token for editing the registration at the registry, and store the status to the TTL cache

func FetchRegStatus

func FetchRegStatus(prefixes []string) (*server_structs.CheckNamespaceCompleteRes, error)

Fetch the registration status for an array of namespace prefixes from the registry

func LaunchBrokerListener

func LaunchBrokerListener(ctx context.Context, egrp *errgroup.Group) (err error)

Launch goroutines that continuously poll the broker

func LaunchOriginFileTestMaintenance

func LaunchOriginFileTestMaintenance(ctx context.Context)

Remove tmp files under ${Origin_RunLocation}/export/pelican/monitoring from diector-based/self tests. There could be dangling files due to error in testing

func PeriodicSelfTest

func PeriodicSelfTest(ctx context.Context) error

Start self-test monitoring of the origin. This will upload, download, and delete a generated filename every 15 seconds to the local origin. On failure, it will set the xrootd component's status to critical.

func RegisterOriginAPI

func RegisterOriginAPI(router *gin.Engine, ctx context.Context, egrp *errgroup.Group) error

Configure API endpoints for origin that are not tied to UI

func RegisterOriginWebAPI

func RegisterOriginWebAPI(engine *gin.Engine)

func SetNamespacesStatus

func SetNamespacesStatus(key string, val RegistrationStatus, ttl time.Duration)

Types

type OriginServer

type OriginServer struct {
	server_structs.NamespaceHolder
	// contains filtered or unexported fields
}

func (*OriginServer) CreateAdvertisement

func (server *OriginServer) CreateAdvertisement(name string, originUrlStr string, originWebUrl string) (*server_structs.OriginAdvertiseV2, error)

func (*OriginServer) GetAuthorizedPrefixes

func (server *OriginServer) GetAuthorizedPrefixes() ([]string, error)

Return a list of paths where the origin's issuer is authoritative.

Used to calculate the base_paths in the scitokens.cfg, for eaxmple

func (*OriginServer) GetNamespaceAdsFromDirector

func (server *OriginServer) GetNamespaceAdsFromDirector() error

func (*OriginServer) GetPids

func (server *OriginServer) GetPids() (pids []int)

func (*OriginServer) GetServerType

func (server *OriginServer) GetServerType() config.ServerType

func (*OriginServer) SetPids

func (server *OriginServer) SetPids(pids []int)

type RegistrationStatus

type RegistrationStatus struct {
	Status  regStatusEnum
	EditUrl string
	Msg     string
}

For TTL cache to keep track of namespace registration status

Jump to

Keyboard shortcuts

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