console

package
v1.18.0-rc Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2020 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoMember = errs.Class("no such member")

ErrNoMember is a special error type that indicates about absence of member in MembersDB.

View Source
var ErrNoNode = errs.Class("no such node")

ErrNoNode is a special error type that indicates about absence of node in NodesDB.

View Source
var (

	// Error is an error class for multinode console service error.
	Error = errs.Class("multinode console service error")
)

Functions

func APISecretFromBase64 added in v1.18.1

func APISecretFromBase64(s string) ([]byte, error)

APISecretFromBase64 decodes API secret from base 64 string.

Types

type Member added in v1.17.1

type Member struct {
	ID           uuid.UUID
	Email        string
	Name         string
	PasswordHash []byte
}

Member represents some person that is invited to the MND by node owner. Member will have configurable access privileges that will define which functions and which nodes are available for him.

type Members added in v1.17.1

type Members interface {
	// Invite will create empty row in membersDB.
	Invite(ctx context.Context, member Member) error
	// Update updates all updatable fields of member.
	Update(ctx context.Context, member Member) error
	// Remove deletes member from membersDB.
	Remove(ctx context.Context, id uuid.UUID) error
	// GetByEmail will return member with specified email.
	GetByEmail(ctx context.Context, email string) (Member, error)
	// GetByID will return member with specified id.
	GetByID(ctx context.Context, id uuid.UUID) (Member, error)
}

Members exposes needed by MND MembersDB functionality.

architecture: Database

type Node

type Node struct {
	ID storj.NodeID
	// APISecret is a secret issued by storagenode, that will be main auth mechanism in MND <-> SNO api. is a secret issued by storagenode, that will be main auth mechanism in MND <-> SNO api.
	APISecret     []byte
	PublicAddress string
	Name          string
}

Node is a representation of storeganode, that SNO could add to the Multinode Dashboard.

type Nodes added in v1.15.1

type Nodes interface {
	// GetByID return node from NodesDB by its id.
	GetByID(ctx context.Context, id storj.NodeID) (Node, error)
	// GetAll returns all connected nodes.
	GetAll(ctx context.Context) ([]Node, error)
	// Add creates new node in NodesDB.
	Add(ctx context.Context, id storj.NodeID, apiSecret []byte, publicAddress string) error
	// Remove removed node from NodesDB.
	Remove(ctx context.Context, id storj.NodeID) error
}

Nodes exposes needed by MND NodesDB functionality.

architecture: Database

type Service added in v1.18.1

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

Service encapsulates multinode console logic.

architecture: Service

func NewService added in v1.18.1

func NewService(log *zap.Logger, nodes Nodes) *Service

NewService creates new instance of Service.

func (*Service) AddNode added in v1.18.1

func (service *Service) AddNode(ctx context.Context, id storj.NodeID, apiSecret []byte, publicAddress string) (err error)

AddNode adds new node to the system.

func (*Service) RemoveNode added in v1.18.1

func (service *Service) RemoveNode(ctx context.Context, id storj.NodeID) (err error)

RemoveNode removes node from the system.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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