models

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TransferEventAccessIssued = "access_issued"

	ProviderTransferDirectionDownload = "download"
	ProviderTransferDirectionUpload   = "upload"

	ProviderTransferMatched   = "matched"
	ProviderTransferAmbiguous = "ambiguous"
	ProviderTransferUnmatched = "unmatched"
)
View Source
const (
	ProviderTransferSyncPending   = "pending"
	ProviderTransferSyncCompleted = "completed"
	ProviderTransferSyncFailed    = "failed"
)

Variables

This section is empty.

Functions

func AuthPathMapToAuthorizations added in v0.2.5

func AuthPathMapToAuthorizations(auth AuthPathMap) map[string][]string

Types

type AccessGrant added in v0.2.6

type AccessGrant struct {
	AccessGrantID string
	FirstIssuedAt time.Time
	LastIssuedAt  time.Time
	IssueCount    int64
	ObjectID      string
	SHA256        string
	ObjectSize    int64
	Organization  string
	Project       string
	AccessID      string
	Provider      string
	Bucket        string
	StorageURL    string
	ActorEmail    string
	ActorSubject  string
	AuthMode      string
}

AccessGrant captures the canonical billing identity for a signed/direct storage access authorization. Repeated access issuance events for the same object/scope/storage URL should point at one grant.

type AuthPathMap added in v0.2.5

type AuthPathMap map[string]map[string][]string

type BucketScope

type BucketScope struct {
	Organization string `db:"organization"`
	ProjectID    string `db:"project_id"`
	Bucket       string `db:"bucket"`
	PathPrefix   string `db:"path_prefix"`
}

type DrsObjectRecord

type DrsObjectRecord struct {
	ID          string
	Size        int64
	CreatedTime time.Time
	UpdatedTime time.Time
	Name        string
	Version     string
	Description string
}

DrsObjectRecord mirrors the subset of drs_object columns returned by storage queries.

type DrsObjectWithAuthz

type DrsObjectWithAuthz = InternalObject

DrsObjectWithAuthz is an alias for InternalObject retained for older Go call sites.

type FileUsage

type FileUsage struct {
	ObjectID         string
	Name             string
	Size             int64
	UploadCount      int64
	DownloadCount    int64
	LastUploadTime   *time.Time
	LastDownloadTime *time.Time
	LastAccessTime   *time.Time
}

FileUsage captures per-object transfer activity that can drive lifecycle policies.

type FileUsageSummary

type FileUsageSummary struct {
	TotalFiles        int64
	TotalUploads      int64
	TotalDownloads    int64
	InactiveFileCount int64
}

FileUsageSummary aggregates transfer activity for a set of objects.

type InternalObject

type InternalObject struct {
	drs.DrsObject
	Auth           AuthPathMap            `json:"auth,omitempty"`
	Authorizations map[string][]string    `json:"-"`
	Properties     map[string]interface{} `json:"-"`
}

InternalObject is the primary DRS domain model. It wraps the GA4GH DrsObject and adds Syfon-specific authorization metadata.

func (InternalObject) External

func (o InternalObject) External() drs.DrsObject

func (InternalObject) MarshalJSON

func (o InternalObject) MarshalJSON() ([]byte, error)

func (*InternalObject) UnmarshalJSON

func (o *InternalObject) UnmarshalJSON(data []byte) error

type PendingLFSMeta

type PendingLFSMeta struct {
	OID       string
	Candidate drs.DrsObjectCandidate
	CreatedAt time.Time
	ExpiresAt time.Time
}

PendingLFSMeta stores a staged LFS metadata packet keyed by object checksum. It is submitted before transfer and consumed at verify-time.

type ProviderTransferEvent added in v0.2.5

type ProviderTransferEvent struct {
	ProviderEventID      string
	AccessGrantID        string
	Direction            string
	EventTime            time.Time
	RequestID            string
	ProviderRequestID    string
	ObjectID             string
	SHA256               string
	ObjectSize           int64
	Organization         string
	Project              string
	AccessID             string
	Provider             string
	Bucket               string
	ObjectKey            string
	StorageURL           string
	RangeStart           *int64
	RangeEnd             *int64
	BytesTransferred     int64
	HTTPMethod           string
	HTTPStatus           int
	RequesterPrincipal   string
	SourceIP             string
	UserAgent            string
	RawEventRef          string
	ActorEmail           string
	ActorSubject         string
	AuthMode             string
	ReconciliationStatus string
}

ProviderTransferEvent captures provider-observed transfer bytes for billing.

type ProviderTransferSyncRun added in v0.2.5

type ProviderTransferSyncRun struct {
	SyncID          string     `json:"sync_id"`
	Provider        string     `json:"provider"`
	Bucket          string     `json:"bucket"`
	Organization    string     `json:"organization"`
	Project         string     `json:"project"`
	From            time.Time  `json:"from"`
	To              time.Time  `json:"to"`
	Status          string     `json:"status"`
	RequestedAt     time.Time  `json:"requested_at"`
	StartedAt       *time.Time `json:"started_at"`
	CompletedAt     *time.Time `json:"completed_at"`
	ImportedEvents  int64      `json:"imported_events"`
	MatchedEvents   int64      `json:"matched_events"`
	AmbiguousEvents int64      `json:"ambiguous_events"`
	UnmatchedEvents int64      `json:"unmatched_events"`
	ErrorMessage    string     `json:"error_message"`
}

type S3Credential

type S3Credential struct {
	Bucket           string `db:"bucket"`
	Provider         string `db:"provider"`
	Region           string `db:"region"`
	AccessKey        string `db:"access_key"`
	SecretKey        string `db:"secret_key"`
	Endpoint         string `db:"endpoint"`
	BillingLogBucket string `db:"billing_log_bucket"`
	BillingLogPrefix string `db:"billing_log_prefix"`
}

S3Credential represents the 's3_credential' table

type TransferAttributionBreakdown added in v0.2.5

type TransferAttributionBreakdown struct {
	Key              string     `json:"key"`
	Organization     string     `json:"organization"`
	Project          string     `json:"project"`
	Provider         string     `json:"provider"`
	Bucket           string     `json:"bucket"`
	SHA256           string     `json:"sha256"`
	ActorEmail       string     `json:"actor_email"`
	ActorSubject     string     `json:"actor_subject"`
	EventCount       int64      `json:"event_count"`
	BytesRequested   int64      `json:"bytes_requested"`
	BytesDownloaded  int64      `json:"bytes_downloaded"`
	BytesUploaded    int64      `json:"bytes_uploaded"`
	LastTransferTime *time.Time `json:"last_transfer_time"`
}

type TransferAttributionEvent added in v0.2.5

type TransferAttributionEvent struct {
	EventID           string
	AccessGrantID     string
	EventType         string
	EventTime         time.Time
	RequestID         string
	ObjectID          string
	SHA256            string
	ObjectSize        int64
	Organization      string
	Project           string
	AccessID          string
	Provider          string
	Bucket            string
	StorageURL        string
	RangeStart        *int64
	RangeEnd          *int64
	BytesRequested    int64
	BytesCompleted    int64
	ActorEmail        string
	ActorSubject      string
	AuthMode          string
	ClientName        string
	ClientVersion     string
	TransferSessionID string
}

TransferAttributionEvent is the append-only access-issued audit log. Billing metrics are based on matched ProviderTransferEvent rows, not these events.

type TransferAttributionFilter added in v0.2.5

type TransferAttributionFilter struct {
	Organization         string
	Project              string
	EventType            string
	Direction            string
	From                 *time.Time
	To                   *time.Time
	Provider             string
	Bucket               string
	SHA256               string
	User                 string
	ReconciliationStatus string
}

type TransferAttributionSummary added in v0.2.5

type TransferAttributionSummary struct {
	EventCount         int64                     `json:"event_count"`
	AccessIssuedCount  int64                     `json:"access_issued_count"`
	DownloadEventCount int64                     `json:"download_event_count"`
	UploadEventCount   int64                     `json:"upload_event_count"`
	BytesRequested     int64                     `json:"bytes_requested"`
	BytesDownloaded    int64                     `json:"bytes_downloaded"`
	BytesUploaded      int64                     `json:"bytes_uploaded"`
	Freshness          *TransferMetricsFreshness `json:"freshness,omitempty"`
}

type TransferMetricsFreshness added in v0.2.5

type TransferMetricsFreshness struct {
	IsStale             bool       `json:"is_stale"`
	MissingBuckets      []string   `json:"missing_buckets,omitempty"`
	LatestCompletedSync *time.Time `json:"latest_completed_sync,omitempty"`
	RequiredFrom        *time.Time `json:"required_from,omitempty"`
	RequiredTo          *time.Time `json:"required_to,omitempty"`
}

Jump to

Keyboard shortcuts

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