Documentation

Overview

    Package presignedurl provides the customizations for API clients to fill in presigned URLs into input parameters.

    Index

    Constants

    This section is empty.

    Variables

    This section is empty.

    Functions

    func AddAsIsPresigingMiddleware

    func AddAsIsPresigingMiddleware(stack *middleware.Stack) error

      AddAsIsPresigingMiddleware adds a middleware to the head of the stack that will update the stack's context to be flagged as being invoked for the purpose of presigning.

      func AddMiddleware

      func AddMiddleware(stack *middleware.Stack, opts Options) error

        AddMiddleware adds the Presign URL middleware to the middleware stack.

        func GetIsPresigning

        func GetIsPresigning(ctx context.Context) bool

          GetIsPresigning returns if the context contains the isPresigning sentinel value for presigning flows.

          Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues to clear all stack values.

          func RemoveMiddleware

          func RemoveMiddleware(stack *middleware.Stack) error

            RemoveMiddleware removes the Presign URL middleware from the stack.

            func WithIsPresigning

            func WithIsPresigning(ctx context.Context) context.Context

              WithIsPresigning adds the isPresigning sentinel value to a context to signal that the middleware stack is using the presign flow.

              Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues to clear all stack values.

              Types

              type Options

              type Options struct {
              	// Accessor are the parameter accessors used by this middleware
              	Accessor ParameterAccessor
              
              	// Presigner is the URLPresigner used by the middleware
              	Presigner URLPresigner
              }

                Options provides the set of options needed by the presigned URL middleware.

                type ParameterAccessor

                type ParameterAccessor struct {
                	// GetPresignedURL accessor points to a function that retrieves a presigned url if present
                	GetPresignedURL func(interface{}) (string, bool, error)
                
                	// GetSourceRegion accessor points to a function that retrieves source region for presigned url
                	GetSourceRegion func(interface{}) (string, bool, error)
                
                	// CopyInput accessor points to a function that takes in an input, and returns a copy.
                	CopyInput func(interface{}) (interface{}, error)
                
                	// SetDestinationRegion accessor points to a function that sets destination region on api input struct
                	SetDestinationRegion func(interface{}, string) error
                
                	// SetPresignedURL accessor points to a function that sets presigned url on api input struct
                	SetPresignedURL func(interface{}, string) error
                }

                  ParameterAccessor provides an collection of accessor to for retrieving and setting the values needed to PresignedURL generation

                  type URLPresigner

                  type URLPresigner interface {
                  	// PresignURL presigns a URL.
                  	PresignURL(ctx context.Context, srcRegion string, params interface{}) (*v4.PresignedHTTPRequest, error)
                  }

                    URLPresigner provides the interface to presign the input parameters in to a presigned URL.