s3

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2026 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Credentials

type Credentials struct {
	AccessKeyID      string `yaml:"accessKeyId" jsonschema:"required"`
	SecretAccessKey  string `yaml:"secretAccessKey" jsonschema:"required"`
	SessionToken     string `yaml:"sessionToken,omitempty"`
	Endpoint         string `yaml:"endpoint,omitempty"`
	Region           string `yaml:"region,omitempty"`
	S3ForcePathStyle bool   `yaml:"s3ForcePathStyle,omitempty"`
}

func NewCredentials

func NewCredentials(accessKeyID, secretAccessKey string) *Credentials

func NewCredentialsFromEnv

func NewCredentialsFromEnv() *Credentials

Create new credentials from the standard AWS environment variables.

func (*Credentials) AWSConfig

func (c *Credentials) AWSConfig() aws.Config

func (*Credentials) GetAccessKeyID

func (c *Credentials) GetAccessKeyID() string

func (*Credentials) GetEndpoint

func (c *Credentials) GetEndpoint() string

func (*Credentials) GetRegion

func (c *Credentials) GetRegion() string

func (*Credentials) GetS3ForcePathStyle

func (c *Credentials) GetS3ForcePathStyle() bool

func (*Credentials) GetSecretAccessKey

func (c *Credentials) GetSecretAccessKey() string

func (*Credentials) GetSessionToken

func (c *Credentials) GetSessionToken() string

func (*Credentials) WithAccessKeyID

func (c *Credentials) WithAccessKeyID(id string) *Credentials

func (*Credentials) WithEndpoint

func (c *Credentials) WithEndpoint(endpoint string) *Credentials

func (*Credentials) WithRegion

func (c *Credentials) WithRegion(region string) *Credentials

func (*Credentials) WithS3ForcePathStyle

func (c *Credentials) WithS3ForcePathStyle(forcePathStyle bool) *Credentials

func (*Credentials) WithSecretAccessKey

func (c *Credentials) WithSecretAccessKey(key string) *Credentials

func (*Credentials) WithSessionToken

func (c *Credentials) WithSessionToken(token string) *Credentials

type CredentialsInterface

type CredentialsInterface interface {
	GetAccessKeyID() string
	GetSecretAccessKey() string
	GetSessionToken() string
	GetRegion() string
	GetEndpoint() string
	GetS3ForcePathStyle() bool
	// AWSConfig returns a v2 SDK config carrying the static credentials and region. The endpoint and
	// path-style settings are not part of aws.Config in the v2 SDK; they are applied as s3.Options when
	// the client is constructed (see LocalRuntime.Sync).
	AWSConfig() aws.Config
}

type LocalRuntime

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

func NewLocalRuntime

func NewLocalRuntime() *LocalRuntime

func (*LocalRuntime) Sync

func (lr *LocalRuntime) Sync(ctx *contexts.Context, credentials CredentialsInterface, src, dest string, asOf time.Time) (err error)

Sync makes the destination an exact mirror of the source: changed/new objects are transferred and items missing from the source are removed. See Runtime.Sync for the asOf semantics and selectObjectsAsOf for the point-in-time reconstruction.

type MockCredentialsInterface

type MockCredentialsInterface struct {
	mock.Mock
}

MockCredentialsInterface is an autogenerated mock type for the CredentialsInterface type

func NewMockCredentialsInterface

func NewMockCredentialsInterface(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockCredentialsInterface

NewMockCredentialsInterface creates a new instance of MockCredentialsInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockCredentialsInterface) AWSConfig

func (_m *MockCredentialsInterface) AWSConfig() aws.Config

AWSConfig provides a mock function with no fields

func (*MockCredentialsInterface) EXPECT

func (*MockCredentialsInterface) GetAccessKeyID

func (_m *MockCredentialsInterface) GetAccessKeyID() string

GetAccessKeyID provides a mock function with no fields

func (*MockCredentialsInterface) GetEndpoint

func (_m *MockCredentialsInterface) GetEndpoint() string

GetEndpoint provides a mock function with no fields

func (*MockCredentialsInterface) GetRegion

func (_m *MockCredentialsInterface) GetRegion() string

GetRegion provides a mock function with no fields

func (*MockCredentialsInterface) GetS3ForcePathStyle

func (_m *MockCredentialsInterface) GetS3ForcePathStyle() bool

GetS3ForcePathStyle provides a mock function with no fields

func (*MockCredentialsInterface) GetSecretAccessKey

func (_m *MockCredentialsInterface) GetSecretAccessKey() string

GetSecretAccessKey provides a mock function with no fields

func (*MockCredentialsInterface) GetSessionToken

func (_m *MockCredentialsInterface) GetSessionToken() string

GetSessionToken provides a mock function with no fields

type MockCredentialsInterface_AWSConfig_Call

type MockCredentialsInterface_AWSConfig_Call struct {
	*mock.Call
}

MockCredentialsInterface_AWSConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AWSConfig'

func (*MockCredentialsInterface_AWSConfig_Call) Return

func (*MockCredentialsInterface_AWSConfig_Call) Run

func (*MockCredentialsInterface_AWSConfig_Call) RunAndReturn

type MockCredentialsInterface_Expecter

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

func (*MockCredentialsInterface_Expecter) AWSConfig

AWSConfig is a helper method to define mock.On call

func (*MockCredentialsInterface_Expecter) GetAccessKeyID

GetAccessKeyID is a helper method to define mock.On call

func (*MockCredentialsInterface_Expecter) GetEndpoint

GetEndpoint is a helper method to define mock.On call

func (*MockCredentialsInterface_Expecter) GetRegion

GetRegion is a helper method to define mock.On call

func (*MockCredentialsInterface_Expecter) GetS3ForcePathStyle

GetS3ForcePathStyle is a helper method to define mock.On call

func (*MockCredentialsInterface_Expecter) GetSecretAccessKey

GetSecretAccessKey is a helper method to define mock.On call

func (*MockCredentialsInterface_Expecter) GetSessionToken

GetSessionToken is a helper method to define mock.On call

type MockCredentialsInterface_GetAccessKeyID_Call

type MockCredentialsInterface_GetAccessKeyID_Call struct {
	*mock.Call
}

MockCredentialsInterface_GetAccessKeyID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAccessKeyID'

func (*MockCredentialsInterface_GetAccessKeyID_Call) Return

func (*MockCredentialsInterface_GetAccessKeyID_Call) Run

func (*MockCredentialsInterface_GetAccessKeyID_Call) RunAndReturn

type MockCredentialsInterface_GetEndpoint_Call

type MockCredentialsInterface_GetEndpoint_Call struct {
	*mock.Call
}

MockCredentialsInterface_GetEndpoint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEndpoint'

func (*MockCredentialsInterface_GetEndpoint_Call) Return

func (*MockCredentialsInterface_GetEndpoint_Call) Run

func (*MockCredentialsInterface_GetEndpoint_Call) RunAndReturn

type MockCredentialsInterface_GetRegion_Call

type MockCredentialsInterface_GetRegion_Call struct {
	*mock.Call
}

MockCredentialsInterface_GetRegion_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRegion'

func (*MockCredentialsInterface_GetRegion_Call) Return

func (*MockCredentialsInterface_GetRegion_Call) Run

func (*MockCredentialsInterface_GetRegion_Call) RunAndReturn

type MockCredentialsInterface_GetS3ForcePathStyle_Call

type MockCredentialsInterface_GetS3ForcePathStyle_Call struct {
	*mock.Call
}

MockCredentialsInterface_GetS3ForcePathStyle_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetS3ForcePathStyle'

func (*MockCredentialsInterface_GetS3ForcePathStyle_Call) Return

func (*MockCredentialsInterface_GetS3ForcePathStyle_Call) Run

func (*MockCredentialsInterface_GetS3ForcePathStyle_Call) RunAndReturn

type MockCredentialsInterface_GetSecretAccessKey_Call

type MockCredentialsInterface_GetSecretAccessKey_Call struct {
	*mock.Call
}

MockCredentialsInterface_GetSecretAccessKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSecretAccessKey'

func (*MockCredentialsInterface_GetSecretAccessKey_Call) Return

func (*MockCredentialsInterface_GetSecretAccessKey_Call) Run

func (*MockCredentialsInterface_GetSecretAccessKey_Call) RunAndReturn

type MockCredentialsInterface_GetSessionToken_Call

type MockCredentialsInterface_GetSessionToken_Call struct {
	*mock.Call
}

MockCredentialsInterface_GetSessionToken_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSessionToken'

func (*MockCredentialsInterface_GetSessionToken_Call) Return

func (*MockCredentialsInterface_GetSessionToken_Call) Run

func (*MockCredentialsInterface_GetSessionToken_Call) RunAndReturn

type MockRuntime

type MockRuntime struct {
	mock.Mock
}

MockRuntime is an autogenerated mock type for the Runtime type

func NewMockRuntime

func NewMockRuntime(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockRuntime

NewMockRuntime creates a new instance of MockRuntime. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockRuntime) EXPECT

func (_m *MockRuntime) EXPECT() *MockRuntime_Expecter

func (*MockRuntime) Sync

func (_m *MockRuntime) Sync(ctx *contexts.Context, credentials CredentialsInterface, src string, dest string, asOf time.Time) error

Sync provides a mock function with given fields: ctx, credentials, src, dest, asOf

type MockRuntime_Expecter

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

func (*MockRuntime_Expecter) Sync

func (_e *MockRuntime_Expecter) Sync(ctx interface{}, credentials interface{}, src interface{}, dest interface{}, asOf interface{}) *MockRuntime_Sync_Call

Sync is a helper method to define mock.On call

  • ctx *contexts.Context
  • credentials CredentialsInterface
  • src string
  • dest string
  • asOf time.Time

type MockRuntime_Sync_Call

type MockRuntime_Sync_Call struct {
	*mock.Call
}

MockRuntime_Sync_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Sync'

func (*MockRuntime_Sync_Call) Return

func (*MockRuntime_Sync_Call) Run

func (_c *MockRuntime_Sync_Call) Run(run func(ctx *contexts.Context, credentials CredentialsInterface, src string, dest string, asOf time.Time)) *MockRuntime_Sync_Call

func (*MockRuntime_Sync_Call) RunAndReturn

type Mocks3API added in v0.0.13

type Mocks3API struct {
	mock.Mock
}

Mocks3API is an autogenerated mock type for the s3API type

func NewMocks3API added in v0.0.13

func NewMocks3API(t interface {
	mock.TestingT
	Cleanup(func())
}) *Mocks3API

NewMocks3API creates a new instance of Mocks3API. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*Mocks3API) DeleteObject added in v0.0.13

func (_m *Mocks3API) DeleteObject(_a0 context.Context, _a1 *services3.DeleteObjectInput, _a2 ...func(*services3.Options)) (*services3.DeleteObjectOutput, error)

DeleteObject provides a mock function with given fields: _a0, _a1, _a2

func (*Mocks3API) EXPECT added in v0.0.13

func (_m *Mocks3API) EXPECT() *Mocks3API_Expecter

func (*Mocks3API) GetBucketVersioning added in v0.0.13

GetBucketVersioning provides a mock function with given fields: _a0, _a1, _a2

func (*Mocks3API) GetObject added in v0.0.13

func (_m *Mocks3API) GetObject(_a0 context.Context, _a1 *services3.GetObjectInput, _a2 ...func(*services3.Options)) (*services3.GetObjectOutput, error)

GetObject provides a mock function with given fields: _a0, _a1, _a2

func (*Mocks3API) ListObjectVersions added in v0.0.13

ListObjectVersions provides a mock function with given fields: _a0, _a1, _a2

func (*Mocks3API) ListObjectsV2 added in v0.0.13

func (_m *Mocks3API) ListObjectsV2(_a0 context.Context, _a1 *services3.ListObjectsV2Input, _a2 ...func(*services3.Options)) (*services3.ListObjectsV2Output, error)

ListObjectsV2 provides a mock function with given fields: _a0, _a1, _a2

func (*Mocks3API) PutObject added in v0.0.13

func (_m *Mocks3API) PutObject(_a0 context.Context, _a1 *services3.PutObjectInput, _a2 ...func(*services3.Options)) (*services3.PutObjectOutput, error)

PutObject provides a mock function with given fields: _a0, _a1, _a2

type Mocks3API_DeleteObject_Call added in v0.0.13

type Mocks3API_DeleteObject_Call struct {
	*mock.Call
}

Mocks3API_DeleteObject_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteObject'

func (*Mocks3API_DeleteObject_Call) Return added in v0.0.13

func (*Mocks3API_DeleteObject_Call) Run added in v0.0.13

func (*Mocks3API_DeleteObject_Call) RunAndReturn added in v0.0.13

type Mocks3API_Expecter added in v0.0.13

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

func (*Mocks3API_Expecter) DeleteObject added in v0.0.13

func (_e *Mocks3API_Expecter) DeleteObject(_a0 interface{}, _a1 interface{}, _a2 ...interface{}) *Mocks3API_DeleteObject_Call

DeleteObject is a helper method to define mock.On call

  • _a0 context.Context
  • _a1 *services3.DeleteObjectInput
  • _a2 ...func(*services3.Options)

func (*Mocks3API_Expecter) GetBucketVersioning added in v0.0.13

func (_e *Mocks3API_Expecter) GetBucketVersioning(_a0 interface{}, _a1 interface{}, _a2 ...interface{}) *Mocks3API_GetBucketVersioning_Call

GetBucketVersioning is a helper method to define mock.On call

  • _a0 context.Context
  • _a1 *services3.GetBucketVersioningInput
  • _a2 ...func(*services3.Options)

func (*Mocks3API_Expecter) GetObject added in v0.0.13

func (_e *Mocks3API_Expecter) GetObject(_a0 interface{}, _a1 interface{}, _a2 ...interface{}) *Mocks3API_GetObject_Call

GetObject is a helper method to define mock.On call

  • _a0 context.Context
  • _a1 *services3.GetObjectInput
  • _a2 ...func(*services3.Options)

func (*Mocks3API_Expecter) ListObjectVersions added in v0.0.13

func (_e *Mocks3API_Expecter) ListObjectVersions(_a0 interface{}, _a1 interface{}, _a2 ...interface{}) *Mocks3API_ListObjectVersions_Call

ListObjectVersions is a helper method to define mock.On call

  • _a0 context.Context
  • _a1 *services3.ListObjectVersionsInput
  • _a2 ...func(*services3.Options)

func (*Mocks3API_Expecter) ListObjectsV2 added in v0.0.13

func (_e *Mocks3API_Expecter) ListObjectsV2(_a0 interface{}, _a1 interface{}, _a2 ...interface{}) *Mocks3API_ListObjectsV2_Call

ListObjectsV2 is a helper method to define mock.On call

  • _a0 context.Context
  • _a1 *services3.ListObjectsV2Input
  • _a2 ...func(*services3.Options)

func (*Mocks3API_Expecter) PutObject added in v0.0.13

func (_e *Mocks3API_Expecter) PutObject(_a0 interface{}, _a1 interface{}, _a2 ...interface{}) *Mocks3API_PutObject_Call

PutObject is a helper method to define mock.On call

  • _a0 context.Context
  • _a1 *services3.PutObjectInput
  • _a2 ...func(*services3.Options)

type Mocks3API_GetBucketVersioning_Call added in v0.0.13

type Mocks3API_GetBucketVersioning_Call struct {
	*mock.Call
}

Mocks3API_GetBucketVersioning_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBucketVersioning'

func (*Mocks3API_GetBucketVersioning_Call) Return added in v0.0.13

func (*Mocks3API_GetBucketVersioning_Call) Run added in v0.0.13

func (*Mocks3API_GetBucketVersioning_Call) RunAndReturn added in v0.0.13

type Mocks3API_GetObject_Call added in v0.0.13

type Mocks3API_GetObject_Call struct {
	*mock.Call
}

Mocks3API_GetObject_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetObject'

func (*Mocks3API_GetObject_Call) Return added in v0.0.13

func (*Mocks3API_GetObject_Call) Run added in v0.0.13

func (*Mocks3API_GetObject_Call) RunAndReturn added in v0.0.13

type Mocks3API_ListObjectVersions_Call added in v0.0.13

type Mocks3API_ListObjectVersions_Call struct {
	*mock.Call
}

Mocks3API_ListObjectVersions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListObjectVersions'

func (*Mocks3API_ListObjectVersions_Call) Return added in v0.0.13

func (*Mocks3API_ListObjectVersions_Call) Run added in v0.0.13

func (*Mocks3API_ListObjectVersions_Call) RunAndReturn added in v0.0.13

type Mocks3API_ListObjectsV2_Call added in v0.0.13

type Mocks3API_ListObjectsV2_Call struct {
	*mock.Call
}

Mocks3API_ListObjectsV2_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListObjectsV2'

func (*Mocks3API_ListObjectsV2_Call) Return added in v0.0.13

func (*Mocks3API_ListObjectsV2_Call) Run added in v0.0.13

func (*Mocks3API_ListObjectsV2_Call) RunAndReturn added in v0.0.13

type Mocks3API_PutObject_Call added in v0.0.13

type Mocks3API_PutObject_Call struct {
	*mock.Call
}

Mocks3API_PutObject_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PutObject'

func (*Mocks3API_PutObject_Call) Return added in v0.0.13

func (*Mocks3API_PutObject_Call) Run added in v0.0.13

func (*Mocks3API_PutObject_Call) RunAndReturn added in v0.0.13

type Runtime

type Runtime interface {
	// Sync copies objects from src to dest. Exactly one of src/dest is an s3://bucket/prefix URL and the
	// other is a local directory path. asOf is the event's shared consistency point: on a download
	// (s3 -> local) a non-zero asOf captures the bucket as of that instant (point-in-time) rather than its
	// latest state, provided the bucket has versioning enabled; a zero asOf (and every upload) is a
	// latest-state sync.
	Sync(ctx *contexts.Context, credentials CredentialsInterface, src string, dest string, asOf time.Time) error
}

Represents a place (i.e. local or remote) where commands can run.

Jump to

Keyboard shortcuts

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