boxes

package
v0.0.0-...-856106c Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2019 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const ROOTID string = "root"

Variables

This section is empty.

Functions

func ExchangeToken

func ExchangeToken(authCode string) (string, error)

func GRefreshAuth

func GRefreshAuth() (*oauth2.Token, error)

Refresh google auth token

func GUrlAuth

func GUrlAuth() (string, error)

func ReadFromFile

func ReadFromFile(path string) (string, error)

func TokenFromFile

func TokenFromFile(file string) (*oauth2.Token, error)

Retrieves a token from a local file.

func WriteIntoFile

func WriteIntoFile(path, content string) error

Types

type Box

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

type DriveBox

type DriveBox struct {
	Box
	// contains filtered or unexported fields
}

func (DriveBox) ReadBoxItem

func (box DriveBox) ReadBoxItem() (string, error)

Read a file from google drive

func (DriveBox) WriteBoxItem

func (box DriveBox) WriteBoxItem(content string) error

Write the content item into a file in the box path in subdir of box name

type LocalBox

type LocalBox Box

func (LocalBox) ReadBoxItem

func (box LocalBox) ReadBoxItem() (string, error)

func (LocalBox) WriteBoxItem

func (box LocalBox) WriteBoxItem(content string) error

type Vault

type Vault interface {
	ReadBoxItem() (string, error)
	WriteBoxItem(content string) error
}

func Builder

func Builder(boxPath, boxName, itemName string, token *oauth2.Token) Vault

Jump to

Keyboard shortcuts

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