Documentation
¶
Overview ¶
Package types provides types and interfaces for the API and its backends.
Index ¶
- Variables
- type AccessManager
- type AccessType
- type DataspaceConnector
- type DownloadCredentials
- type ErrorResponse
- type Metadata
- type Organization
- type Policy
- type Provider
- type ProviderFile
- type ProviderLister
- type ResearchData
- type S3Connection
- func (s3c *S3Connection) EnrichUserFile(context context.Context, userFile UserFile, metadata Metadata) (ProviderFile, error)
- func (s3c *S3Connection) GetBytes(context context.Context, name string) ([]byte, error)
- func (s3c *S3Connection) GetMetadataObject(context context.Context, name string) (*Metadata, error)
- func (s3c *S3Connection) GetMetadataObjects(context context.Context) ([]Metadata, error)
- type ShareManager
- type ShareRequest
- type ShareResponse
- type Study
- type StudyLister
- type StudySharedFile
- type SuccessResponse
- type Target
- type UserFile
- type Validator
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type AccessManager ¶
type AccessManager interface { ListPolicies(ctx context.Context) ([]Policy, error) SubmitPolicy(ctx context.Context, policy Policy) error DeletePolicy(ctx context.Context, policyID uuid.UUID) error }
AccessManager is an interface for managing access policies between entities and data.
type AccessType ¶
type AccessType int
AccessType is the type of access to a resource.
const ( // AccessTypeFull means access to the full resource, including real name. AccessTypeFull AccessType = iota // AccessTypeAnonymized means access to the anonymized resource. AccessTypeAnonymized // AccessTypePseudonymized means access to the pseudononymised resource. AccessTypePseudonymized )
type DataspaceConnector ¶
type DataspaceConnector interface { ListProviderFiles(ctx context.Context, providerID string) ([]ProviderFile, error) GetProviderFileInfo(ctx context.Context, providerID string, fileID string) (ProviderFile, error) // TODO: This should return a reader, not bytes, as it might be a large file. GetProviderFile(ctx context.Context, providerID string, fileID string) ([]byte, error) GetDownloadCredentials(ctx context.Context, providerID string, fileID string) (DownloadCredentials, error) }
DataspaceConnector is an interface for listing, and receiving data.
type DownloadCredentials ¶
type ErrorResponse ¶
ErrorResponse represents a response containing error information.
type Organization ¶
type Policy ¶
type Policy struct { ID uuid.UUID `json:"id"` Target Target `json:"target"` Assignee Provider `json:"assignee"` AccessType AccessType `json:"access_type"` }
Policy represents a policy, describing the permission givven to a provider for accessing a resource.
type Provider ¶
type Provider struct { ID string `json:"id"` Name string `json:"name"` Description string `json:"description"` LogoURI string `json:"logo_uri"` ContactInformation string `json:"contact_information"` VerifiableCredential string `json:"verifiable_credential"` MetadataKey string // Only used as S3 object reference ProviderUrl string `json:"provider_url"` PublicKey string `json:"public_key"` }
Provider represents a provider of a resource.
type ProviderFile ¶
type ProviderFile struct { ID string `json:"id"` Name string `json:"name"` Description string `json:"description"` CreatedAt int64 `json:"created_at"` MimeType string `json:"mime_type"` Size int64 `json:"size"` Provider Provider `json:"provider"` Key string }
ProviderFile represents a file hosted by a provider.
func (ProviderFile) Validate ¶
func (pf ProviderFile) Validate() error
Validate checks the validity of the ProviderFile. TODO: actually validate the ProviderFile.
type ProviderLister ¶
type ProviderLister interface { ListProviders(ctx context.Context) ([]Provider, error) GetProvider(ctx context.Context, providerID string) (Provider, error) GetProviderURL(ctx context.Context, providerID string) (string, error) }
ProviderLister is an interface for looking up providers.
type ResearchData ¶
type ResearchData struct { Name string `json:"name"` Description string `json:"description"` DataType string `json:"data_type"` AccessType AccessType `json:"access_type"` }
ResearchData represents data and the type of access that a study wants to use for its research.
type S3Connection ¶
type S3Connection struct { S3Client *minio.Client Bucket string }
func (*S3Connection) EnrichUserFile ¶
func (s3c *S3Connection) EnrichUserFile( context context.Context, userFile UserFile, metadata Metadata, ) (ProviderFile, error)
func (*S3Connection) GetMetadataObject ¶
func (*S3Connection) GetMetadataObjects ¶
func (s3c *S3Connection) GetMetadataObjects(context context.Context) ([]Metadata, error)
type ShareManager ¶
type ShareManager interface {
}ShareManager is an interfacd for managing sharing between non-dataspace entities and data.
type ShareRequest ¶
type ShareRequest struct {}
ShareRequest represents a request to share a resource.
func (ShareRequest) Validate ¶
func (sr ShareRequest) Validate() error
Validate checks the validity of the ShareRequest. TODO: actually validate the ShareRequest.
type ShareResponse ¶
type ShareResponse struct {}
ShareResponse represents the response to a share request.
type Study ¶
type Study struct { ID uuid.UUID `json:"id"` Organization Organization `json:"organization"` Name string `json:"name"` Description string `json:"description"` DescriptionSummary string `json:"description_summary"` StudyUri string `json:"study_uri"` StudyStart int64 `json:"study_start"` StudyEnd int64 `json:"study_end"` ResearchData []ResearchData `json:"research_data"` }
Study represents a study.
type StudyLister ¶
type StudyLister interface { ListStudies(ctx context.Context) ([]Study, error) GetStudy(ctx context.Context, studyID uuid.UUID) (Study, error) ListStudyFiles(ctx context.Context, studyID uuid.UUID) ([]ProviderFile, error) }
StudyLister is an interface for looking up studies.
type StudySharedFile ¶
type StudySharedFile struct {}
type SuccessResponse ¶
type SuccessResponse struct {
Status string `json:"status"`
}
SuccessResponse represents a response containing success information.