s3

package
v0.0.0-...-9e48597 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LIST_COMMAND         = "list"
	READ_COMMAND         = "read"
	DOWNLOAD_COMMAND     = "download"
	DELETE_COMMAND       = "delete"
	BATCH_DELETE_COMMAND = "batchDelete"
	UPLOAD_COMMAND       = "upload"
	BATCH_UPLOAD_COMMAND = "batchUpload"
)

Variables

View Source
var ACLs = map[string]bool{
	"private":                   true,
	"public-read":               true,
	"public-read-write":         true,
	"authenticated-read":        true,
	"aws-exec-read":             true,
	"bucket-owner-read":         true,
	"bucket-owner-full-control": true,
}

Functions

This section is empty.

Types

type Action

type Action struct {
	Commands    string                 `validate:"required,oneof=list read download delete batchDelete upload batchUpload"`
	CommandArgs map[string]interface{} `validate:"required"`
}

type BaseCommandArgs

type BaseCommandArgs struct {
	BucketName string `json:"bucketName"`
	SignedURL  bool   `json:"signedURL"`
	Expiry     int64  `json:"expiry" validate:"required_unless=SignedURL false"`
	ObjectKey  string `json:"objectKey" validate:"required"`
}

type BatchDeleteCommandArgs

type BatchDeleteCommandArgs struct {
	BucketName    string   `json:"bucketName"`
	ObjectKeyList []string `json:"objectKeyList" validate:"required,gt=0,dive,required"`
}

type BatchUploadCommandArgs

type BatchUploadCommandArgs struct {
	BucketName     string   `json:"bucketName"`
	ContentType    string   `json:"contentType"`
	Expiry         int64    `json:"expiry"`
	ObjectKeyList  []string `json:"objectKeyList" validate:"required,gt=0,dive,required"`
	ObjectDataList []string `json:"objectDataList"`
}

type CommandExecutor

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

type Connector

type Connector struct {
	ResourceOpts Resource
	ActionOpts   Action
}

func (*Connector) GetMetaInfo

func (s *Connector) GetMetaInfo(resourceOptions map[string]interface{}) (common.MetaInfoResult, error)

func (*Connector) Run

func (s *Connector) Run(resourceOptions map[string]interface{}, actionOptions map[string]interface{}, rawActionOptions map[string]interface{}) (common.RuntimeResult, error)

func (*Connector) TestConnection

func (s *Connector) TestConnection(resourceOptions map[string]interface{}) (common.ConnectionResult, error)

func (*Connector) ValidateActionTemplate

func (s *Connector) ValidateActionTemplate(actionOptions map[string]interface{}) (common.ValidateResult, error)

func (*Connector) ValidateResourceOptions

func (s *Connector) ValidateResourceOptions(resourceOptions map[string]interface{}) (common.ValidateResult, error)

type ListCommandArgs

type ListCommandArgs struct {
	BucketName string `json:"bucketName"`
	Prefix     string `json:"prefix"`
	Delimiter  string `json:"delimiter"`
	SignedURL  bool   `json:"signedURL"`
	Expiry     int64  `json:"expiry" validate:"required_unless=SignedURL false"`
	MaxKeys    int32  `json:"maxKeys"`
}

type Resource

type Resource struct {
	BucketName      string
	Region          string `validate:"required"`
	ACL             string
	Endpoint        bool
	BaseURL         string `validate:"required_unless=Endpoint false"`
	AccessKeyID     string `validate:"required"`
	SecretAccessKey string `validate:"required"`
}

type UploadCommandArgs

type UploadCommandArgs struct {
	BucketName  string `json:"bucketName"`
	ContentType string `json:"contentType"`
	Expiry      int64  `json:"expiry"`
	ObjectKey   string `json:"objectKey" validate:"required"`
	ObjectData  string `json:"objectData"`
}

Jump to

Keyboard shortcuts

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