manager

package
v0.1.1-pre.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2020 License: MIT Imports: 12 Imported by: 0

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, pm ffs.PaychManager, drm ffs.DealRecordsManager, sched *scheduler.Scheduler) (*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.APIID, string, 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) GetDefaultConfig

func (m *Manager) GetDefaultConfig() ffs.DefaultConfig

GetDefaultConfig returns the current default CidConfig used for newly created FFS instances.

func (*Manager) List

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

List returns a list of all existing API instances.

func (*Manager) SetDefaultConfig

func (m *Manager) SetDefaultConfig(dc ffs.DefaultConfig) error

SetDefaultConfig sets the default CidConfig 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