services

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoRecordsForHash = errors.New("no records found for hash")
View Source
var ErrObjectNotFound = errors.New("drs object not found")

Functions

This section is empty.

Types

type BucketsService

type BucketsService struct {
	// contains filtered or unexported fields
}

func (*BucketsService) AddScope

func (*BucketsService) Delete

func (s *BucketsService) Delete(ctx context.Context, bucket string) error

func (*BucketsService) List

func (*BucketsService) Put

type DRSPage

type DRSPage struct {
	DrsObjects []drsapi.DrsObject `json:"drs_objects"`
}

type DRSService

type DRSService struct {
	// contains filtered or unexported fields
}

func (*DRSService) BatchGetObjectsByHash

func (s *DRSService) BatchGetObjectsByHash(ctx context.Context, hashes []string) (DRSPage, error)

func (*DRSService) DeleteObject added in v0.2.8

func (s *DRSService) DeleteObject(ctx context.Context, objectID string, deleteStorageData bool) error

func (*DRSService) DeleteRecordsByHash

func (s *DRSService) DeleteRecordsByHash(ctx context.Context, hash string) error

func (*DRSService) GetAccessURL

func (s *DRSService) GetAccessURL(ctx context.Context, objectID, accessID string) (drsapi.AccessURL, error)

func (*DRSService) GetObject

func (s *DRSService) GetObject(ctx context.Context, objectID string) (drsapi.DrsObject, error)

func (*DRSService) GetProjectSample

func (s *DRSService) GetProjectSample(ctx context.Context, projectID string, limit int) (DRSPage, error)

func (*DRSService) ListObjects

func (s *DRSService) ListObjects(ctx context.Context, limit, page int) (DRSPage, error)

func (*DRSService) ListObjectsAfter added in v0.3.0

func (s *DRSService) ListObjectsAfter(ctx context.Context, limit int, start string) (DRSPage, error)

func (*DRSService) ListObjectsByProject

func (s *DRSService) ListObjectsByProject(ctx context.Context, projectID string, limit, page int) (DRSPage, error)

func (*DRSService) ListObjectsByProjectAfter added in v0.3.0

func (s *DRSService) ListObjectsByProjectAfter(ctx context.Context, projectID string, limit int, start string) (DRSPage, error)

func (*DRSService) Resolve

func (s *DRSService) Resolve(ctx context.Context, id string) (*transfer.ResolvedObject, error)

Resolve implements transfer.Resolver by fetching object metadata from the DRS API.

func (*DRSService) UpdateObjectAccessMethods added in v0.3.0

func (s *DRSService) UpdateObjectAccessMethods(ctx context.Context, objectID string, accessMethods []drsapi.AccessMethod) (drsapi.DrsObject, error)

type DataService

type DataService struct {
	// contains filtered or unexported fields
}

func (*DataService) CanonicalObjectURL

func (d *DataService) CanonicalObjectURL(signedURL, bucketHint, fallbackDID string) (string, error)

func (*DataService) CompleteMultipartUpload

func (d *DataService) CompleteMultipartUpload(ctx context.Context, key, uploadID string, parts []internalapi.InternalMultipartPart, bucket string) error

func (*DataService) Delete

func (d *DataService) Delete(ctx context.Context, guid string) error

func (*DataService) DeleteFile

func (d *DataService) DeleteFile(ctx context.Context, guid string) (string, error)

func (*DataService) Download

func (d *DataService) Download(ctx context.Context, signedURL string, rangeStart, rangeEnd *int64) (*http.Response, error)

func (*DataService) DownloadURL

func (d *DataService) DownloadURL(ctx context.Context, did string, expiresIn int, redirect bool) (internalapi.InternalSignedURL, error)

func (*DataService) GetMultipartUploadURL

func (d *DataService) GetMultipartUploadURL(ctx context.Context, key, uploadID string, partNum int32, bucket string) (string, error)

func (*DataService) GetRangeReader

func (d *DataService) GetRangeReader(ctx context.Context, guid string, offset, length int64) (io.ReadCloser, error)

func (*DataService) GetReader

func (d *DataService) GetReader(ctx context.Context, guid string) (io.ReadCloser, error)

func (*DataService) GetWriter

func (d *DataService) GetWriter(ctx context.Context, guid string) (io.WriteCloser, error)

func (*DataService) InitMultipartUpload

func (d *DataService) InitMultipartUpload(ctx context.Context, guid, filename, bucket string) (string, string, error)

func (*DataService) InitMultipartUploadWithMetadata added in v0.3.0

func (d *DataService) InitMultipartUploadWithMetadata(ctx context.Context, guid, filename, bucket string, metadata common.FileMetadata) (string, string, error)

func (*DataService) Logger

func (d *DataService) Logger() transfer.TransferLogger

func (*DataService) MultipartComplete

func (d *DataService) MultipartComplete(ctx context.Context, guid string, uploadID string, parts []transfer.MultipartPart) error

func (*DataService) MultipartInit

func (d *DataService) MultipartInit(ctx context.Context, guid string) (string, error)

func (*DataService) MultipartPart

func (d *DataService) MultipartPart(ctx context.Context, guid string, uploadID string, partNum int, body io.Reader) (string, error)

func (*DataService) Name

func (d *DataService) Name() string

func (*DataService) ResolveDownloadURL

func (d *DataService) ResolveDownloadURL(ctx context.Context, guid string, accessID string) (string, error)

func (*DataService) ResolveUploadURL

func (d *DataService) ResolveUploadURL(ctx context.Context, guid, filename string, metadata common.FileMetadata, bucket string) (string, error)

func (*DataService) Stat

func (*DataService) Upload

func (d *DataService) Upload(ctx context.Context, url string, body io.Reader, size int64) error

func (*DataService) UploadPart

func (d *DataService) UploadPart(ctx context.Context, url string, body io.Reader, size int64) (string, error)

func (*DataService) UploadURL

func (*DataService) Validate

func (d *DataService) Validate(ctx context.Context, bucket string) error

type DeleteByQueryOptions

type DeleteByQueryOptions struct {
	Organization string
	ProjectID    string
	Hash         string
	HashType     string
}

type HealthService

type HealthService struct {
	// contains filtered or unexported fields
}

func NewHealthService

func NewHealthService(r request.Requester) *HealthService

func (*HealthService) Ping

func (h *HealthService) Ping(ctx context.Context) error

type IndexService

type IndexService struct {
	// contains filtered or unexported fields
}

func (*IndexService) BulkDocuments

func (s *IndexService) BulkDocuments(ctx context.Context, dids []string) ([]internalapi.InternalRecordResponse, error)

func (*IndexService) BulkSHA256Validity

func (s *IndexService) BulkSHA256Validity(ctx context.Context, req internalapi.BulkSHA256ValidityRequest) (map[string]bool, error)

func (*IndexService) Delete

func (s *IndexService) Delete(ctx context.Context, did string) error

func (*IndexService) DeleteBulk

func (s *IndexService) DeleteBulk(ctx context.Context, req internalapi.BulkHashesRequest) (int, error)

func (*IndexService) DeleteByQuery

func (*IndexService) Get

func (*IndexService) GetByHash

func (*IndexService) List

func (*IndexService) RemoveControlledAccess added in v0.2.8

func (s *IndexService) RemoveControlledAccess(ctx context.Context, did, resource string) (internalapi.InternalRecordResponse, error)

func (*IndexService) SHA256Validity

func (s *IndexService) SHA256Validity(ctx context.Context, values []string) (map[string]bool, error)

func (*IndexService) Upsert

func (s *IndexService) Upsert(ctx context.Context, did, objectURL, fileName string, size int64, sha256sum string, authorizations map[string][]string) error

type LFSService

type LFSService struct {
	// contains filtered or unexported fields
}

func (*LFSService) Batch

Batch executes a Git LFS Batch API request.

func (*LFSService) StageMetadata

func (s *LFSService) StageMetadata(ctx context.Context, candidates []lfsapi.DrsObjectCandidate, ttl *int64) (int32, error)

StageMetadata stages object metadata for deferred registration.

func (*LFSService) Verify

func (s *LFSService) Verify(ctx context.Context, oid string, size int64) error

Verify verifies an uploaded object via the LFS Verify API.

type ListRecordsOptions

type ListRecordsOptions struct {
	Hash         string
	URL          string
	Organization string
	ProjectID    string
	Path         string
	Limit        int
	Start        string
	Page         int
}

type MetricsFilesOptions

type MetricsFilesOptions struct {
	Limit        int
	Offset       int
	InactiveDays int
	Organization string
	ProjectID    string
}

type MetricsService

type MetricsService struct {
	// contains filtered or unexported fields
}

func (*MetricsService) File

func (s *MetricsService) File(ctx context.Context, objectID string) (metricsapi.FileUsage, error)

func (*MetricsService) Files

func (*MetricsService) Summary

func (*MetricsService) TransferBreakdown

func (*MetricsService) TransferSummary

type MetricsSummaryOptions

type MetricsSummaryOptions struct {
	InactiveDays int
	Organization string
	ProjectID    string
}

type SyfonClient

type SyfonClient interface {
	Health() *HealthService
	Data() *DataService
	Index() *IndexService
	DRS() *DRSService
	Buckets() *BucketsService
	Metrics() *MetricsService
	LFS() *LFSService
}

SyfonClient defines the top-level interface for interacting with Syfon services.

type TransferBreakdownResponse

type TransferBreakdownResponse struct {
	GroupBy   string                                `json:"group_by"`
	Data      []models.TransferAttributionBreakdown `json:"data"`
	Freshness *models.TransferMetricsFreshness      `json:"freshness,omitempty"`
}

type TransferMetricsOptions

type TransferMetricsOptions struct {
	Organization         string
	ProjectID            string
	Direction            string
	From                 string
	To                   string
	Provider             string
	Bucket               string
	SHA256               string
	User                 string
	GroupBy              string
	ReconciliationStatus string
	AllowStale           bool
}

type UploadURLRequest

type UploadURLRequest struct {
	FileID       string
	FileName     string
	ExpiresIn    int
	Organization string
	Project      string
}

Jump to

Keyboard shortcuts

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