context

package
v0.0.0-...-4d97ccf Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2017 License: Apache-2.0 Imports: 1 Imported by: 2

Documentation

Overview

Package context provides user state for a handler.

Index

Constants

View Source
const (
	// PathDelimiter is the delimiter to use between file path components.
	PathDelimiter = "/"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

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

Context represents the metadata of the current handler session.

func (*Context) Bucket

func (c *Context) Bucket() string

Bucket returns the bucket name as a string.

func (*Context) CalculatePath

func (c *Context) CalculatePath(p string) []string

CalculatePath determines the context's path based on the string provided.

For instance, provding "directory/another" will append "directory" and "another" to the path. Providing "../directory" will move up a level in the path and then append "directory".

CalculatePath differs from UpdatePath in that the underlying path of the context is not actually updated, the result is simply returned.

func (*Context) IsRoot

func (c *Context) IsRoot() bool

IsRoot indicates if the context is at the root

func (*Context) Path

func (c *Context) Path() string

Path returns the full current path as a string.

func (*Context) PathWithoutBucket

func (c *Context) PathWithoutBucket() string

PathWithoutBucket returns the current path without the Bucket, as a string.

func (*Context) UpdatePath

func (c *Context) UpdatePath(p string)

UpdatePath modifies the context's path based on the string provided.

UpdatePath differs from CalculatePath in that the underlying path of the context is updated.

Jump to

Keyboard shortcuts

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