v.io: v.io/x/ref/runtime/factories/library Index | Files

package library

import "v.io/x/ref/runtime/factories/library"

Package library implements a RuntimeFactory suitable for building a Vanadium library that is linked into other applications. It is configured via a set of exported variables as well as optionally via the v.io/x/ref/lib/flags package which allows for both internal configuration as well as via the command line or environment. Client packages (factories) that wish to be configured via the command line must call EnableCommadLineFlags, all other users should use the flags package's 'SetDefault...' methods. This scheme allows this package to be broadly used to create 'factories' and other initialization mechanisms whilst reducing code duplication.

The pubsub.Publisher mechanism is used for communicating networking settings to the rpc.Server implementation of the runtime and publishes the Settings it expects.


Package Files



var (
    // LogToStderr is the equivalent of --logtostderr
    LogToStderr vlog.LogToStderr
    // AlsoLogToStderr is the equivalent of --alsologtostderr
    AlsoLogToStderr vlog.AlsoLogToStderr
    // LogDir is the equivalent of --log_dir
    LogDir vlog.LogDir
    // Level is the equivalent of --v
    Level vlog.Level
    // StderrThreshold is the equivalent of --stderrthreshold
    StderrThreshold = vlog.StderrThreshold(vlog.ErrorLog)
    // ModuleSpec is the equivalent of --vmodule
    ModuleSpec vlog.ModuleSpec
    // FilepathSpec is the equivalent of --vpath
    FilepathSpec vlog.FilepathSpec
    // TraceLocation is the equivalent of --log_backtrace_at
    TraceLocation vlog.TraceLocation
    // MaxStackBufSize is the equivalent of --max_stack_buf_size
    MaxStackBufSize vlog.MaxStackBufSize

    // LoggingOpts are passed to the logging initialization functions.
    LoggingOpts = []vlog.LoggingOpts{}

    // Roam controls whether roaming is enabled.
    Roam = false

    // CloudVM controls whether virtualization/cloud configuration is enabled.
    CloudVM = false

    // ReservedNameDispatcher controls whether a dispatcher is created
    // for the reserved names on an RPC dispatcher. If it is set then
    // its authorization will be determined by the PermissionsFlags and
    // in particular the 'runtime' file therein.
    ReservedNameDispatcher = false

    // ConfigureLoggingFromFlags controls whether the logging related variables
    // above are used for configuring logging, or if command line flags
    // are used instead.
    ConfigureLoggingFromFlags = false

    // PermissionsSpec specifies the permissions to be stored in the context
    // and thus used by default.
    PermissionsSpec access.PermissionsSpec

    // ConfigurePermissionsFromFlags controls whether the permissions
    // related variable above is used for configuring permissions, or if
    // command line flags are used instead.
    ConfigurePermissionsFromFlags = false

    // AllowMultipleInitializations controls whether the runtime can
    // be initialized multiple times. The shutdown callback must be called
    // between multiple initializations.
    AllowMultipleInitializations = false

    // ConnectionExpiryDuration sets the rate at which cached connections
    // will be considered for eviction from the cache.
    ConnectionExpiryDuration = 10 * time.Minute

func EnableCommandlineFlags Uses

func EnableCommandlineFlags()

EnableCommandlineFlags enables use of command line flags.

func EnableFlags Uses

func EnableFlags(fs *flag.FlagSet, parse bool) error

EnableFlags enables the use of flags on the specified flag set and returns the newly created v.io/x/ref/lib/flags.Flags to allow for external parsing by the caller if need be. It will optionally parse the newly created and registered flags.

func Init Uses

func Init(ctx *context.T) (v23.Runtime, *context.T, v23.Shutdown, error)

Init creates a new v23.Runtime.

func VirtualizedFlags Uses

func VirtualizedFlags() (flags.VirtualizedFlags, bool)

VirtualizedFlags flags returns a copy of flags.VirtualizedFlags as obtained from the command line and/or environment via the flags package and an indication of whether the flag group was enabled.

Package library imports 23 packages (graph) and is imported by 7 packages. Updated 2020-10-22. Refresh now. Tools for package owners.