Documentation
¶
Index ¶
- Variables
- type AWSCredentialProvider
- type CommandError
- type Object
- type Resource
- type Service
- func (s *Service) AuthorizeUpload(ctx context.Context, project, environment, bucket, key string) (UploadAuthorization, error)
- func (s *Service) Create(ctx context.Context, input Resource, createdBy string) (Resource, error)
- func (s *Service) Delete(ctx context.Context, project, environment, bucket string) (Resource, error)
- func (s *Service) DeleteObject(ctx context.Context, project, environment, bucket, key string) error
- func (s *Service) Invalidate(ctx context.Context, project, environment, bucket string, paths []string) error
- func (s *Service) List(ctx context.Context, project, environment string, refresh bool) ([]Resource, error)
- func (s *Service) Objects(ctx context.Context, project, environment, bucket, prefix string) ([]Object, error)
- func (s *Service) Refresh(ctx context.Context, project, environment, bucket string) (Resource, error)
- func (s *Service) UploadObject(ctx context.Context, project, environment, bucket, key, contentType string, ...) error
- type Store
- type UploadAuthorization
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type AWSCredentialProvider ¶
type CommandError ¶
func (*CommandError) Error ¶
func (e *CommandError) Error() string
func (*CommandError) Unwrap ¶
func (e *CommandError) Unwrap() error
type Resource ¶
type Resource struct {
ProjectKey string `json:"project_key"`
EnvironmentKey string `json:"environment_key"`
DisplayName string `json:"display_name"`
BucketName string `json:"bucket_name"`
Region string `json:"region"`
CORSOrigins []string `json:"cors_origins"`
DistributionID string `json:"distribution_id,omitempty"`
DistributionARN string `json:"distribution_arn,omitempty"`
DomainName string `json:"domain_name,omitempty"`
CDNURL string `json:"cdn_url,omitempty"`
OACID string `json:"oac_id,omitempty"`
Status string `json:"status"`
LastError string `json:"last_error,omitempty"`
CreatedBy string `json:"created_by"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func New ¶
func New(config *appconfig.Config, store Store, credentials AWSCredentialProvider) *Service
func (*Service) AuthorizeUpload ¶
func (*Service) DeleteObject ¶
func (*Service) Invalidate ¶
func (*Service) UploadObject ¶
func (s *Service) UploadObject(ctx context.Context, project, environment, bucket, key, contentType string, body io.Reader) error
UploadObject provides a same-origin fallback when a browser cannot reach a presigned S3 URL because of a local network policy, extension, proxy, or transient CORS failure. The HTTP layer enforces the request size limit. A private temporary file is used because aws s3api put-object requires a file path for binary payloads; it is removed on every return path.
Click to show internal directories.
Click to hide internal directories.