Documentation

Overview

Example (Flags)
Output:

before {}
after  {"RemoteAddr":"1.2.3.4:5678","Listeners":"/ip4/127.0.0.1/tcp/9091/grpc"}
Example (Noflags)
Output:

true

Index

Examples

Constants

View Source
const (
	PerformancePreset = "performance"
	AnonymityPreset   = "anonymity"
	VolatilePreset    = "volatile"

	TorDisabled = "disabled"
	TorOptional = "optional"
	TorRequired = "required"
)
View Source
const InMemoryDir = ":memory:"

Variables

This section is empty.

Functions

func ReplaceGRPCLogger

func ReplaceGRPCLogger(l *zap.Logger)

Types

type Manager

type Manager struct {
	Logging struct {
		Format      string `json:"Format,omitempty"`
		Logfile     string `json:"Logfile,omitempty"`
		Filters     string `json:"Filters,omitempty"`
		Tracer      string `json:"Tracer,omitempty"`
		Service     string `json:"Service,omitempty"`
		RingFilters string `json:"RingFilters,omitempty"`
		RingSize    uint   `json:"RingSize,omitempty"`
		// contains filtered or unexported fields
	} `json:"Logging,omitempty"`
	Metrics struct {
		Listener string `json:"Listener,omitempty"`
		Pedantic bool   `json:"Pedantic,omitempty"`
		// contains filtered or unexported fields
	} `json:"Metrics,omitempty"`
	Datastore struct {
		Dir              string `json:"Dir,omitempty"`
		InMemory         bool   `json:"InMemory,omitempty"`
		LowMemoryProfile bool   `json:"LowMemoryProfile,omitempty"`
		// contains filtered or unexported fields
	} `json:"Datastore,omitempty"`
	Node struct {
		Preset   string `json:"preset"`
		Protocol struct {
			SwarmListeners    string `json:"SwarmListeners,omitempty"`
			IPFSAPIListeners  string `json:"IPFSAPIListeners,omitempty"`
			IPFSWebUIListener string `json:"IPFSWebUIListener,omitempty"`
			Announce          string `json:"Announce,omitempty"`
			NoAnnounce        string `json:"NoAnnounce,omitempty"`
			LocalDiscovery    bool   `json:"LocalDiscovery,omitempty"`
			Ble               struct {
				Enable bool                   `json:"Enable,omitempty"`
				Driver proximity.NativeDriver `json:"Driver,omitempty"`
			}
			Nearby struct {
				Enable bool                   `json:"Enable,omitempty"`
				Driver proximity.NativeDriver `json:"Driver,omitempty"`
			}
			MultipeerConnectivity bool          `json:"MultipeerConnectivity,omitempty"`
			MinBackoff            time.Duration `json:"MinBackoff,omitempty"`
			MaxBackoff            time.Duration `json:"MaxBackoff,omitempty"`
			DisableIPFSNetwork    bool          `json:"DisableIPFSNetwork,omitempty"`
			RdvpMaddrs            string        `json:"RdvpMaddrs,omitempty"`
			AuthSecret            string        `json:"AuthSecret,omitempty"`
			AuthPublicKey         string        `json:"AuthPublicKey,omitempty"`
			PollInterval          time.Duration `json:"PollInterval,omitempty"`
			Tor                   struct {
				Mode       string `json:"Mode,omitempty"`
				BinaryPath string `json:"BinaryPath,omitempty"`
			} `json:"Tor,omitempty"`
			// FIXME: Remove this option, this is a temporary fix
			RelayHack bool `json:"RelayHack,omitempty"`
			// contains filtered or unexported fields
		}
		Messenger struct {
			DisableGroupMonitor  bool   `json:"DisableGroupMonitor,omitempty"`
			DisplayName          string `json:"DisplayName,omitempty"`
			DisableNotifications bool   `json:"DisableNotifications,omitempty"`
			RebuildSqlite        bool   `json:"RebuildSqlite,omitempty"`
			MessengerSqliteOpts  string `json:"MessengerSqliteOpts,omitempty"`
			ExportPathToRestore  string `json:"ExportPathToRestore,omitempty"`
			// contains filtered or unexported fields
		}
		GRPC struct {
			RemoteAddr string `json:"RemoteAddr,omitempty"`
			Listeners  string `json:"Listeners,omitempty"`
			// contains filtered or unexported fields
		} `json:"GRPC,omitempty"`
	} `json:"Node,omitempty"`
	InitTimeout time.Duration `json:"InitTimeout,omitempty"`
	SessionID   string        `json:"sessionID,omitempty"`
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context) (*Manager, error)

func (*Manager) AdvancedHelp

func (m *Manager) AdvancedHelp() string

func (*Manager) Close

func (m *Manager) Close(prog *progress.Progress) error

func (*Manager) DisableIPFSNetwork

func (m *Manager) DisableIPFSNetwork()

func (*Manager) GetContext

func (m *Manager) GetContext() context.Context

func (*Manager) GetDatastoreDir

func (m *Manager) GetDatastoreDir() (string, error)

func (*Manager) GetGRPCClientConn

func (m *Manager) GetGRPCClientConn() (*grpc.ClientConn, error)

func (*Manager) GetGRPCListeners

func (m *Manager) GetGRPCListeners() []grpcutil.Listener

func (*Manager) GetGRPCServer

func (m *Manager) GetGRPCServer() (*grpc.Server, *grpcgw.ServeMux, error)

func (*Manager) GetLifecycleManager

func (m *Manager) GetLifecycleManager() *lifecycle.Manager

func (*Manager) GetLocalIPFS

func (m *Manager) GetLocalIPFS() (ipfsutil.ExtendedCoreAPI, *ipfs_core.IpfsNode, error)

func (*Manager) GetLocalMessengerServer

func (m *Manager) GetLocalMessengerServer() (messengertypes.MessengerServiceServer, error)

func (*Manager) GetLocalProtocolServer

func (m *Manager) GetLocalProtocolServer() (bertyprotocol.Service, error)

func (*Manager) GetLogger

func (m *Manager) GetLogger() (*zap.Logger, error)

func (*Manager) GetMessengerClient

func (m *Manager) GetMessengerClient() (messengertypes.MessengerServiceClient, error)

func (*Manager) GetMessengerDB

func (m *Manager) GetMessengerDB() (*gorm.DB, error)

func (*Manager) GetMetricsRegistry

func (m *Manager) GetMetricsRegistry() (*prometheus.Registry, error)

func (*Manager) GetNotificationManager

func (m *Manager) GetNotificationManager() (notification.Manager, error)

func (*Manager) GetOrbitDB

func (m *Manager) GetOrbitDB() (*bertyprotocol.BertyOrbitDB, error)

func (*Manager) GetProtocolClient

func (m *Manager) GetProtocolClient() (protocoltypes.ProtocolServiceClient, error)

func (*Manager) GetRootDatastore

func (m *Manager) GetRootDatastore() (datastore.Batching, error)

func (*Manager) RunWorkers

func (m *Manager) RunWorkers() error

func (*Manager) SetBleDriver

func (m *Manager) SetBleDriver(d proximity.NativeDriver)

    Set the Java Android BLE driver

    func (*Manager) SetLifecycleManager

    func (m *Manager) SetLifecycleManager(manager *lifecycle.Manager)

    func (*Manager) SetLogger

    func (m *Manager) SetLogger(logger *zap.Logger)

    func (*Manager) SetNBDriver

    func (m *Manager) SetNBDriver(d proximity.NativeDriver)

      Set the Java Android Nearby driver

      func (*Manager) SetNotificationManager

      func (m *Manager) SetNotificationManager(manager notification.Manager)

      func (*Manager) SetupDatastoreFlags

      func (m *Manager) SetupDatastoreFlags(fs *flag.FlagSet)

      func (*Manager) SetupDefaultGRPCListenersFlags

      func (m *Manager) SetupDefaultGRPCListenersFlags(fs *flag.FlagSet)

      func (*Manager) SetupEmptyGRPCListenersFlags

      func (m *Manager) SetupEmptyGRPCListenersFlags(fs *flag.FlagSet)

      func (*Manager) SetupInitTimeout

      func (m *Manager) SetupInitTimeout(fs *flag.FlagSet)

      func (*Manager) SetupLocalIPFSFlags

      func (m *Manager) SetupLocalIPFSFlags(fs *flag.FlagSet)

      func (*Manager) SetupLocalMessengerServerFlags

      func (m *Manager) SetupLocalMessengerServerFlags(fs *flag.FlagSet)

      func (*Manager) SetupLocalProtocolServerFlags

      func (m *Manager) SetupLocalProtocolServerFlags(fs *flag.FlagSet)

      func (*Manager) SetupLoggingFlags

      func (m *Manager) SetupLoggingFlags(fs *flag.FlagSet)

      func (*Manager) SetupMetricsFlags

      func (m *Manager) SetupMetricsFlags(fs *flag.FlagSet)

      func (*Manager) SetupNotificationManagerFlags

      func (m *Manager) SetupNotificationManagerFlags(fs *flag.FlagSet)

      func (*Manager) SetupPresetFlags

      func (m *Manager) SetupPresetFlags(fs *flag.FlagSet)

      func (*Manager) SetupProtocolAuth

      func (m *Manager) SetupProtocolAuth(fs *flag.FlagSet)

      func (*Manager) SetupRemoteNodeFlags

      func (m *Manager) SetupRemoteNodeFlags(fs *flag.FlagSet)