s3api

package
v0.0.0-...-45e1a9a Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: Apache-2.0 Imports: 60 Imported by: 0

README

see https://blog.aqwari.net/xml-schema-go/

1. go get aqwari.net/xml/cmd/xsdgen
2. Add EncodingType element for ListBucketResult in AmazonS3.xsd
3. xsdgen -o s3api_xsd_generated.go -pkg s3api AmazonS3.xsd
4. Remove empty Grantee struct in s3api_xsd_generated.go
5. Remove xmlns: sed s'/http:\/\/s3.amazonaws.com\/doc\/2006-03-01\/\ //' s3api_xsd_generated.go

Documentation

Index

Constants

View Source
const (
	DirectiveCopy    = "COPY"
	DirectiveReplace = "REPLACE"
)
View Source
const (
	Enabled  ruleStatus = "Enabled"
	Disabled ruleStatus = "Disabled"
)

Supported status types

View Source
const (
	S3TAG_PREFIX = s3_constants.AmzObjectTagging + "-"
)

Variables

View Source
var (
	// AccountAdmin is used as the default account for IAM-Credentials access without Account configured
	AccountAdmin = Account{
		DisplayName:  "admin",
		EmailAddress: "admin@example.com",
		Id:           s3_constants.AccountAdminId,
	}

	// AccountAnonymous is used to represent the account for anonymous access
	AccountAnonymous = Account{
		DisplayName:  "anonymous",
		EmailAddress: "anonymous@example.com",
		Id:           s3_constants.AccountAnonymousId,
	}
)

Predefined Accounts

Functions

func AssembleEntryWithAcp

func AssembleEntryWithAcp(objectEntry *filer_pb.Entry, objectOwner string, grants []*s3.Grant) s3err.ErrorCode

AssembleEntryWithAcp fill entry with owner and grants

func DetermineReqGrants

func DetermineReqGrants(accountId, aclAction string) (grants []*s3.Grant)

DetermineReqGrants generates the grant set (Grants) according to accountId and reqPermission.

func ExtractAcl

func ExtractAcl(r *http.Request, accountManager AccountManager, ownership, bucketOwnerId, ownerId, accountId string) (grants []*s3.Grant, errCode s3err.ErrorCode)

ExtractAcl extracts the acl from the request body, or from the header if request body is empty

func GetAccountId

func GetAccountId(r *http.Request) string

GetAccountId get AccountId from request headers, AccountAnonymousId will be return if not presen

func GetAcpGrants

func GetAcpGrants(entryExtended map[string][]byte) []*s3.Grant

GetAcpGrants return grants parsed from entry

func GetAcpOwner

func GetAcpOwner(entryExtended map[string][]byte, defaultOwner string) string

func GrantEquals

func GrantEquals(a, b *s3.Grant) bool

GrantEquals Compare whether two Grants are equal in meaning, not completely equal (compare Grantee.Type and the corresponding Value for equality, other fields of Grantee are ignored)

func ParseAclHeaders

func ParseAclHeaders(r *http.Request, ownership, bucketOwnerId, accountId string, putAcl bool) (ownerId string, grants []*s3.Grant, errCode s3err.ErrorCode)

ParseAclHeaders parse acl headers When `putAcl` is true, only `CannedAcl` is parsed, such as `PutBucketAcl` or `PutObjectAcl` is requested, `CustomAcl` is parsed from the request body not from headers, and only if the request body is empty, `CannedAcl` is parsed from the header, and will not parse `CustomAcl` from the header

Since `CustomAcl` has higher priority, it will be parsed first; if `CustomAcl` does not exist, `CannedAcl` will be parsed

func ParseAndValidateAclHeaders

func ParseAndValidateAclHeaders(r *http.Request, accountManager AccountManager, ownership, bucketOwnerId, accountId string, putAcl bool) (ownerId string, grants []*s3.Grant, errCode s3err.ErrorCode)

ParseAndValidateAclHeaders parse and validate acl from header

func ParseAndValidateAclHeadersOrElseDefault

func ParseAndValidateAclHeadersOrElseDefault(r *http.Request, accountManager AccountManager, ownership, bucketOwnerId, accountId string, putAcl bool) (ownerId string, grants []*s3.Grant, errCode s3err.ErrorCode)

ParseAndValidateAclHeadersOrElseDefault will callParseAndValidateAclHeaders to get Grants, if empty, it will return Grant that grant `accountId` with `FullControl` permission

func ParseCannedAclHeader

func ParseCannedAclHeader(bucketOwnership, bucketOwnerId, accountId, cannedAcl string, putAcl bool) (ownerId string, grants []*s3.Grant, err s3err.ErrorCode)

func ParseCustomAclHeader

func ParseCustomAclHeader(headerValue, permission string, grants *[]*s3.Grant) s3err.ErrorCode

func ParseCustomAclHeaders

func ParseCustomAclHeaders(r *http.Request, grants *[]*s3.Grant) s3err.ErrorCode

func SetAcpGrantsHeader

func SetAcpGrantsHeader(r *http.Request, acpGrants []*s3.Grant)

func SetAcpOwnerHeader

func SetAcpOwnerHeader(r *http.Request, acpOwnerId string)

func TimeToFirstByte

func TimeToFirstByte(action string, start time.Time, r *http.Request)

func ValidateAndTransferGrants

func ValidateAndTransferGrants(accountManager AccountManager, grants []*s3.Grant) ([]*s3.Grant, s3err.ErrorCode)

ValidateAndTransferGrants validate grant & transfer Email-Grant to Id-Grant

func ValidateTags

func ValidateTags(tags map[string]string) error

Types

type AccessControlList

type AccessControlList struct {
	Grant []Grant `xml:"Grant,omitempty"`
}

type AccessControlPolicy

type AccessControlPolicy struct {
	Owner             CanonicalUser     `xml:"Owner"`
	AccessControlList AccessControlList `xml:"AccessControlList"`
}

type Account

type Account struct {
	//Name is also used to display the "DisplayName" as the owner of the bucket or object
	DisplayName  string
	EmailAddress string

	//Id is used to identify an Account when granting cross-account access(ACLs) to buckets and objects
	Id string
}

Account represents a system user, a system user can configure multiple IAM-Users, IAM-Users can configure permissions respectively, and each IAM-User can configure multiple security credentials

type AccountManager

type AccountManager interface {
	GetAccountNameById(canonicalId string) string
	GetAccountIdByEmail(email string) string
}

type Action

type Action string

type AmazonCustomerByEmail

type AmazonCustomerByEmail struct {
	EmailAddress string `xml:"EmailAddress"`
}

type And

type And struct {
	XMLName xml.Name `xml:"And"`
	Prefix  Prefix   `xml:"Prefix,omitempty"`
	Tags    []Tag    `xml:"Tag,omitempty"`
}

And - a tag to combine a prefix and multiple tags for lifecycle configuration rule.

type Anon1

type Anon1 struct {
	Bucket         string    `xml:"Bucket"`
	AWSAccessKeyId string    `xml:"AWSAccessKeyId,omitempty"`
	Timestamp      time.Time `xml:"Timestamp,omitempty"`
	Signature      string    `xml:"Signature,omitempty"`
	Credential     string    `xml:"Credential,omitempty"`
}

func (*Anon1) MarshalXML

func (t *Anon1) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*Anon1) UnmarshalXML

func (t *Anon1) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type Anon10

type Anon10 struct {
}

type Anon11

type Anon11 struct {
	Bucket            string            `xml:"Bucket"`
	AccessControlList AccessControlList `xml:"AccessControlList,omitempty"`
	AWSAccessKeyId    string            `xml:"AWSAccessKeyId,omitempty"`
	Timestamp         time.Time         `xml:"Timestamp,omitempty"`
	Signature         string            `xml:"Signature,omitempty"`
	Credential        string            `xml:"Credential,omitempty"`
}

func (*Anon11) MarshalXML

func (t *Anon11) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*Anon11) UnmarshalXML

func (t *Anon11) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type Anon12

type Anon12 struct {
}

type Anon13

type Anon13 struct {
	Bucket         string    `xml:"Bucket"`
	Key            string    `xml:"Key"`
	GetMetadata    bool      `xml:"GetMetadata"`
	GetData        bool      `xml:"GetData"`
	InlineData     bool      `xml:"InlineData"`
	AWSAccessKeyId string    `xml:"AWSAccessKeyId,omitempty"`
	Timestamp      time.Time `xml:"Timestamp,omitempty"`
	Signature      string    `xml:"Signature,omitempty"`
	Credential     string    `xml:"Credential,omitempty"`
}

func (*Anon13) MarshalXML

func (t *Anon13) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*Anon13) UnmarshalXML

func (t *Anon13) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type Anon14

type Anon14 struct {
	GetObjectResponse GetObjectResult `xml:"GetObjectResponse"`
}

type Anon15

type Anon15 struct {
	Bucket                                 string    `xml:"Bucket"`
	Key                                    string    `xml:"Key"`
	GetMetadata                            bool      `xml:"GetMetadata"`
	GetData                                bool      `xml:"GetData"`
	InlineData                             bool      `xml:"InlineData"`
	ByteRangeStart                         int64     `xml:"ByteRangeStart,omitempty"`
	ByteRangeEnd                           int64     `xml:"ByteRangeEnd,omitempty"`
	IfModifiedSince                        time.Time `xml:"IfModifiedSince,omitempty"`
	IfUnmodifiedSince                      time.Time `xml:"IfUnmodifiedSince,omitempty"`
	IfMatch                                []string  `xml:"IfMatch,omitempty"`
	IfNoneMatch                            []string  `xml:"IfNoneMatch,omitempty"`
	ReturnCompleteObjectOnConditionFailure bool      `xml:"ReturnCompleteObjectOnConditionFailure,omitempty"`
	AWSAccessKeyId                         string    `xml:"AWSAccessKeyId,omitempty"`
	Timestamp                              time.Time `xml:"Timestamp,omitempty"`
	Signature                              string    `xml:"Signature,omitempty"`
	Credential                             string    `xml:"Credential,omitempty"`
}

func (*Anon15) MarshalXML

func (t *Anon15) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*Anon15) UnmarshalXML

func (t *Anon15) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type Anon16

type Anon16 struct {
	GetObjectResponse GetObjectResult `xml:"GetObjectResponse"`
}

type Anon17

type Anon17 struct {
	Bucket            string            `xml:"Bucket"`
	Key               string            `xml:"Key"`
	Metadata          []MetadataEntry   `xml:"Metadata,omitempty"`
	ContentLength     int64             `xml:"ContentLength"`
	AccessControlList AccessControlList `xml:"AccessControlList,omitempty"`
	StorageClass      StorageClass      `xml:"StorageClass,omitempty"`
	AWSAccessKeyId    string            `xml:"AWSAccessKeyId,omitempty"`
	Timestamp         time.Time         `xml:"Timestamp,omitempty"`
	Signature         string            `xml:"Signature,omitempty"`
	Credential        string            `xml:"Credential,omitempty"`
}

func (*Anon17) MarshalXML

func (t *Anon17) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*Anon17) UnmarshalXML

func (t *Anon17) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type Anon18

type Anon18 struct {
	PutObjectResponse PutObjectResult `xml:"PutObjectResponse"`
}

type Anon19

type Anon19 struct {
	Bucket            string            `xml:"Bucket"`
	Key               string            `xml:"Key"`
	Metadata          []MetadataEntry   `xml:"Metadata,omitempty"`
	Data              []byte            `xml:"Data"`
	ContentLength     int64             `xml:"ContentLength"`
	AccessControlList AccessControlList `xml:"AccessControlList,omitempty"`
	StorageClass      StorageClass      `xml:"StorageClass,omitempty"`
	AWSAccessKeyId    string            `xml:"AWSAccessKeyId,omitempty"`
	Timestamp         time.Time         `xml:"Timestamp,omitempty"`
	Signature         string            `xml:"Signature,omitempty"`
	Credential        string            `xml:"Credential,omitempty"`
}

func (*Anon19) MarshalXML

func (t *Anon19) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*Anon19) UnmarshalXML

func (t *Anon19) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type Anon2

type Anon2 struct {
	GetBucketLoggingStatusResponse BucketLoggingStatus `xml:"GetBucketLoggingStatusResponse"`
}

type Anon20

type Anon20 struct {
	PutObjectInlineResponse PutObjectResult `xml:"PutObjectInlineResponse"`
}

type Anon21

type Anon21 struct {
	Bucket         string    `xml:"Bucket"`
	Key            string    `xml:"Key"`
	AWSAccessKeyId string    `xml:"AWSAccessKeyId,omitempty"`
	Timestamp      time.Time `xml:"Timestamp,omitempty"`
	Signature      string    `xml:"Signature,omitempty"`
	Credential     string    `xml:"Credential,omitempty"`
}

func (*Anon21) MarshalXML

func (t *Anon21) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*Anon21) UnmarshalXML

func (t *Anon21) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type Anon22

type Anon22 struct {
	DeleteObjectResponse Status `xml:"DeleteObjectResponse"`
}

type Anon23

type Anon23 struct {
	Bucket         string    `xml:"Bucket"`
	Prefix         string    `xml:"Prefix,omitempty"`
	Marker         string    `xml:"Marker,omitempty"`
	MaxKeys        int       `xml:"MaxKeys,omitempty"`
	Delimiter      string    `xml:"Delimiter,omitempty"`
	AWSAccessKeyId string    `xml:"AWSAccessKeyId,omitempty"`
	Timestamp      time.Time `xml:"Timestamp,omitempty"`
	Signature      string    `xml:"Signature,omitempty"`
	Credential     string    `xml:"Credential,omitempty"`
}

func (*Anon23) MarshalXML

func (t *Anon23) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*Anon23) UnmarshalXML

func (t *Anon23) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type Anon24

type Anon24 struct {
	ListBucketResponse ListBucketResult `xml:"ListBucketResponse"`
}

type Anon25

type Anon25 struct {
	ListVersionsResponse ListVersionsResult `xml:"ListVersionsResponse"`
}

type Anon26

type Anon26 struct {
	AWSAccessKeyId string    `xml:"AWSAccessKeyId,omitempty"`
	Timestamp      time.Time `xml:"Timestamp,omitempty"`
	Signature      string    `xml:"Signature,omitempty"`
}

func (*Anon26) MarshalXML

func (t *Anon26) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*Anon26) UnmarshalXML

func (t *Anon26) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type Anon27

type Anon27 struct {
	ListAllMyBucketsResponse ListAllMyBucketsResult `xml:"ListAllMyBucketsResponse"`
}

type Anon28

type Anon28 struct {
	Location string `xml:"Location"`
	Bucket   string `xml:"Bucket"`
	Key      string `xml:"Key"`
	ETag     string `xml:"ETag"`
}

type Anon29

type Anon29 struct {
	SourceBucket                string            `xml:"SourceBucket"`
	SourceKey                   string            `xml:"SourceKey"`
	DestinationBucket           string            `xml:"DestinationBucket"`
	DestinationKey              string            `xml:"DestinationKey"`
	MetadataDirective           MetadataDirective `xml:"MetadataDirective,omitempty"`
	Metadata                    []MetadataEntry   `xml:"Metadata,omitempty"`
	AccessControlList           AccessControlList `xml:"AccessControlList,omitempty"`
	CopySourceIfModifiedSince   time.Time         `xml:"CopySourceIfModifiedSince,omitempty"`
	CopySourceIfUnmodifiedSince time.Time         `xml:"CopySourceIfUnmodifiedSince,omitempty"`
	CopySourceIfMatch           []string          `xml:"CopySourceIfMatch,omitempty"`
	CopySourceIfNoneMatch       []string          `xml:"CopySourceIfNoneMatch,omitempty"`
	StorageClass                StorageClass      `xml:"StorageClass,omitempty"`
	AWSAccessKeyId              string            `xml:"AWSAccessKeyId,omitempty"`
	Timestamp                   time.Time         `xml:"Timestamp,omitempty"`
	Signature                   string            `xml:"Signature,omitempty"`
	Credential                  string            `xml:"Credential,omitempty"`
}

func (*Anon29) MarshalXML

func (t *Anon29) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*Anon29) UnmarshalXML

func (t *Anon29) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type Anon3

type Anon3 struct {
	Bucket              string              `xml:"Bucket"`
	AWSAccessKeyId      string              `xml:"AWSAccessKeyId,omitempty"`
	Timestamp           time.Time           `xml:"Timestamp,omitempty"`
	Signature           string              `xml:"Signature,omitempty"`
	Credential          string              `xml:"Credential,omitempty"`
	BucketLoggingStatus BucketLoggingStatus `xml:"BucketLoggingStatus"`
}

func (*Anon3) MarshalXML

func (t *Anon3) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*Anon3) UnmarshalXML

func (t *Anon3) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type Anon30

type Anon30 struct {
	CopyObjectResult CopyObjectResult `xml:"CopyObjectResult"`
}

type Anon4

type Anon4 struct {
}

type Anon5

type Anon5 struct {
	Bucket         string    `xml:"Bucket"`
	Key            string    `xml:"Key"`
	AWSAccessKeyId string    `xml:"AWSAccessKeyId,omitempty"`
	Timestamp      time.Time `xml:"Timestamp,omitempty"`
	Signature      string    `xml:"Signature,omitempty"`
	Credential     string    `xml:"Credential,omitempty"`
}

func (*Anon5) MarshalXML

func (t *Anon5) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*Anon5) UnmarshalXML

func (t *Anon5) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type Anon6

type Anon6 struct {
	GetObjectAccessControlPolicyResponse AccessControlPolicy `xml:"GetObjectAccessControlPolicyResponse"`
}

type Anon7

type Anon7 struct {
	Bucket         string    `xml:"Bucket"`
	AWSAccessKeyId string    `xml:"AWSAccessKeyId,omitempty"`
	Timestamp      time.Time `xml:"Timestamp,omitempty"`
	Signature      string    `xml:"Signature,omitempty"`
	Credential     string    `xml:"Credential,omitempty"`
}

func (*Anon7) MarshalXML

func (t *Anon7) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*Anon7) UnmarshalXML

func (t *Anon7) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type Anon8

type Anon8 struct {
	GetBucketAccessControlPolicyResponse AccessControlPolicy `xml:"GetBucketAccessControlPolicyResponse"`
}

type Anon9

type Anon9 struct {
	Bucket            string            `xml:"Bucket"`
	Key               string            `xml:"Key"`
	AccessControlList AccessControlList `xml:"AccessControlList"`
	AWSAccessKeyId    string            `xml:"AWSAccessKeyId,omitempty"`
	Timestamp         time.Time         `xml:"Timestamp,omitempty"`
	Signature         string            `xml:"Signature,omitempty"`
	Credential        string            `xml:"Credential,omitempty"`
}

func (*Anon9) MarshalXML

func (t *Anon9) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*Anon9) UnmarshalXML

func (t *Anon9) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type BucketLoggingStatus

type BucketLoggingStatus struct {
	LoggingEnabled LoggingSettings `xml:"LoggingEnabled,omitempty"`
}

type BucketMetaData

type BucketMetaData struct {
	Name string

	//By default, when another AWS account uploads an object to S3 bucket,
	//that account (the object writer) owns the object, has access to it, and
	//can grant other users access to it through ACLs. You can use Object Ownership
	//to change this default behavior so that ACLs are disabled and you, as the
	//bucket owner, automatically own every object in your bucket.
	ObjectOwnership string

	// Container for the bucket owner's display name and ID.
	Owner *s3.Owner `type:"structure"`

	// A list of grants for access controls.
	Acl []*s3.Grant `locationName:"AccessControlList" locationNameList:"Grant" type:"list"`
	// contains filtered or unexported fields
}

type BucketRegistry

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

func NewBucketRegistry

func NewBucketRegistry(s3a *S3ApiServer) *BucketRegistry

func (*BucketRegistry) GetBucketMetadata

func (r *BucketRegistry) GetBucketMetadata(bucketName string) (*BucketMetaData, s3err.ErrorCode)

func (*BucketRegistry) LoadBucketMetadata

func (r *BucketRegistry) LoadBucketMetadata(entry *filer_pb.Entry)

func (*BucketRegistry) LoadBucketMetadataFromFiler

func (r *BucketRegistry) LoadBucketMetadataFromFiler(bucketName string) (*BucketMetaData, s3err.ErrorCode)

func (*BucketRegistry) RemoveBucketMetadata

func (r *BucketRegistry) RemoveBucketMetadata(entry *filer_pb.Entry)

type CanonicalUser

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

type CircuitBreaker

type CircuitBreaker struct {
	sync.RWMutex
	Enabled bool
	// contains filtered or unexported fields
}

func NewCircuitBreaker

func NewCircuitBreaker(option *S3ApiServerOption) *CircuitBreaker

func (*CircuitBreaker) Limit

func (cb *CircuitBreaker) Limit(f func(w http.ResponseWriter, r *http.Request), action string) (http.HandlerFunc, Action)

func (*CircuitBreaker) LoadS3ApiConfigurationFromBytes

func (cb *CircuitBreaker) LoadS3ApiConfigurationFromBytes(content []byte) error

type CompleteMultipartUpload

type CompleteMultipartUpload struct {
	Parts []CompletedPart `xml:"Part"`
}

type CompleteMultipartUploadResult

type CompleteMultipartUploadResult struct {
	XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ CompleteMultipartUploadResult"`
	s3.CompleteMultipartUploadOutput
}

type CompletedPart

type CompletedPart struct {
	ETag       string
	PartNumber int
}

type CopyObject

type CopyObject struct {
	SourceBucket                string            `xml:"SourceBucket"`
	SourceKey                   string            `xml:"SourceKey"`
	DestinationBucket           string            `xml:"DestinationBucket"`
	DestinationKey              string            `xml:"DestinationKey"`
	MetadataDirective           MetadataDirective `xml:"MetadataDirective,omitempty"`
	Metadata                    []MetadataEntry   `xml:"Metadata,omitempty"`
	AccessControlList           AccessControlList `xml:"AccessControlList,omitempty"`
	CopySourceIfModifiedSince   time.Time         `xml:"CopySourceIfModifiedSince,omitempty"`
	CopySourceIfUnmodifiedSince time.Time         `xml:"CopySourceIfUnmodifiedSince,omitempty"`
	CopySourceIfMatch           []string          `xml:"CopySourceIfMatch,omitempty"`
	CopySourceIfNoneMatch       []string          `xml:"CopySourceIfNoneMatch,omitempty"`
	StorageClass                StorageClass      `xml:"StorageClass,omitempty"`
	AWSAccessKeyId              string            `xml:"AWSAccessKeyId,omitempty"`
	Timestamp                   time.Time         `xml:"Timestamp,omitempty"`
	Signature                   string            `xml:"Signature,omitempty"`
	Credential                  string            `xml:"Credential,omitempty"`
}

func (*CopyObject) MarshalXML

func (t *CopyObject) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*CopyObject) UnmarshalXML

func (t *CopyObject) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type CopyObjectResponse

type CopyObjectResponse struct {
	CopyObjectResult CopyObjectResult `xml:"CopyObjectResult"`
}

type CopyObjectResult

type CopyObjectResult struct {
	LastModified time.Time `xml:"LastModified"`
	ETag         string    `xml:"ETag"`
}

func (*CopyObjectResult) MarshalXML

func (t *CopyObjectResult) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*CopyObjectResult) UnmarshalXML

func (t *CopyObjectResult) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type CopyPartResult

type CopyPartResult struct {
	LastModified time.Time `xml:"LastModified"`
	ETag         string    `xml:"ETag"`
}

type CreateBucket

type CreateBucket struct {
	Bucket            string            `xml:"Bucket"`
	AccessControlList AccessControlList `xml:"AccessControlList,omitempty"`
	AWSAccessKeyId    string            `xml:"AWSAccessKeyId,omitempty"`
	Timestamp         time.Time         `xml:"Timestamp,omitempty"`
	Signature         string            `xml:"Signature,omitempty"`
}

func (*CreateBucket) MarshalXML

func (t *CreateBucket) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*CreateBucket) UnmarshalXML

func (t *CreateBucket) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type CreateBucketConfiguration

type CreateBucketConfiguration struct {
	LocationConstraint string `xml:"LocationConstraint"`
}

type CreateBucketResponse

type CreateBucketResponse struct {
	CreateBucketReturn CreateBucketResult `xml:"CreateBucketReturn"`
}

type CreateBucketResult

type CreateBucketResult struct {
	BucketName string `xml:"BucketName"`
}

type Credential

type Credential struct {
	AccessKey string
	SecretKey string
}

type DeleteBucket

type DeleteBucket struct {
	Bucket         string    `xml:"Bucket"`
	AWSAccessKeyId string    `xml:"AWSAccessKeyId,omitempty"`
	Timestamp      time.Time `xml:"Timestamp,omitempty"`
	Signature      string    `xml:"Signature,omitempty"`
	Credential     string    `xml:"Credential,omitempty"`
}

func (*DeleteBucket) MarshalXML

func (t *DeleteBucket) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*DeleteBucket) UnmarshalXML

func (t *DeleteBucket) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type DeleteBucketResponse

type DeleteBucketResponse struct {
	DeleteBucketResponse Status `xml:"DeleteBucketResponse"`
}

type DeleteError

type DeleteError struct {
	Code    string
	Message string
	Key     string
}

DeleteError structure.

type DeleteMarkerEntry

type DeleteMarkerEntry struct {
	Key          string        `xml:"Key"`
	VersionId    string        `xml:"VersionId"`
	IsLatest     bool          `xml:"IsLatest"`
	LastModified time.Time     `xml:"LastModified"`
	Owner        CanonicalUser `xml:"Owner,omitempty"`
}

func (*DeleteMarkerEntry) MarshalXML

func (t *DeleteMarkerEntry) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*DeleteMarkerEntry) UnmarshalXML

func (t *DeleteMarkerEntry) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type DeleteObject

type DeleteObject struct {
	Bucket         string    `xml:"Bucket"`
	Key            string    `xml:"Key"`
	AWSAccessKeyId string    `xml:"AWSAccessKeyId,omitempty"`
	Timestamp      time.Time `xml:"Timestamp,omitempty"`
	Signature      string    `xml:"Signature,omitempty"`
	Credential     string    `xml:"Credential,omitempty"`
}

func (*DeleteObject) MarshalXML

func (t *DeleteObject) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*DeleteObject) UnmarshalXML

func (t *DeleteObject) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type DeleteObjectResponse

type DeleteObjectResponse struct {
	DeleteObjectResponse Status `xml:"DeleteObjectResponse"`
}

type DeleteObjectsRequest

type DeleteObjectsRequest struct {
	// Element to enable quiet mode for the request
	Quiet bool
	// List of objects to be deleted
	Objects []ObjectIdentifier `xml:"Object"`
}

DeleteObjectsRequest - xml carrying the object key names which needs to be deleted.

type DeleteObjectsResponse

type DeleteObjectsResponse struct {
	XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ DeleteResult" json:"-"`

	// Collection of all deleted objects
	DeletedObjects []ObjectIdentifier `xml:"Deleted,omitempty"`

	// Collection of errors deleting certain objects.
	Errors []DeleteError `xml:"Error,omitempty"`
}

DeleteObjectsResponse container for multiple object deletes.

type Expiration

type Expiration struct {
	XMLName      xml.Name           `xml:"Expiration"`
	Days         int                `xml:"Days,omitempty"`
	Date         ExpirationDate     `xml:"Date,omitempty"`
	DeleteMarker ExpireDeleteMarker `xml:"ExpiredObjectDeleteMarker"`
	// contains filtered or unexported fields
}

Expiration - expiration actions for a rule in lifecycle configuration.

func (Expiration) MarshalXML

func (e Expiration) MarshalXML(enc *xml.Encoder, startElement xml.StartElement) error

MarshalXML encodes expiration field into an XML form.

type ExpirationDate

type ExpirationDate struct {
	time.Time
}

ExpirationDate is a embedded type containing time.Time to unmarshal Date in Expiration

func (ExpirationDate) MarshalXML

func (eDate ExpirationDate) MarshalXML(e *xml.Encoder, startElement xml.StartElement) error

MarshalXML encodes expiration date if it is non-zero and encodes empty string otherwise

type ExpireDeleteMarker

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

ExpireDeleteMarker represents value of ExpiredObjectDeleteMarker field in Expiration XML element.

func (ExpireDeleteMarker) MarshalXML

func (b ExpireDeleteMarker) MarshalXML(e *xml.Encoder, startElement xml.StartElement) error

MarshalXML encodes delete marker boolean into an XML form.

type Filter

type Filter struct {
	XMLName xml.Name `xml:"Filter"`

	Prefix Prefix

	And And

	Tag Tag
	// contains filtered or unexported fields
}

Filter - a filter for a lifecycle configuration Rule.

func (Filter) MarshalXML

func (f Filter) MarshalXML(e *xml.Encoder, start xml.StartElement) error

MarshalXML encodes Filter field into an XML form.

type GetBucketAccessControlPolicy

type GetBucketAccessControlPolicy struct {
	Bucket         string    `xml:"Bucket"`
	AWSAccessKeyId string    `xml:"AWSAccessKeyId,omitempty"`
	Timestamp      time.Time `xml:"Timestamp,omitempty"`
	Signature      string    `xml:"Signature,omitempty"`
	Credential     string    `xml:"Credential,omitempty"`
}

func (*GetBucketAccessControlPolicy) MarshalXML

func (t *GetBucketAccessControlPolicy) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*GetBucketAccessControlPolicy) UnmarshalXML

func (t *GetBucketAccessControlPolicy) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type GetBucketAccessControlPolicyResponse

type GetBucketAccessControlPolicyResponse struct {
	GetBucketAccessControlPolicyResponse AccessControlPolicy `xml:"GetBucketAccessControlPolicyResponse"`
}

type GetBucketLoggingStatus

type GetBucketLoggingStatus struct {
	Bucket         string    `xml:"Bucket"`
	AWSAccessKeyId string    `xml:"AWSAccessKeyId,omitempty"`
	Timestamp      time.Time `xml:"Timestamp,omitempty"`
	Signature      string    `xml:"Signature,omitempty"`
	Credential     string    `xml:"Credential,omitempty"`
}

func (*GetBucketLoggingStatus) MarshalXML

func (t *GetBucketLoggingStatus) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*GetBucketLoggingStatus) UnmarshalXML

func (t *GetBucketLoggingStatus) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type GetBucketLoggingStatusResponse

type GetBucketLoggingStatusResponse struct {
	GetBucketLoggingStatusResponse BucketLoggingStatus `xml:"GetBucketLoggingStatusResponse"`
}

type GetObject

type GetObject struct {
	Bucket         string    `xml:"Bucket"`
	Key            string    `xml:"Key"`
	GetMetadata    bool      `xml:"GetMetadata"`
	GetData        bool      `xml:"GetData"`
	InlineData     bool      `xml:"InlineData"`
	AWSAccessKeyId string    `xml:"AWSAccessKeyId,omitempty"`
	Timestamp      time.Time `xml:"Timestamp,omitempty"`
	Signature      string    `xml:"Signature,omitempty"`
	Credential     string    `xml:"Credential,omitempty"`
}

func (*GetObject) MarshalXML

func (t *GetObject) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*GetObject) UnmarshalXML

func (t *GetObject) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type GetObjectAccessControlPolicy

type GetObjectAccessControlPolicy struct {
	Bucket         string    `xml:"Bucket"`
	Key            string    `xml:"Key"`
	AWSAccessKeyId string    `xml:"AWSAccessKeyId,omitempty"`
	Timestamp      time.Time `xml:"Timestamp,omitempty"`
	Signature      string    `xml:"Signature,omitempty"`
	Credential     string    `xml:"Credential,omitempty"`
}

func (*GetObjectAccessControlPolicy) MarshalXML

func (t *GetObjectAccessControlPolicy) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*GetObjectAccessControlPolicy) UnmarshalXML

func (t *GetObjectAccessControlPolicy) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type GetObjectAccessControlPolicyResponse

type GetObjectAccessControlPolicyResponse struct {
	GetObjectAccessControlPolicyResponse AccessControlPolicy `xml:"GetObjectAccessControlPolicyResponse"`
}

type GetObjectExtended

type GetObjectExtended struct {
	Bucket                                 string    `xml:"Bucket"`
	Key                                    string    `xml:"Key"`
	GetMetadata                            bool      `xml:"GetMetadata"`
	GetData                                bool      `xml:"GetData"`
	InlineData                             bool      `xml:"InlineData"`
	ByteRangeStart                         int64     `xml:"ByteRangeStart,omitempty"`
	ByteRangeEnd                           int64     `xml:"ByteRangeEnd,omitempty"`
	IfModifiedSince                        time.Time `xml:"IfModifiedSince,omitempty"`
	IfUnmodifiedSince                      time.Time `xml:"IfUnmodifiedSince,omitempty"`
	IfMatch                                []string  `xml:"IfMatch,omitempty"`
	IfNoneMatch                            []string  `xml:"IfNoneMatch,omitempty"`
	ReturnCompleteObjectOnConditionFailure bool      `xml:"ReturnCompleteObjectOnConditionFailure,omitempty"`
	AWSAccessKeyId                         string    `xml:"AWSAccessKeyId,omitempty"`
	Timestamp                              time.Time `xml:"Timestamp,omitempty"`
	Signature                              string    `xml:"Signature,omitempty"`
	Credential                             string    `xml:"Credential,omitempty"`
}

func (*GetObjectExtended) MarshalXML

func (t *GetObjectExtended) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*GetObjectExtended) UnmarshalXML

func (t *GetObjectExtended) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type GetObjectExtendedResponse

type GetObjectExtendedResponse struct {
	GetObjectResponse GetObjectResult `xml:"GetObjectResponse"`
}

type GetObjectResponse

type GetObjectResponse struct {
	GetObjectResponse GetObjectResult `xml:"GetObjectResponse"`
}

type GetObjectResult

type GetObjectResult struct {
	Status       Status          `xml:"Status"`
	Metadata     []MetadataEntry `xml:"Metadata,omitempty"`
	Data         []byte          `xml:"Data,omitempty"`
	LastModified time.Time       `xml:"LastModified"`
	ETag         string          `xml:"ETag"`
}

func (*GetObjectResult) MarshalXML

func (t *GetObjectResult) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*GetObjectResult) UnmarshalXML

func (t *GetObjectResult) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type Grant

type Grant struct {
	Grantee    Grantee    `xml:"Grantee"`
	Permission Permission `xml:"Permission"`
}

type Grantee

type Grantee struct {
	XMLNS       string `xml:"xmlns:xsi,attr"`
	XMLXSI      string `xml:"xsi:type,attr"`
	Type        string `xml:"Type"`
	ID          string `xml:"ID,omitempty"`
	DisplayName string `xml:"DisplayName,omitempty"`
	URI         string `xml:"URI,omitempty"`
}

type Group

type Group struct {
	URI string `xml:"URI"`
}

type Iam

type Iam interface {
	Check(f http.HandlerFunc, actions ...Action) http.HandlerFunc
}

type Identity

type Identity struct {
	Name        string
	Account     *Account
	Credentials []*Credential
	Actions     []Action
}

type IdentityAccessManagement

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

func NewIdentityAccessManagement

func NewIdentityAccessManagement(option *S3ApiServerOption) *IdentityAccessManagement

func (*IdentityAccessManagement) Auth

func (*IdentityAccessManagement) GetAccountIdByEmail

func (iam *IdentityAccessManagement) GetAccountIdByEmail(email string) string

func (*IdentityAccessManagement) GetAccountNameById

func (iam *IdentityAccessManagement) GetAccountNameById(canonicalId string) string

func (*IdentityAccessManagement) LoadS3ApiConfigurationFromBytes

func (iam *IdentityAccessManagement) LoadS3ApiConfigurationFromBytes(content []byte) error

type InitiateMultipartUploadResult

type InitiateMultipartUploadResult struct {
	XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ InitiateMultipartUploadResult"`
	s3.CreateMultipartUploadOutput
}

type Lifecycle

type Lifecycle struct {
	XMLName xml.Name `xml:"LifecycleConfiguration"`
	Rules   []Rule   `xml:"Rule"`
}

Lifecycle - Configuration for bucket lifecycle.

type ListAllMyBuckets

type ListAllMyBuckets struct {
	AWSAccessKeyId string    `xml:"AWSAccessKeyId,omitempty"`
	Timestamp      time.Time `xml:"Timestamp,omitempty"`
	Signature      string    `xml:"Signature,omitempty"`
}

func (*ListAllMyBuckets) MarshalXML

func (t *ListAllMyBuckets) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*ListAllMyBuckets) UnmarshalXML

func (t *ListAllMyBuckets) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type ListAllMyBucketsEntry

type ListAllMyBucketsEntry struct {
	Name         string    `xml:"Name"`
	CreationDate time.Time `xml:"CreationDate"`
}

func (*ListAllMyBucketsEntry) MarshalXML

func (t *ListAllMyBucketsEntry) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*ListAllMyBucketsEntry) UnmarshalXML

func (t *ListAllMyBucketsEntry) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type ListAllMyBucketsList

type ListAllMyBucketsList struct {
	Bucket []ListAllMyBucketsEntry `xml:"Bucket,omitempty"`
}

type ListAllMyBucketsResponse

type ListAllMyBucketsResponse struct {
	ListAllMyBucketsResponse ListAllMyBucketsResult `xml:"ListAllMyBucketsResponse"`
}

type ListAllMyBucketsResult

type ListAllMyBucketsResult struct {
	Owner   CanonicalUser        `xml:"Owner"`
	Buckets ListAllMyBucketsList `xml:"Buckets"`
}

type ListBucket

type ListBucket struct {
	Bucket         string    `xml:"Bucket"`
	Prefix         string    `xml:"Prefix,omitempty"`
	Marker         string    `xml:"Marker,omitempty"`
	MaxKeys        int       `xml:"MaxKeys,omitempty"`
	Delimiter      string    `xml:"Delimiter,omitempty"`
	AWSAccessKeyId string    `xml:"AWSAccessKeyId,omitempty"`
	Timestamp      time.Time `xml:"Timestamp,omitempty"`
	Signature      string    `xml:"Signature,omitempty"`
	Credential     string    `xml:"Credential,omitempty"`
}

func (*ListBucket) MarshalXML

func (t *ListBucket) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*ListBucket) UnmarshalXML

func (t *ListBucket) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type ListBucketResponse

type ListBucketResponse struct {
	ListBucketResponse ListBucketResult `xml:"ListBucketResponse"`
}

type ListBucketResult

type ListBucketResult struct {
	Metadata       []MetadataEntry `xml:"Metadata,omitempty"`
	Name           string          `xml:"Name"`
	Prefix         string          `xml:"Prefix"`
	Marker         string          `xml:"Marker"`
	NextMarker     string          `xml:"NextMarker,omitempty"`
	MaxKeys        int             `xml:"MaxKeys"`
	Delimiter      string          `xml:"Delimiter,omitempty"`
	IsTruncated    bool            `xml:"IsTruncated"`
	Contents       []ListEntry     `xml:"Contents,omitempty"`
	CommonPrefixes []PrefixEntry   `xml:"CommonPrefixes,omitempty"`
	EncodingType   string          `xml:"EncodingType"`
}

type ListBucketResultV2

type ListBucketResultV2 struct {
	XMLName               xml.Name       `xml:"http://s3.amazonaws.com/doc/2006-03-01/ ListBucketResult"`
	Name                  string         `xml:"Name"`
	Prefix                string         `xml:"Prefix"`
	MaxKeys               uint16         `xml:"MaxKeys"`
	Delimiter             string         `xml:"Delimiter,omitempty"`
	IsTruncated           bool           `xml:"IsTruncated"`
	Contents              []ListEntry    `xml:"Contents,omitempty"`
	CommonPrefixes        []PrefixEntry  `xml:"CommonPrefixes,omitempty"`
	ContinuationToken     OptionalString `xml:"ContinuationToken,omitempty"`
	NextContinuationToken string         `xml:"NextContinuationToken,omitempty"`
	EncodingType          string         `xml:"EncodingType,omitempty"`
	KeyCount              int            `xml:"KeyCount"`
	StartAfter            string         `xml:"StartAfter,omitempty"`
}

type ListEntry

type ListEntry struct {
	Key          string        `xml:"Key"`
	LastModified time.Time     `xml:"LastModified"`
	ETag         string        `xml:"ETag"`
	Size         int64         `xml:"Size"`
	Owner        CanonicalUser `xml:"Owner,omitempty"`
	StorageClass StorageClass  `xml:"StorageClass"`
}

func (*ListEntry) MarshalXML

func (t *ListEntry) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*ListEntry) UnmarshalXML

func (t *ListEntry) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type ListMultipartUploadsResult

type ListMultipartUploadsResult struct {
	XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ ListMultipartUploadsResult"`

	// copied from s3.ListMultipartUploadsOutput, the Uploads is not converting to <Upload></Upload>
	Bucket             *string               `type:"string"`
	Delimiter          *string               `type:"string"`
	EncodingType       *string               `type:"string" enum:"EncodingType"`
	IsTruncated        *bool                 `type:"boolean"`
	KeyMarker          *string               `type:"string"`
	MaxUploads         *int64                `type:"integer"`
	NextKeyMarker      *string               `type:"string"`
	NextUploadIdMarker *string               `type:"string"`
	Prefix             *string               `type:"string"`
	UploadIdMarker     *string               `type:"string"`
	Upload             []*s3.MultipartUpload `locationName:"Upload" type:"list" flattened:"true"`
}

type ListPartsResult

type ListPartsResult struct {
	XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ ListPartsResult"`

	// copied from s3.ListPartsOutput, the Parts is not converting to <Part></Part>
	Bucket               *string    `type:"string"`
	IsTruncated          *bool      `type:"boolean"`
	Key                  *string    `min:"1" type:"string"`
	MaxParts             *int64     `type:"integer"`
	NextPartNumberMarker *int64     `type:"integer"`
	PartNumberMarker     *int64     `type:"integer"`
	Part                 []*s3.Part `locationName:"Part" type:"list" flattened:"true"`
	StorageClass         *string    `type:"string" enum:"StorageClass"`
	UploadId             *string    `type:"string"`
}

type ListVersionsResponse

type ListVersionsResponse struct {
	ListVersionsResponse ListVersionsResult `xml:"ListVersionsResponse"`
}

type ListVersionsResult

type ListVersionsResult struct {
	Metadata            []MetadataEntry   `xml:"Metadata,omitempty"`
	Name                string            `xml:"Name"`
	Prefix              string            `xml:"Prefix"`
	KeyMarker           string            `xml:"KeyMarker"`
	VersionIdMarker     string            `xml:"VersionIdMarker"`
	NextKeyMarker       string            `xml:"NextKeyMarker,omitempty"`
	NextVersionIdMarker string            `xml:"NextVersionIdMarker,omitempty"`
	MaxKeys             int               `xml:"MaxKeys"`
	Delimiter           string            `xml:"Delimiter,omitempty"`
	IsTruncated         bool              `xml:"IsTruncated"`
	Version             VersionEntry      `xml:"Version,omitempty"`
	DeleteMarker        DeleteMarkerEntry `xml:"DeleteMarker,omitempty"`
	CommonPrefixes      []PrefixEntry     `xml:"CommonPrefixes,omitempty"`
}

type ListingCursor

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

type LoggingSettings

type LoggingSettings struct {
	TargetBucket string            `xml:"TargetBucket"`
	TargetPrefix string            `xml:"TargetPrefix"`
	TargetGrants AccessControlList `xml:"TargetGrants,omitempty"`
}

type MetadataDirective

type MetadataDirective string

May be one of COPY, REPLACE

type MetadataEntry

type MetadataEntry struct {
	Name  string `xml:"Name"`
	Value string `xml:"Value"`
}

type MfaDeleteStatus

type MfaDeleteStatus string

May be one of Enabled, Disabled

type NotificationConfiguration

type NotificationConfiguration struct {
	TopicConfiguration []TopicConfiguration `xml:"TopicConfiguration,omitempty"`
}

type ObjectIdentifier

type ObjectIdentifier struct {
	ObjectName string `xml:"Key"`
}

/ ObjectIdentifier carries key name for the object to delete.

type OptionalString

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

func (OptionalString) MarshalXML

func (o OptionalString) MarshalXML(e *xml.Encoder, startElement xml.StartElement) error

type Payer

type Payer string

May be one of BucketOwner, Requester

type Permission

type Permission string

May be one of READ, WRITE, READ_ACP, WRITE_ACP, FULL_CONTROL

type PostResponse

type PostResponse struct {
	Location string `xml:"Location"`
	Bucket   string `xml:"Bucket"`
	Key      string `xml:"Key"`
	ETag     string `xml:"ETag"`
}

type Prefix

type Prefix struct {
	XMLName xml.Name `xml:"Prefix"`
	// contains filtered or unexported fields
}

Prefix holds the prefix xml tag in <Rule> and <Filter>

func (Prefix) MarshalXML

func (p Prefix) MarshalXML(e *xml.Encoder, startElement xml.StartElement) error

MarshalXML encodes Prefix field into an XML form.

func (Prefix) String

func (p Prefix) String() string

func (*Prefix) UnmarshalXML

func (p *Prefix) UnmarshalXML(d *xml.Decoder, startElement xml.StartElement) error

type PrefixEntry

type PrefixEntry struct {
	Prefix string `xml:"Prefix"`
}

type PutObject

type PutObject struct {
	Bucket            string            `xml:"Bucket"`
	Key               string            `xml:"Key"`
	Metadata          []MetadataEntry   `xml:"Metadata,omitempty"`
	ContentLength     int64             `xml:"ContentLength"`
	AccessControlList AccessControlList `xml:"AccessControlList,omitempty"`
	StorageClass      StorageClass      `xml:"StorageClass,omitempty"`
	AWSAccessKeyId    string            `xml:"AWSAccessKeyId,omitempty"`
	Timestamp         time.Time         `xml:"Timestamp,omitempty"`
	Signature         string            `xml:"Signature,omitempty"`
	Credential        string            `xml:"Credential,omitempty"`
}

func (*PutObject) MarshalXML

func (t *PutObject) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*PutObject) UnmarshalXML

func (t *PutObject) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type PutObjectInline

type PutObjectInline struct {
	Bucket            string            `xml:"Bucket"`
	Key               string            `xml:"Key"`
	Metadata          []MetadataEntry   `xml:"Metadata,omitempty"`
	Data              []byte            `xml:"Data"`
	ContentLength     int64             `xml:"ContentLength"`
	AccessControlList AccessControlList `xml:"AccessControlList,omitempty"`
	StorageClass      StorageClass      `xml:"StorageClass,omitempty"`
	AWSAccessKeyId    string            `xml:"AWSAccessKeyId,omitempty"`
	Timestamp         time.Time         `xml:"Timestamp,omitempty"`
	Signature         string            `xml:"Signature,omitempty"`
	Credential        string            `xml:"Credential,omitempty"`
}

func (*PutObjectInline) MarshalXML

func (t *PutObjectInline) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*PutObjectInline) UnmarshalXML

func (t *PutObjectInline) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type PutObjectInlineResponse

type PutObjectInlineResponse struct {
	PutObjectInlineResponse PutObjectResult `xml:"PutObjectInlineResponse"`
}

type PutObjectResponse

type PutObjectResponse struct {
	PutObjectResponse PutObjectResult `xml:"PutObjectResponse"`
}

type PutObjectResult

type PutObjectResult struct {
	ETag         string    `xml:"ETag"`
	LastModified time.Time `xml:"LastModified"`
}

func (*PutObjectResult) MarshalXML

func (t *PutObjectResult) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*PutObjectResult) UnmarshalXML

func (t *PutObjectResult) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type RequestPaymentConfiguration

type RequestPaymentConfiguration struct {
	Payer Payer `xml:"Payer"`
}

type Result

type Result struct {
	Status Status `xml:"Status"`
}

type Rule

type Rule struct {
	XMLName    xml.Name   `xml:"Rule"`
	ID         string     `xml:"ID,omitempty"`
	Status     ruleStatus `xml:"Status"`
	Filter     Filter     `xml:"Filter,omitempty"`
	Prefix     Prefix     `xml:"Prefix,omitempty"`
	Expiration Expiration `xml:"Expiration,omitempty"`
	Transition Transition `xml:"Transition,omitempty"`
}

Rule - a rule for lifecycle configuration.

type S3ApiServer

type S3ApiServer struct {
	s3_pb.UnimplementedSeaweedS3Server
	// contains filtered or unexported fields
}

func NewS3ApiServer

func NewS3ApiServer(router *mux.Router, option *S3ApiServerOption) (s3ApiServer *S3ApiServer, err error)

func (*S3ApiServer) AbortMultipartUploadHandler

func (s3a *S3ApiServer) AbortMultipartUploadHandler(w http.ResponseWriter, r *http.Request)

AbortMultipartUploadHandler - Aborts multipart upload.

func (*S3ApiServer) AdjustedUrl

func (s3a *S3ApiServer) AdjustedUrl(location *filer_pb.Location) string

func (*S3ApiServer) CompleteMultipartUploadHandler

func (s3a *S3ApiServer) CompleteMultipartUploadHandler(w http.ResponseWriter, r *http.Request)

CompleteMultipartUploadHandler - Completes multipart upload.

func (*S3ApiServer) Configure

func (*S3ApiServer) CopyObjectHandler

func (s3a *S3ApiServer) CopyObjectHandler(w http.ResponseWriter, r *http.Request)

func (*S3ApiServer) CopyObjectPartHandler

func (s3a *S3ApiServer) CopyObjectPartHandler(w http.ResponseWriter, r *http.Request)

func (*S3ApiServer) DeleteBucketCorsHandler

func (s3a *S3ApiServer) DeleteBucketCorsHandler(w http.ResponseWriter, r *http.Request)

DeleteBucketCorsHandler Delete bucket CORS https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketCors.html

func (*S3ApiServer) DeleteBucketHandler

func (s3a *S3ApiServer) DeleteBucketHandler(w http.ResponseWriter, r *http.Request)

func (*S3ApiServer) DeleteBucketLifecycleHandler

func (s3a *S3ApiServer) DeleteBucketLifecycleHandler(w http.ResponseWriter, r *http.Request)

DeleteBucketLifecycleHandler Delete Bucket Lifecycle https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketLifecycle.html

func (*S3ApiServer) DeleteBucketOwnershipControls

func (s3a *S3ApiServer) DeleteBucketOwnershipControls(w http.ResponseWriter, r *http.Request)

DeleteBucketOwnershipControls https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketOwnershipControls.html

func (*S3ApiServer) DeleteBucketPolicyHandler

func (s3a *S3ApiServer) DeleteBucketPolicyHandler(w http.ResponseWriter, r *http.Request)

DeleteBucketPolicyHandler Delete bucket Policy https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketPolicy.html

func (*S3ApiServer) DeleteMultipleObjectsHandler

func (s3a *S3ApiServer) DeleteMultipleObjectsHandler(w http.ResponseWriter, r *http.Request)

DeleteMultipleObjectsHandler - Delete multiple objects

func (*S3ApiServer) DeleteObjectHandler

func (s3a *S3ApiServer) DeleteObjectHandler(w http.ResponseWriter, r *http.Request)

func (*S3ApiServer) DeleteObjectTaggingHandler

func (s3a *S3ApiServer) DeleteObjectTaggingHandler(w http.ResponseWriter, r *http.Request)

DeleteObjectTaggingHandler Delete object tagging API reference: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObjectTagging.html

func (*S3ApiServer) GetBucketAclHandler

func (s3a *S3ApiServer) GetBucketAclHandler(w http.ResponseWriter, r *http.Request)

GetBucketAclHandler Get Bucket ACL https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketAcl.html

func (*S3ApiServer) GetBucketCorsHandler

func (s3a *S3ApiServer) GetBucketCorsHandler(w http.ResponseWriter, r *http.Request)

GetBucketCorsHandler Get bucket CORS https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketCors.html

func (*S3ApiServer) GetBucketLifecycleConfigurationHandler

func (s3a *S3ApiServer) GetBucketLifecycleConfigurationHandler(w http.ResponseWriter, r *http.Request)

GetBucketLifecycleConfigurationHandler Get Bucket Lifecycle configuration https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycleConfiguration.html

func (*S3ApiServer) GetBucketLocationHandler

func (s3a *S3ApiServer) GetBucketLocationHandler(w http.ResponseWriter, r *http.Request)

GetBucketLocationHandler Get bucket location https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLocation.html

func (*S3ApiServer) GetBucketOwnershipControls

func (s3a *S3ApiServer) GetBucketOwnershipControls(w http.ResponseWriter, r *http.Request)

GetBucketOwnershipControls https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketOwnershipControls.html

func (*S3ApiServer) GetBucketPolicyHandler

func (s3a *S3ApiServer) GetBucketPolicyHandler(w http.ResponseWriter, r *http.Request)

GetBucketPolicyHandler Get bucket Policy https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketPolicy.html

func (*S3ApiServer) GetBucketRequestPaymentHandler

func (s3a *S3ApiServer) GetBucketRequestPaymentHandler(w http.ResponseWriter, r *http.Request)

GetBucketRequestPaymentHandler Get bucket location https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketRequestPayment.html

func (*S3ApiServer) GetBucketVersioningHandler

func (s3a *S3ApiServer) GetBucketVersioningHandler(w http.ResponseWriter, r *http.Request)

GetBucketVersioningHandler Get Bucket Versioning status https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketVersioning.html

func (*S3ApiServer) GetDataCenter

func (s3a *S3ApiServer) GetDataCenter() string

func (*S3ApiServer) GetObjectAclHandler

func (s3a *S3ApiServer) GetObjectAclHandler(w http.ResponseWriter, r *http.Request)

GetObjectAclHandler Put object ACL https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAcl.html

func (*S3ApiServer) GetObjectHandler

func (s3a *S3ApiServer) GetObjectHandler(w http.ResponseWriter, r *http.Request)

func (*S3ApiServer) GetObjectTaggingHandler

func (s3a *S3ApiServer) GetObjectTaggingHandler(w http.ResponseWriter, r *http.Request)

GetObjectTaggingHandler - GET object tagging API reference: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectTagging.html

func (*S3ApiServer) HeadBucketHandler

func (s3a *S3ApiServer) HeadBucketHandler(w http.ResponseWriter, r *http.Request)

func (*S3ApiServer) HeadObjectHandler

func (s3a *S3ApiServer) HeadObjectHandler(w http.ResponseWriter, r *http.Request)

func (*S3ApiServer) ListBucketsHandler

func (s3a *S3ApiServer) ListBucketsHandler(w http.ResponseWriter, r *http.Request)

func (*S3ApiServer) ListMultipartUploadsHandler

func (s3a *S3ApiServer) ListMultipartUploadsHandler(w http.ResponseWriter, r *http.Request)

ListMultipartUploadsHandler - Lists multipart uploads.

func (*S3ApiServer) ListObjectPartsHandler

func (s3a *S3ApiServer) ListObjectPartsHandler(w http.ResponseWriter, r *http.Request)

ListObjectPartsHandler - Lists object parts in a multipart upload.

func (*S3ApiServer) ListObjectsV1Handler

func (s3a *S3ApiServer) ListObjectsV1Handler(w http.ResponseWriter, r *http.Request)

func (*S3ApiServer) ListObjectsV2Handler

func (s3a *S3ApiServer) ListObjectsV2Handler(w http.ResponseWriter, r *http.Request)

func (*S3ApiServer) NewMultipartUploadHandler

func (s3a *S3ApiServer) NewMultipartUploadHandler(w http.ResponseWriter, r *http.Request)

NewMultipartUploadHandler - New multipart upload.

func (*S3ApiServer) PostPolicyBucketHandler

func (s3a *S3ApiServer) PostPolicyBucketHandler(w http.ResponseWriter, r *http.Request)

func (*S3ApiServer) PutBucketAclHandler

func (s3a *S3ApiServer) PutBucketAclHandler(w http.ResponseWriter, r *http.Request)

PutBucketAclHandler Put bucket ACL only responds success if the ACL is private. https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketAcl.html //

func (*S3ApiServer) PutBucketCorsHandler

func (s3a *S3ApiServer) PutBucketCorsHandler(w http.ResponseWriter, r *http.Request)

PutBucketCorsHandler Put bucket CORS https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketCors.html

func (*S3ApiServer) PutBucketHandler

func (s3a *S3ApiServer) PutBucketHandler(w http.ResponseWriter, r *http.Request)

func (*S3ApiServer) PutBucketLifecycleConfigurationHandler

func (s3a *S3ApiServer) PutBucketLifecycleConfigurationHandler(w http.ResponseWriter, r *http.Request)

PutBucketLifecycleConfigurationHandler Put Bucket Lifecycle configuration https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html

func (*S3ApiServer) PutBucketOwnershipControls

func (s3a *S3ApiServer) PutBucketOwnershipControls(w http.ResponseWriter, r *http.Request)

PutBucketOwnershipControls https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketOwnershipControls.html

func (*S3ApiServer) PutBucketPolicyHandler

func (s3a *S3ApiServer) PutBucketPolicyHandler(w http.ResponseWriter, r *http.Request)

PutBucketPolicyHandler Put bucket Policy https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketPolicy.html

func (*S3ApiServer) PutBucketVersioningHandler

func (s3a *S3ApiServer) PutBucketVersioningHandler(w http.ResponseWriter, r *http.Request)

PutBucketVersioningHandler Put bucket Versionin https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketVersioning.html

func (*S3ApiServer) PutObjectAclHandler

func (s3a *S3ApiServer) PutObjectAclHandler(w http.ResponseWriter, r *http.Request)

PutObjectAclHandler Put object ACL https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectAcl.html

func (*S3ApiServer) PutObjectHandler

func (s3a *S3ApiServer) PutObjectHandler(w http.ResponseWriter, r *http.Request)

func (*S3ApiServer) PutObjectLegalHoldHandler

func (s3a *S3ApiServer) PutObjectLegalHoldHandler(w http.ResponseWriter, r *http.Request)

PutObjectLegalHoldHandler Put object Legal Hold https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectLegalHold.html

func (*S3ApiServer) PutObjectLockConfigurationHandler

func (s3a *S3ApiServer) PutObjectLockConfigurationHandler(w http.ResponseWriter, r *http.Request)

PutObjectLockConfigurationHandler Put object Lock configuration https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectLockConfiguration.html

func (*S3ApiServer) PutObjectPartHandler

func (s3a *S3ApiServer) PutObjectPartHandler(w http.ResponseWriter, r *http.Request)

PutObjectPartHandler - Put an object part in a multipart upload.

func (*S3ApiServer) PutObjectRetentionHandler

func (s3a *S3ApiServer) PutObjectRetentionHandler(w http.ResponseWriter, r *http.Request)

PutObjectRetentionHandler Put object Retention https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectRetention.html

func (*S3ApiServer) PutObjectTaggingHandler

func (s3a *S3ApiServer) PutObjectTaggingHandler(w http.ResponseWriter, r *http.Request)

PutObjectTaggingHandler Put object tagging API reference: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectTagging.html

func (*S3ApiServer) StatusHandler

func (s3a *S3ApiServer) StatusHandler(w http.ResponseWriter, r *http.Request)

func (*S3ApiServer) WithFilerClient

func (s3a *S3ApiServer) WithFilerClient(streamingMode bool, fn func(filer_pb.SeaweedFilerClient) error) error

type S3ApiServerOption

type S3ApiServerOption struct {
	Filer                     pb.ServerAddress
	Port                      int
	Config                    string
	DomainName                string
	AllowedOrigins            []string
	BucketsPath               string
	GrpcDialOption            grpc.DialOption
	AllowEmptyFolder          bool
	AllowDeleteBucketNotEmpty bool
	LocalFilerSocket          string
	DataCenter                string
	FilerGroup                string
}

type SetBucketAccessControlPolicy

type SetBucketAccessControlPolicy struct {
	Bucket            string            `xml:"Bucket"`
	AccessControlList AccessControlList `xml:"AccessControlList,omitempty"`
	AWSAccessKeyId    string            `xml:"AWSAccessKeyId,omitempty"`
	Timestamp         time.Time         `xml:"Timestamp,omitempty"`
	Signature         string            `xml:"Signature,omitempty"`
	Credential        string            `xml:"Credential,omitempty"`
}

func (*SetBucketAccessControlPolicy) MarshalXML

func (t *SetBucketAccessControlPolicy) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*SetBucketAccessControlPolicy) UnmarshalXML

func (t *SetBucketAccessControlPolicy) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type SetBucketAccessControlPolicyResponse

type SetBucketAccessControlPolicyResponse struct {
}

type SetBucketLoggingStatus

type SetBucketLoggingStatus struct {
	Bucket              string              `xml:"Bucket"`
	AWSAccessKeyId      string              `xml:"AWSAccessKeyId,omitempty"`
	Timestamp           time.Time           `xml:"Timestamp,omitempty"`
	Signature           string              `xml:"Signature,omitempty"`
	Credential          string              `xml:"Credential,omitempty"`
	BucketLoggingStatus BucketLoggingStatus `xml:"BucketLoggingStatus"`
}

func (*SetBucketLoggingStatus) MarshalXML

func (t *SetBucketLoggingStatus) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*SetBucketLoggingStatus) UnmarshalXML

func (t *SetBucketLoggingStatus) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type SetBucketLoggingStatusResponse

type SetBucketLoggingStatusResponse struct {
}

type SetObjectAccessControlPolicy

type SetObjectAccessControlPolicy struct {
	Bucket            string            `xml:"Bucket"`
	Key               string            `xml:"Key"`
	AccessControlList AccessControlList `xml:"AccessControlList"`
	AWSAccessKeyId    string            `xml:"AWSAccessKeyId,omitempty"`
	Timestamp         time.Time         `xml:"Timestamp,omitempty"`
	Signature         string            `xml:"Signature,omitempty"`
	Credential        string            `xml:"Credential,omitempty"`
}

func (*SetObjectAccessControlPolicy) MarshalXML

func (t *SetObjectAccessControlPolicy) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*SetObjectAccessControlPolicy) UnmarshalXML

func (t *SetObjectAccessControlPolicy) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type SetObjectAccessControlPolicyResponse

type SetObjectAccessControlPolicyResponse struct {
}

type Status

type Status struct {
	Code        int    `xml:"Code"`
	Description string `xml:"Description"`
}

type StorageClass

type StorageClass string

May be one of STANDARD, REDUCED_REDUNDANCY, GLACIER, UNKNOWN

type Tag

type Tag struct {
	Key   string `xml:"Key"`
	Value string `xml:"Value"`
}

type TagSet

type TagSet struct {
	Tag []Tag `xml:"Tag"`
}

type Tagging

type Tagging struct {
	XMLName xml.Name `xml:"Tagging"`
	TagSet  TagSet   `xml:"TagSet"`
	Xmlns   string   `xml:"xmlns,attr"`
}

func FromTags

func FromTags(tags map[string]string) (t *Tagging)

func (*Tagging) ToTags

func (t *Tagging) ToTags() map[string]string

type TopicConfiguration

type TopicConfiguration struct {
	Topic string   `xml:"Topic"`
	Event []string `xml:"Event"`
}

type Transition

type Transition struct {
	XMLName      xml.Name  `xml:"Transition"`
	Days         int       `xml:"Days,omitempty"`
	Date         time.Time `xml:"Date,omitempty"`
	StorageClass string    `xml:"StorageClass,omitempty"`
	// contains filtered or unexported fields
}

Transition - transition actions for a rule in lifecycle configuration.

func (Transition) MarshalXML

func (t Transition) MarshalXML(enc *xml.Encoder, start xml.StartElement) error

MarshalXML encodes transition field into an XML form.

type TransitionDays

type TransitionDays int

TransitionDays is a type alias to unmarshal Days in Transition

type User

type User struct {
}

type VersionEntry

type VersionEntry struct {
	Key          string        `xml:"Key"`
	VersionId    string        `xml:"VersionId"`
	IsLatest     bool          `xml:"IsLatest"`
	LastModified time.Time     `xml:"LastModified"`
	ETag         string        `xml:"ETag"`
	Size         int64         `xml:"Size"`
	Owner        CanonicalUser `xml:"Owner,omitempty"`
	StorageClass StorageClass  `xml:"StorageClass"`
}

func (*VersionEntry) MarshalXML

func (t *VersionEntry) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*VersionEntry) UnmarshalXML

func (t *VersionEntry) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type VersioningConfiguration

type VersioningConfiguration struct {
	Status    VersioningStatus `xml:"Status,omitempty"`
	MfaDelete MfaDeleteStatus  `xml:"MfaDelete,omitempty"`
}

type VersioningStatus

type VersioningStatus string

May be one of Enabled, Suspended

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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