manager

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2021 License: MIT Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrAuthTokenNotFound returns when an auth-token doesn't exist.
	ErrAuthTokenNotFound = errors.New("auth token not found")
)

Functions

This section is empty.

Types

type Manager

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

Manager creates Api instances, or loads existing ones them from an auth-token.

func New

func New(ds datastore.Datastore, wm ffs.WalletManager, drm ffs.DealRecordsManager, sched *scheduler.Scheduler, ffsUseMasterAddr bool, onLocalnet bool) (*Manager, error)

New returns a new Manager.

func (*Manager) Close

func (m *Manager) Close() error

Close closes a Manager and consequently all loaded instances.

func (*Manager) Create

func (m *Manager) Create(ctx context.Context) (ffs.AuthEntry, error)

Create creates a new Api instance and an auth-token mapped to it.

func (*Manager) GetByAuthToken

func (m *Manager) GetByAuthToken(token string) (*api.API, error)

GetByAuthToken loads an existing instance using an auth-token. If auth-token doesn't exist, it returns ErrAuthTokenNotFound.

func (*Manager) GetDefaultStorageConfig

func (m *Manager) GetDefaultStorageConfig() ffs.StorageConfig

GetDefaultStorageConfig returns the current default StorageConfig used for newly created FFS instances.

func (*Manager) List

func (m *Manager) List() ([]ffs.AuthEntry, error)

List returns a list of all existing API instances.

func (*Manager) SetDefaultStorageConfig

func (m *Manager) SetDefaultStorageConfig(dc ffs.StorageConfig) error

SetDefaultStorageConfig sets the default StorageConfig to be set as default to newly created FFS instances.

Jump to

Keyboard shortcuts

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