Documentation ¶
Index ¶
- Variables
- func APISecretFromBase64(s string) ([]byte, error)
- type DB
- type Node
- type Service
- func (service *Service) Add(ctx context.Context, id storj.NodeID, apiSecret []byte, publicAddress string) (err error)
- func (service *Service) Get(ctx context.Context, id storj.NodeID) (_ Node, err error)
- func (service *Service) List(ctx context.Context) (_ []Node, err error)
- func (service *Service) Remove(ctx context.Context, id storj.NodeID) (err error)
- func (service *Service) UpdateName(ctx context.Context, id storj.NodeID, name string) (err error)
Constants ¶
This section is empty.
Variables ¶
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 nodes service error. Error = errs.Class("nodes service error") )
Functions ¶
func APISecretFromBase64 ¶
APISecretFromBase64 decodes API secret from base 64 string.
Types ¶
type DB ¶
type DB interface { // Get return node from NodesDB by its id. Get(ctx context.Context, id storj.NodeID) (Node, error) // List returns all connected nodes. List(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 // UpdateName will update name of the specified node in database. UpdateName(ctx context.Context, id storj.NodeID, name string) error }
DB exposes needed by MND NodesDB 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 Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service exposes all nodes related logic.
architecture: Service
func NewService ¶
NewService creates new instance of Service.
func (*Service) Add ¶
func (service *Service) Add(ctx context.Context, id storj.NodeID, apiSecret []byte, publicAddress string) (err error)
Add adds new node to the system.
Click to show internal directories.
Click to hide internal directories.