config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2015 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GDDirSuffix   = ".gd"
	PathSeparator = fmt.Sprintf("%c", os.PathSeparator)
)

Functions

func IndicesAbsPath

func IndicesAbsPath(dir, child string) string

func LeastNonExistantRoot

func LeastNonExistantRoot(contextAbsPath string) string

Types

type Context

type Context struct {
	ClientId     string `json:"client_id"`
	ClientSecret string `json:"client_secret"`
	RefreshToken string `json:"refresh_token"`
	AbsPath      string `json:"-"`
}

func Discover

func Discover(currentAbsPath string) (context *Context, err error)

Discovers the gd directory, if no gd directory or credentials could be found for the path, returns ErrNoContext.

func Initialize

func Initialize(absPath string) (pathGD string, firstInit bool, c *Context, err error)

func (*Context) AbsPathOf

func (c *Context) AbsPathOf(fileOrDirPath string) string

func (*Context) DeserializeIndex

func (c *Context) DeserializeIndex(dir, path string) (*Index, error)

func (*Context) Read

func (c *Context) Read() (err error)

func (*Context) SerializeIndex

func (c *Context) SerializeIndex(index *Index, p string) (err error)

func (*Context) Write

func (c *Context) Write() (err error)

type Index

type Index struct {
	FileId      string `json:"id"`
	Etag        string `json:"etag"`
	Md5Checksum string `json:"md5"`
	MimeType    string `json:"mtype"`
	ModTime     int64  `json:"mtime"`
	Version     int64  `json:"version"`
	IndexTime   int64  `json:"itime"`
}

type Mount

type Mount struct {
	CreatedMountDir   string
	ShortestMountRoot string
	Points            []*MountPoint
}

func MountPoints

func MountPoints(contextPath, contextAbsPath string, paths []string, hidden bool) (
	mount *Mount, sources []string)

type MountPoint

type MountPoint struct {
	CanClean  bool
	Name      string
	AbsPath   string
	MountPath string
}

func (*MountPoint) Unmount

func (mpt *MountPoint) Unmount() error

Jump to

Keyboard shortcuts

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