util

package
v0.0.0-...-e3ab1ac Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2016 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppBlessingFromContext

func AppBlessingFromContext(ctx *context.T) (string, error)

AppBlessingFromContext returns an app blessing pattern from the given context. TODO(sadovsky,ashankar): Implement.

func Decode

func Decode(s string) (string, error)

Decode is the inverse of Encode.

func DecodeId

func DecodeId(s string) (wire.Id, error)

DecodeId is the inverse of EncodeId.

func Encode

func Encode(s string) string

Encode escapes a component name for use in a Syncbase object name. In particular, it replaces bytes "%" and "/" with the "%" character followed by the byte's two-digit hex code. Clients using the client library need not escape names themselves; the client library does so on their behalf.

func EncodeId

func EncodeId(id wire.Id) string

EncodeId encodes the given Id for use in a Syncbase object name.

func IsPrefix

func IsPrefix(start, limit string) bool

IsPrefix returns true if start and limit together represent a prefix range. If true, start is the represented prefix.

func ListChildIds

func ListChildIds(ctx *context.T, parentFullName string) ([]wire.Id, error)

ListChildIds returns a sorted list of ids of all children of parentFullName.

func ParseCollectionRowPair

func ParseCollectionRowPair(ctx *context.T, pattern string) (wire.Id, string, error)

ParseCollectionRowPair splits the "<collectionId>/<row>" part of a Syncbase object name into the collection id and the row key or prefix.

func PrefixRangeLimit

func PrefixRangeLimit(p string) string

PrefixRangeLimit returns the limit of the row range for the given prefix.

func PrefixRangeStart

func PrefixRangeStart(p string) string

PrefixRangeStart returns the start of the row range for the given prefix.

func SortIds

func SortIds(ids []wire.Id)

SortIds sorts a list of ids by blessing, then name.

func UserBlessingFromContext

func UserBlessingFromContext(ctx *context.T) (string, error)

UserBlessingFromContext returns a user blessing pattern from the given context. TODO(sadovsky,ashankar): Implement.

func ValidId

func ValidId(id wire.Id) bool

ValidId returns true iff the given Id is a valid database or collection id.

func ValidRowKey

func ValidRowKey(s string) bool

ValidRowKey returns true iff the given string is a valid row key.

Types

type AccessController

type AccessController interface {
	// SetPermissions replaces the current Permissions for an object.
	// For detailed documentation, see Object.SetPermissions.
	SetPermissions(ctx *context.T, perms access.Permissions, version string) error

	// GetPermissions returns the current Permissions for an object.
	// For detailed documentation, see Object.GetPermissions.
	GetPermissions(ctx *context.T) (perms access.Permissions, version string, err error)
}

AccessController provides access control for various syncbase objects.

Jump to

Keyboard shortcuts

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