lib

package
v0.0.0-...-8ea276c Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2019 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Copyright © 2019 Nuxeo

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	NUM_COPY     = 4
	NUM_CHECKSUM = 1
	QUEUE_SIZE   = 1000000 // 1M
)

Variables

This section is empty.

Functions

func BuildWorkDir

func BuildWorkDir(srcDir string, dotEnv string, configName string) (error, string)

func GenerateDotEnv

func GenerateDotEnv(srcEnv string, dstEnvJs string) error

func S3Sync

func S3Sync(config *Config, srcdir string, bucket string) error

func SessionForBucket

func SessionForBucket(config *Config, bucket string) (*s3.S3, error)

SessionForBucket - For a given S3 bucket, create an approprate session that references the region that this bucket is located in

func SessionNew

func SessionNew(config *Config) *s3.S3

SessionNew - Read the config for default credentials, if not provided use environment based variables

Types

type Action

type Action struct {
	Type     int
	Src      *FileURI
	Dst      *FileURI
	Size     int64
	Checksum string
}

Action for syncing

type Config

type Config struct {
	AccessKey    string
	SecretKey    string
	StorageClass string
	Bucket       string
	Concurrency  int
	PartSize     int64
	CheckMD5     bool
	DryRun       bool
	Verbose      bool
	Recursive    bool
	Force        bool
	SkipExisting bool
	HostBase     string
	HostBucket   string
}

type EnvVar

type EnvVar struct {
	Name  string
	Value string
}

type FileObject

type FileObject struct {
	Source   int64 // used by sync
	Name     string
	Size     int64
	Checksum string
}

type FileURI

type FileURI struct {
	Scheme string
	Bucket string
	Path   string
}

func FileURINew

func FileURINew(path string) (*FileURI, error)

func (*FileURI) Join

func (uri *FileURI) Join(elem string) *FileURI

Do a path.Join() style operation on this FileURI to generate a new one

func (*FileURI) Key

func (uri *FileURI) Key() *string

Return the path as a valid S3 bucket key

func (*FileURI) SetPath

func (uri *FileURI) SetPath(elem string) *FileURI

func (*FileURI) String

func (uri *FileURI) String() string

Return a string version of the path

Jump to

Keyboard shortcuts

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