service

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BadgerOptions

type BadgerOptions interface {
	SetNumGoroutines(val int)
	SetNumCompactors(val int)
	SetCompression(val options.CompressionType)
	SetLogger(val badger.Logger)
	SetValueLogFileSize(val int64)
	SetBlockCacheSize(val int64)
	SetIndexCacheSize(val int64)
	SetSyncWrites(val bool)
}

type BadgerOptionsAdapter

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

func NewBadgerOptionsAdapter

func NewBadgerOptionsAdapter(options *badger.Options) BadgerOptionsAdapter

func (BadgerOptionsAdapter) SetBlockCacheSize

func (b BadgerOptionsAdapter) SetBlockCacheSize(val int64)

func (BadgerOptionsAdapter) SetCompression

func (b BadgerOptionsAdapter) SetCompression(val options.CompressionType)

func (BadgerOptionsAdapter) SetIndexCacheSize

func (b BadgerOptionsAdapter) SetIndexCacheSize(val int64)

func (BadgerOptionsAdapter) SetLogger

func (b BadgerOptionsAdapter) SetLogger(val badger.Logger)

func (BadgerOptionsAdapter) SetNumCompactors

func (b BadgerOptionsAdapter) SetNumCompactors(val int)

func (BadgerOptionsAdapter) SetNumGoroutines

func (b BadgerOptionsAdapter) SetNumGoroutines(val int)

func (BadgerOptionsAdapter) SetSyncWrites

func (b BadgerOptionsAdapter) SetSyncWrites(val bool)

func (BadgerOptionsAdapter) SetValueLogFileSize

func (b BadgerOptionsAdapter) SetValueLogFileSize(val int64)

type Config

type Config struct {
	// DataDirectory specifies where the primary database and other data
	// will be stored.
	DataDirectory string

	// GoSSBDataDirectory specifies the location of the old data directory used
	// by go-ssb. This is needed for data migrations.
	GoSSBDataDirectory string

	// ListenAddress for the TCP listener in the format accepted by the
	// standard library.
	// Optional, defaults to ":8008".
	ListenAddress string

	// Setting NetworkKey is mainly useful for test networks.
	// Optional, defaults to boxstream.NewDefaultNetworkKey().
	NetworkKey boxstream.NetworkKey

	// Setting MessageHMAC is mainly useful for test networks.
	// Optional, defaults to formats.NewDefaultMessageHMAC().
	MessageHMAC formats.MessageHMAC

	// LoggingSystem is the logger used for logging by this library.
	// Optional, defaults to logging.NewDevNullLoggingSystem().
	LoggingSystem logging.LoggingSystem

	// PeerManagerConfig specifies the config for the peer manager which is responsible for establishing new
	// connections and managing existing connections.
	PeerManagerConfig domain.PeerManagerConfig

	// Hops specifies how far away the feeds which are automatically replicated
	// based on contact messages can be in the social graph.
	// Optional, defaults to 2 (followees of your followees).
	Hops *graph.Hops

	// ModifyBadgerOptions allows you to specify a function allowing you to modify certain Badger options.
	// Optional, this value is ignored if not set.
	ModifyBadgerOptions func(options BadgerOptions)
}

func (*Config) SetDefaults

func (c *Config) SetDefaults()

type Service

type Service struct {
	App app.Application
	// contains filtered or unexported fields
}

func NewService

func NewService(
	app app.Application,
	listener *networkport.Listener,
	discoverer *networkport.Discoverer,
	connectionEstablisher *networkport.ConnectionEstablisher,
	requestSubscriber *pubsubport.RequestSubscriber,
	roomAttendantEventSubscriber *pubsubport.RoomAttendantEventSubscriber,
	newPeerSubscriber *pubsubport.NewPeerSubscriber,
	advertiser *local.Advertiser,
	messageBuffer *commands.MessageBuffer,
	createHistoryStreamHandler *queries.CreateHistoryStreamHandler,
	badgerGarbageCollector *badger.GarbageCollector,
	feedWantListRepository *notx.NoTxFeedWantListRepository,
	blobWantListRepository *notx.NoTxBlobWantListRepository,
) Service

func (Service) Run

func (s Service) Run(ctx context.Context) error

Directories

Path Synopsis
ebt
app
transport
Package transport implements the protocol stack responsible for exchanging data between Secure Scuttlebutt peers.
Package transport implements the protocol stack responsible for exchanging data between Secure Scuttlebutt peers.
transport/boxstream
Package boxstream implements the Secret Handshake and the box stream protocol.
Package boxstream implements the Secret Handshake and the box stream protocol.
ports
network
Package network handles incoming network connections.
Package network handles incoming network connections.
pubsub
Package pubsub receives internal events.
Package pubsub receives internal events.
rpc
Package rpc implements handlers for incoming Secure Scuttlebutt RPC requests.
Package rpc implements handlers for incoming Secure Scuttlebutt RPC requests.

Jump to

Keyboard shortcuts

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