grail

package
v0.0.1-really Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2019 License: Apache-2.0 Imports: 7 Imported by: 12

Documentation

Overview

Package grail contains the Init function that all programs are expected to call.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterShutdownCallback

func RegisterShutdownCallback(cb Shutdown)

RegisterShutdownCallback registers a function to be run in the Init shutdown callback. The callbacks will run in the reverse order of registration.

func RunShutdownCallbacks

func RunShutdownCallbacks()

RunShutdownCallbacks run callbacks added in RegisterShutdownCallbacks. This function is not for general use.

Types

type Shutdown

type Shutdown func()

Shutdown is a function that needs to be called to perform the final cleanup.

func Init

func Init() Shutdown

Init should be called once at the beginning at each executable that doesn't use the github.com/grailbio/base/cmdutil. The Shutdown function should be called to perform the final cleanup (closing logs for example).

Note that this function will call flag.Parse().

Suggested use:

shutdown := grail.Init()
defer shutdown()

Directories

Path Synopsis
go

Jump to

Keyboard shortcuts

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