powergate: github.com/textileio/powergate/ffs/manager Index | Files

package manager

import "github.com/textileio/powergate/ffs/manager"


Package Files



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

type Manager Uses

type Manager struct {
    // contains filtered or unexported fields

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

func New Uses

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

New returns a new Manager.

func (*Manager) Close Uses

func (m *Manager) Close() error

Close closes a Manager and consequently all loaded instances.

func (*Manager) Create Uses

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 Uses

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 Uses

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

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

func (*Manager) List Uses

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

List returns a list of all existing API instances.

func (*Manager) SetDefaultStorageConfig Uses

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

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

Package manager imports 14 packages (graph) and is imported by 9 packages. Updated 2020-09-27. Refresh now. Tools for package owners.