core

package
v0.0.12-rc3 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2020 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWorker added in v0.0.12

func NewWorker(addr string, done <-chan struct{}, s store.ExtendedStore) (*sprout.Worker, error)

NewWorker creates a sprout worker connected to the provided address using TLS over TCP as a transport.

Types

type App

type App interface {
	Notifications() NotificationService
	Arbor() ArborService
	Settings() SettingsService
	Sprout() SproutService
	Theme() ThemeService
}

App bundles core application services into a single convenience type.

func NewApp

func NewApp(stateDir string) (application App, err error)

NewApp constructs an App or fails with an error. This process will fail if any of the application services fail to initialize correctly.

type ArborService

type ArborService interface {
	Store() store.ExtendedStore
	Communities() *ds.CommunityList
	Replies() *ds.ReplyList
}

ArborService provides access to stored arbor data.

type NotificationService

type NotificationService interface {
	Register(store.ExtendedStore)
	Notify(title, content string) error
}

NotificationService provides methods to send notifications and to configure notifications for collections of arbor nodes.

type Settings

type Settings struct {
	// relay address to connect to
	Address string

	// user's local identity ID
	ActiveIdentity *fields.QualifiedHash

	// the version of the disclaimer that the user has accepted
	AcknowledgedNoticeVersion int

	// whether notifications are accepted. The nil state indicates that
	// the user has not changed this value, and should be treated as true.
	// TODO(whereswaldon): find a backwards-compatible way to handle this
	// elegantly.
	NotificationsEnabled *bool

	// whether the user wants the app bar anchored at the bottom of the UI
	BottomAppBar bool

	DarkMode bool

	// whether the user wants the navigation drawer to dock to the side of
	// the UI instead of appearing on top
	DockNavDrawer bool
}

type SettingsService

type SettingsService interface {
	NotificationsGloballyAllowed() bool
	SetNotificationsGloballyAllowed(bool)
	AcknowledgedNoticeVersion() int
	SetAcknowledgedNoticeVersion(version int)
	Address() string
	SetAddress(string)
	BottomAppBar() bool
	SetBottomAppBar(bool)
	DockNavDrawer() bool
	SetDockNavDrawer(bool)
	DarkMode() bool
	SetDarkMode(bool)
	ActiveArborIdentityID() *fields.QualifiedHash
	Identity() (*forest.Identity, error)
	GrovePath() string
	Persist() error
	CreateIdentity(name string) error
	Builder() (*forest.Builder, error)
}

SettingsService allows querying, updating, and saving settings.

type SproutService

type SproutService interface {
	ConnectTo(address string) error
	Connections() []string
	WorkerFor(address string) *sprout.Worker
}

type ThemeService

type ThemeService interface {
	Current() *sprigTheme.Theme
	SetDarkMode(bool)
}

ThemeService provides methods to fetch and manipulate the current application theme.

Jump to

Keyboard shortcuts

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