gdrive

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2022 License: MIT Imports: 10 Imported by: 1

README

Google Drive backend

Parameters

Possible parameters are:

  • google_client_id: The Google Client ID
  • google_client_secret: The Google Client Secret, it shall never be shared
  • token_file: The path of the token file that will be created
  • base_path: The base path of the Google Drive folder

Note: The token file will be updated regularly (every day). It's important that the server can write the token file after its initial creation.

How to use it

Create an app

You can follow these instructions.

Use the created client credentials

You can either define the google_client_id and google_client_secret access params or specify the GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET environment variables.

You should have a config file looking like this one:

{
  "accesses": [
   {
      "user": "gdrive",
      "pass": "gdrive",
      "fs": "gdrive",
      "params": {
        "google_client_id": "*****.apps.googleusercontent.com",
        "google_client_secret": "*****",
        "basePath": "/ftp"
      }
    }
  ]
}
Connect for the first time

You should run the ftpserver in interactive mode. The first time you will login with the "gdrive" user, the server will ask you to open a link, wich will authorize the app you just created and return a code. This code will allow the server to create a token file (named gdrive_token_$username.json by default).

Documentation

Overview

Package gdrive provides a Google Drive access layer

Index

Constants

This section is empty.

Variables

View Source
var ErrMissingGoogleClientCredentials = errors.New("missing the google client credentials")

ErrMissingGoogleClientCredentials is returned when you have specified the google_client_id and/or google_client_secret

Functions

func LoadFs

func LoadFs(access *confpar.Access, logger log.Logger) (afero.Fs, error)

LoadFs loads a file system from an access description

Types

This section is empty.

Jump to

Keyboard shortcuts

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