env

package
v2.11.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2018 License: BSD-3-Clause Imports: 11 Imported by: 30

README

env

This package implements libkbfs.Context in terms of libkb.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppStateUpdater

type AppStateUpdater interface {
	// NextAppStateUpdate returns a channel that app state changes
	// are sent to.
	NextAppStateUpdate(lastState *keybase1.AppState) <-chan keybase1.AppState
}

AppStateUpdater is an interface for things that need to listen to app state changes.

type Context

type Context interface {
	AppStateUpdater
	GetRunMode() kbconst.RunMode
	GetLogDir() string
	GetDataDir() string
	GetMountDir() (string, error)
	ConfigureSocketInfo() (err error)
	CheckService() error
	GetSocket(clearError bool) (net.Conn, rpc.Transporter, bool, error)
	NewRPCLogFactory() rpc.LogFactory
	GetKBFSSocket(clearError bool) (net.Conn, rpc.Transporter, bool, error)
	BindToKBFSSocket() (net.Listener, error)
}

Context defines the environment for this package

type EmptyAppStateUpdater

type EmptyAppStateUpdater struct{}

EmptyAppStateUpdater is an implementation of AppStateUpdater that never returns an update, for testing.

func (EmptyAppStateUpdater) NextAppStateUpdate

func (easu EmptyAppStateUpdater) NextAppStateUpdate(lastState *keybase1.AppState) <-chan keybase1.AppState

NextAppStateUpdate implements AppStateUpdater.

type KBFSContext

type KBFSContext struct {
	// contains filtered or unexported fields
}

KBFSContext is an implementation for libkbfs.Context

func NewContext

func NewContext() *KBFSContext

NewContext constructs a context. This should only be called once in main functions.

func NewContextFromGlobalContext

func NewContextFromGlobalContext(g *libkb.GlobalContext) *KBFSContext

NewContextFromGlobalContext constructs a context

func (*KBFSContext) BindToKBFSSocket

func (c *KBFSContext) BindToKBFSSocket() (net.Listener, error)

BindToKBFSSocket binds to the socket configured in `c.kbfsSocket`.

func (*KBFSContext) CheckService

func (c *KBFSContext) CheckService() error

CheckService checks if the service is running and returns nil if so, and an error otherwise.

func (*KBFSContext) ConfigureSocketInfo

func (c *KBFSContext) ConfigureSocketInfo() error

ConfigureSocketInfo configures a socket

func (*KBFSContext) GetDataDir

func (c *KBFSContext) GetDataDir() string

GetDataDir returns log dir

func (*KBFSContext) GetKBFSSocket

func (c *KBFSContext) GetKBFSSocket(clearError bool) (
	net.Conn, rpc.Transporter, bool, error)

GetKBFSSocket dials the socket configured in `c.kbfsSocket`. Adapted from github.com/keybase/client/go/libkb.GlobalContext.GetSocket.

func (*KBFSContext) GetLogDir

func (c *KBFSContext) GetLogDir() string

GetLogDir returns log dir

func (*KBFSContext) GetMountDir added in v1.0.40

func (c *KBFSContext) GetMountDir() (string, error)

GetMountDir returns mount dir

func (*KBFSContext) GetRunMode

func (c *KBFSContext) GetRunMode() kbconst.RunMode

GetRunMode returns run mode

func (*KBFSContext) GetSocket

func (c *KBFSContext) GetSocket(clearError bool) (
	net.Conn, rpc.Transporter, bool, error)

GetSocket returns a socket

func (*KBFSContext) NewRPCLogFactory

func (c *KBFSContext) NewRPCLogFactory() rpc.LogFactory

NewRPCLogFactory constructs an RPC logger

func (*KBFSContext) NextAppStateUpdate

func (c *KBFSContext) NextAppStateUpdate(lastState *keybase1.AppState) <-chan keybase1.AppState

NextAppStateUpdate implements AppStateUpdater.

Jump to

Keyboard shortcuts

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