s3

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyTemplate

func ApplyTemplate(policy string, params PolicyTemplateParams) (string, error)

func IsNotFound

func IsNotFound(err error) bool

func IsPublicPolicy added in v0.9.3

func IsPublicPolicy(policy string) bool

IsPublicPolicy reports whether a bucket policy contains an Allow statement with a wildcard principal.

func ValidatePolicy added in v0.9.3

func ValidatePolicy(policy string) error

ValidatePolicy validates the required shape of a bucket policy.

Types

type Client

type Client interface {
	Prune(ctx context.Context, region, bucket string) error
	SetBucketPolicy(ctx context.Context, region, bucketName, policy string) error
	GetBucketPolicy(ctx context.Context, region, bucketName string) (string, error)
}

type ClientS3

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

func New

func New(
	clientCache cache.Cache,
	s3AccessKey, s3SecretKey string,
	s3SSL bool,
) *ClientS3

func NewWithEndpoint added in v0.9.1

func NewWithEndpoint(
	endpoint string,
	s3AccessKey, s3SecretKey string,
	s3SSL bool,
) *ClientS3

func (*ClientS3) GetBucketPolicy

func (c *ClientS3) GetBucketPolicy(ctx context.Context, region, bucket string) (string, error)

func (*ClientS3) Prune

func (c *ClientS3) Prune(ctx context.Context, region, bucket string) error

func (*ClientS3) SetBucketPolicy

func (c *ClientS3) SetBucketPolicy(ctx context.Context, region, bucket, policy string) error

type PolicyTemplateParams

type PolicyTemplateParams struct {
	BucketName string
}

Jump to

Keyboard shortcuts

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