gcssync

package module
v0.0.0-...-ee2ba8a Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2014 License: MIT Imports: 10 Imported by: 0

README

gcssync

TOC:

Syncs files with a Google Cloud Storage bucket.

When syncing it checks for modifcation and update time to prevent uploading files in the next run.

Usage

NAME:
   gcssync - Sync files with Google Cloud Storage

USAGE:
   gcssync [global options] command [command options] [arguments...]

VERSION:
   0.0.0

COMMANDS:
   list, l  List remote files
   upload, u    Upload a single file
   sync, s  Syncs a folder to a Google Cloudstorage bucket
   help, h  Shows a list of commands or help for one command
   
GLOBAL OPTIONS:
   --cachefile 'cache.json' Cache file for caching auth tokens [$AUTH_CACHE_FILE]
   --bucketname, -b         Name of bucket [$BUCKET_NAME]
   --projectid, -p      Google project [$PROJECT_ID]
   --clientid, -c       Auth client id [$AUTH_CLIENT_ID]
   --clientsecret, -s       Client secrect [$AUTH_CLIENT_SECRET]
   --code           Authorization Code [$AUTH_CODE]
   --help, -h           show help
   --version, -v        print the version

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is connected to Google Cloud Storage bucket

func NewClient

func NewClient(oauthConfig *oauth.Config, authCode string, serviceConfig *ServiceConfig) (*Client, error)

NewClient connects to and authenficates against Google Cloud Storage

func (*Client) GetBucketname

func (c *Client) GetBucketname() string

GetBucketname return the name of the bucket the client is connected to

func (*Client) ListFiles

func (c *Client) ListFiles() ([]*storage.Object, error)

ListFiles returns all files in the connected bucket

func (*Client) SyncFolder

func (c *Client) SyncFolder(from, to string)

SyncFolder uploads all files from a local directory to a bucket files will be skipped if there are already on that bucket and the local version is older than the version on the bucket

func (*Client) UploadFile

func (c *Client) UploadFile(localName, targetName string) (bool, *storage.Object, error)

UploadFile uploads one to local file to the bucket and makes it public readable

type ServiceConfig

type ServiceConfig struct {
	ProjectID  string
	BucketName string
}

ServiceConfig holds all informations about the bucket and project

Directories

Path Synopsis
Godeps
_workspace/src/code.google.com/p/goauth2/oauth
Package oauth supports making OAuth2-authenticated HTTP requests.
Package oauth supports making OAuth2-authenticated HTTP requests.
_workspace/src/code.google.com/p/goauth2/oauth/example
This program makes a call to the specified API, authenticated with OAuth2.
This program makes a call to the specified API, authenticated with OAuth2.
_workspace/src/code.google.com/p/goauth2/oauth/jwt
The jwt package provides support for creating credentials for OAuth2 service account requests.
The jwt package provides support for creating credentials for OAuth2 service account requests.
_workspace/src/code.google.com/p/goauth2/oauth/jwt/example
This program makes a read only call to the Google Cloud Storage API, authenticated with OAuth2.
This program makes a read only call to the Google Cloud Storage API, authenticated with OAuth2.
_workspace/src/code.google.com/p/google-api-go-client/googleapi
Package googleapi contains the common code shared by all Google API libraries.
Package googleapi contains the common code shared by all Google API libraries.
_workspace/src/code.google.com/p/google-api-go-client/googleapi/internal/uritemplates
Package uritemplates is a level 4 implementation of RFC 6570 (URI Template, http://tools.ietf.org/html/rfc6570).
Package uritemplates is a level 4 implementation of RFC 6570 (URI Template, http://tools.ietf.org/html/rfc6570).
_workspace/src/code.google.com/p/google-api-go-client/googleapi/transport
Package transport contains HTTP transports used to make authenticated API requests.
Package transport contains HTTP transports used to make authenticated API requests.
_workspace/src/code.google.com/p/google-api-go-client/storage/v1
Package storage provides access to the Cloud Storage API.
Package storage provides access to the Cloud Storage API.
_workspace/src/github.com/codegangsta/cli
Package cli provides a minimal framework for creating and organizing command line Go applications.
Package cli provides a minimal framework for creating and organizing command line Go applications.
_workspace/src/github.com/dustin/go-humanize
Package humanize converts boring ugly numbers to human-friendly strings.
Package humanize converts boring ugly numbers to human-friendly strings.
cmd

Jump to

Keyboard shortcuts

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