base: github.com/grailbio/base/grail Index | Files | Directories

package grail

import "github.com/grailbio/base/grail"

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

Index

Package Files

init.go profile.go

type Shutdown Uses

type Shutdown func()

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

func Init Uses

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).

Init also applies a default configuration profile (see package github.com/grailbio/base/config), and adds profile flags to the default flag set. The default profile path used is $HOME/grail/profile.

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

Suggested use:

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

Directories

PathSynopsis
go/net/http/pprof

Package grail imports 11 packages (graph) and is imported by 5 packages. Updated 2019-12-15. Refresh now. Tools for package owners.