Documentation
¶
Index ¶
- func AuthzListToMap(paths []string) map[string][]string
- func AuthzMapFromScope(org, project string) map[string][]string
- func AuthzMapToList(authzMap map[string][]string) []string
- func BuildDrsObjWithPrefix(fileName string, checksum string, size int64, drsId string, bucket string, ...) (*drsapi.DrsObject, error)
- func ConvertToCandidate(obj *drsapi.DrsObject) drsapi.DrsObjectCandidate
- func DrsUUID(org, project, hash string) string
- func NormalizeChecksum(raw string) string
- func NormalizeOid(oid string) string
- func ResourcePath(org, project string) (string, error)
- func StoragePrefix(org, project string) string
- type ObjectBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthzListToMap ¶
AuthzListToMap converts a list of GA4GH resource-path strings (e.g. "/programs/org/projects/proj") to the wire-format org→projects map.
func AuthzMapFromScope ¶
AuthzMapFromScope builds the wire-format authorizations map from an org and project. Empty project means org-wide access (value is empty slice).
func AuthzMapToList ¶
AuthzMapToList converts the wire-format org→projects map back to a list of GA4GH resource-path strings for internal storage.
func BuildDrsObjWithPrefix ¶
func BuildDrsObjWithPrefix(fileName string, checksum string, size int64, drsId string, bucket string, org string, project string, prefix string) (*drsapi.DrsObject, error)
BuildDrsObjWithPrefix builds a DRS object with an S3 access URL derived from the provided bucket, org, project, and storage prefix.
func ConvertToCandidate ¶
func ConvertToCandidate(obj *drsapi.DrsObject) drsapi.DrsObjectCandidate
ConvertToCandidate converts a DRS object to a registration candidate, stripping server-assigned fields (Id, SelfUri, timestamps).
func NormalizeChecksum ¶
NormalizeChecksum trims whitespace and an optional sha256: prefix.
func NormalizeOid ¶
NormalizeOid strips an optional "sha256:" prefix, lowercases, and validates that the result is a 64-character hex string. Returns "" for invalid input.
func ResourcePath ¶
ResourcePath returns the GA4GH resource path for an org/project scope, e.g. "/programs/myorg/projects/myproject".
func StoragePrefix ¶
StoragePrefix returns the storage path prefix for an org/project scope (no leading slash), e.g. "programs/myorg/projects/myproject".
Types ¶
type ObjectBuilder ¶
type ObjectBuilder struct {
Bucket string
Project string
Organization string
StoragePrefix string
PathStyle string
}
ObjectBuilder constructs DRS objects for a given bucket and project scope.
func NewObjectBuilder ¶
func NewObjectBuilder(bucket, project string) ObjectBuilder
NewObjectBuilder creates an ObjectBuilder for the given bucket and project.