namespaces

package
v0.0.0-...-3d74421 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package namespaces implements namespace lookups and matches for legacy stashcp and osdf-client to maintain backward compatibility.

The namespaces package should not be used for any new features Pelican introduces.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	AuthEndpoint string `json:"auth_endpoint"`
	Endpoint     string `json:"endpoint"`
	Resource     string `json:"resource"`
}

Cache

type CredentialGeneration

type CredentialGeneration struct {
	Issuer        *string `json:"issuer"`
	BasePath      *string `json:"base_path"`
	MaxScopeDepth *int    `json:"max_scope_depth"`
	Strategy      *string `json:"strategy"`
	VaultServer   *string `json:"vault_server"`
}

Credential generation information

type DirectorCache

type DirectorCache struct {
	ResourceName string
	EndpointUrl  string
	Priority     int
	AuthedReq    bool
}

Cache information from the Director service

type Namespace

type Namespace struct {
	Caches               []Cache `json:"caches"`
	SortedDirectorCaches []DirectorCache
	Path                 string                `json:"path"`
	CredentialGen        *CredentialGeneration `json:"credential_generation"`
	Issuer               []string              `json:"issuer"`
	ReadHTTPS            bool                  `json:"readhttps"`
	UseTokenOnRead       bool                  `json:"usetokenonread"`
	WriteBackHost        string                `json:"writebackhost"`
	DirListHost          string                `json:"dirlisthost"`
}

Namespace holds the structure of stash namespaces

func GetNamespaces

func GetNamespaces(ctx context.Context) ([]Namespace, error)

GetNamespaces returns the list of namespaces

func MatchNamespace

func MatchNamespace(ctx context.Context, path string) (Namespace, error)

MatchNamespace matches the namespace passed in to the namespaces in the list

func (*Namespace) GetCacheHosts

func (ns *Namespace) GetCacheHosts() []string

func (*Namespace) GetCaches

func (ns *Namespace) GetCaches() []Cache

GetCaches returns the list of caches for the namespace

func (*Namespace) MatchCaches

func (ns *Namespace) MatchCaches(caches []string) []Cache

MatchCaches compares the caches passed in (presumably from an ordered list of caches) to the caches for the namespace, and returns the intersection of the two

type NamespaceFull

type NamespaceFull struct {
	Caches     []Cache     `json:"caches"`
	Namespaces []Namespace `json:"namespaces"`
}

Jump to

Keyboard shortcuts

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