s3

package
v1.10.14 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Download

func Download(c *gin.Context)

Download is the main entry function for the S3 functionality. It parses the dataset parameter from the request and relays the request to the correct S3 function.

func GetBucketLocation

func GetBucketLocation(c *gin.Context)

GetBucketLocation respondes to an S3 GetBucketLocation request. This request only contains the AWS region name as XML. https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLocation.html

func GetObject

func GetObject(c *gin.Context)

GetObject respondes to an S3 GetObject request. This request returns S3 objects. This is done by first fetching any file that matches the dataset + filename request from the database and then passing the fileID to the SDA Download function. https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html

func ListBuckets

func ListBuckets(c *gin.Context)

ListBuckets respondes to an S3 ListBuckets request. This request returns the available S3 buckets. We use this to list accessible datasets. https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBuckets.html

func ListObjects

func ListObjects(c *gin.Context)

ListObjects respondes to an S3 ListObjects request. This request lists the contents of an S3 bucket. We use this to return dataset content. https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjects.html

Types

type Bucket

type Bucket struct {
	CreationDate string `xml:"CreationDate,omitempty"`
	Name         string `xml:"Name"`
}

type ListAllMyBucketsResult

type ListAllMyBucketsResult struct {
	Buckets []Bucket `xml:"Buckets>Bucket"`
	Owner   Owner    `xml:"Owner"`
}

type ListBucketResult

type ListBucketResult struct {
	CommonPrefixes []string `xml:"CommonPrefixes>CommonPrefix"`
	Contents       []Object `xml:"Contents"`
	Delimiter      string   `xml:"Delimiter,omitempty"`
	EncodingType   string   `xml:"EncodingType,omitempty"`
	IsTruncated    bool     `xml:"IsTruncated,omitempty"`
	Marker         string   `xml:"Marker,omitempty"`
	MaxKeys        int      `xml:"MaxKeys,omitempty"`
	Name           string   `xml:"Name"`
	NextMarker     string   `xml:"NextMarker,omitempty"`
	Prefix         string   `xml:"Prefix,omitempty"`
}

type LocationConstraint

type LocationConstraint struct {
	XMLns    string `xml:"xmlns,attr"`
	Location string `xml:",innerxml"`
}

type Object

type Object struct {
	ChecksumAlgorithm []string `xml:"ChecksumAlgorithm,omitempty"`
	ETag              string   `xml:"ETag,omitempty"`
	Key               string   `xml:"Key"`
	LastModified      string   `xml:"LastModified,omitempty"`
	Owner             Owner    `xml:"Owner,omitempty"`
	Size              int      `xml:"Size,omitempty"`
	StorageClass      string   `xml:"StorageClass,omitempty"`
}

type Owner

type Owner struct {
	DisplayName string `xml:"DisplayName,omitempty"`
	ID          string `xml:"ID,omitempty"`
}

Jump to

Keyboard shortcuts

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