s3

package
v0.0.0-...-ff4e629 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const ErrorCodeInternalError = "InternalError"

ErrorCodeInternalError means there was an internal error.

View Source
const ErrorCodeInvalidAccessKeyID = "InvalidAccessKeyId"

ErrorCodeInvalidAccessKeyID means there was an invalid access key provided.

View Source
const ErrorCodeNoSuchBucket = "NoSuchBucket"

ErrorCodeNoSuchBucket means the specified bucket does not exist.

View Source
const ErrorInvalidRequest = "InvalidRequest"

ErrorInvalidRequest means there was an invalid request.

Variables

This section is empty.

Functions

func AuthorizationHeaderAccessKey

func AuthorizationHeaderAccessKey(authorizationHeader string) string

AuthorizationHeaderAccessKey attempts to extract the (unverified) access key from the Authorization header.

func BucketPolicy

func BucketPolicy(bucketName string, roleName string) (json.RawMessage, error)

BucketPolicy generates an S3 bucket policy for role.

func BucketPolicyRole

func BucketPolicyRole(bucketName string, jsonPolicy json.RawMessage) (string, error)

BucketPolicyRole compares the given bucket policy with the predefined bucket policies and returns the role name of the matching policy.

Types

type Bucket

type Bucket struct {
	CreationDate time.Time
	Name         string
}

Bucket S3 bucket.

type Error

type Error struct {
	Code       string
	Message    string
	Resource   string
	RequestID  string `xml:"RequestId"`
	BucketName string `xml:"BucketName,omitempty"`
	HostID     string `xml:"HostId"`
}

Error S3 error response.

func (*Error) Response

func (r *Error) Response(w http.ResponseWriter)

Response writes error as HTTP response.

type ListAllMyBucketsResult

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

ListAllMyBucketsResult S3 list my buckets.

func (*ListAllMyBucketsResult) Response

Response writes error as HTTP response.

type Owner

type Owner struct {
	ID          string
	DisplayName string
}

Owner S3 owner.

type Policy

type Policy struct {
	Version   string
	Statement []PolicyStatement
}

Policy defines the S3 policy.

type PolicyStatement

type PolicyStatement struct {
	Effect   string
	Action   []string
	Resource []string
}

PolicyStatement defines the S3 policy statement.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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