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

package auth

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


Package Files



var (
    // ErrNotFound indicates that the auth-token isn't registered.
    ErrNotFound = errors.New("auth token not found")

type Auth Uses

type Auth struct {
    // contains filtered or unexported fields

Auth contains a mapping between auth-tokens and Api instances.

func New Uses

func New(store ds.Datastore) *Auth

New returns a new Auth.

func (*Auth) Generate Uses

func (r *Auth) Generate(iid ffs.APIID) (string, error)

Generate generates a new returned auth-token mapped to the iid.

func (*Auth) Get Uses

func (r *Auth) Get(token string) (ffs.APIID, error)

Get returns the InstanceID associated with token. It returns ErrNotFound if there isn't such.

func (*Auth) List Uses

func (r *Auth) List() ([]ffs.APIID, error)

List returns a list of all API instances.

Package auth imports 9 packages (graph) and is imported by 3 packages. Updated 2020-06-08. Refresh now. Tools for package owners.