gsutil

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2015 License: Apache-2.0 Imports: 10 Imported by: 7

Documentation

Overview

Package gsutil is collection of helper functions for storage tools.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureGracefulExit

func EnsureGracefulExit(gs ...graphstore.Service)

EnsureGracefulExit will try to close each gs when notified of an Interrupt, SIGTERM, or Kill signal and immediately exit the program unsuccessfully. Any errors will be logged. This function should only be called once and closing the GraphStores manually is still needed when the program does not receive a signal to quit.

func Flag

func Flag(gs *graphstore.Service, name, usage string)

Flag defines a GraphStore flag with the specified name and usage string.

func LogClose

func LogClose(ctx context.Context, gs graphstore.Service)

LogClose closes gs and logs any resulting error.

func ParseGraphStore

func ParseGraphStore(str string) (graphstore.Service, error)

ParseGraphStore returns a GraphStore for the given specification.

func Register

func Register(kind string, h Handler)

Register exposes the given Handler to ParseGraphStore. Each string starting with kind+":" will be passed to the given Handler. A kind can only be registered once.

func RegisterDefault

func RegisterDefault(kind string)

RegisterDefault gives ParseGraphStore a fallback kind if not given any "____:" prefix. A default can only be set once.

Types

type Handler

type Handler func(spec string) (graphstore.Service, error)

Handler returns a graphstore.Service based on the given specification. See also: Register(string, Handler).

Jump to

Keyboard shortcuts

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