Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Error the default bwagreement errs class Error = errs.Class("bwagreement error") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { }
Config is a configuration struct that is everything you need to start an agreement receiver responsibility
type DB ¶
type DB interface { // SaveOrder saves an order for accounting SaveOrder(context.Context, *pb.Order) error // GetTotalsSince returns the sum of each bandwidth type after (exluding) a given date range GetTotals(context.Context, time.Time, time.Time) (map[storj.NodeID][]int64, error) //GetTotals returns stats about an uplink GetUplinkStats(context.Context, time.Time, time.Time) ([]UplinkStat, error) //GetExpired gets orders that are expired and were created before some time GetExpired(context.Context, time.Time, time.Time) ([]SavedOrder, error) //DeleteExpired deletes orders that are expired and were created before some time DeleteExpired(context.Context, time.Time, time.Time) error }
DB stores orders for accounting purposes
type SavedOrder ¶
type SavedOrder struct { Serialnum string StorageNodeID storj.NodeID UplinkID storj.NodeID Action int64 Total int64 CreatedAt time.Time ExpiresAt time.Time }
SavedOrder is information from an Order pertaining to accounting
type Server ¶
Server is an implementation of the pb.BandwidthServer interface
func NewServer ¶
func NewServer(db DB, upldb certdb.DB, pkey crypto.PublicKey, log *zap.Logger, nodeID storj.NodeID) *Server
NewServer creates instance of Server
func (*Server) BandwidthAgreements ¶
func (s *Server) BandwidthAgreements(ctx context.Context, rba *pb.Order) (reply *pb.AgreementsSummary, err error)
BandwidthAgreements receives and stores bandwidth agreements from storage nodes
func (*Server) Settlement ¶
func (s *Server) Settlement(client pb.Bandwidth_SettlementServer) (err error)
Settlement receives and handles agreements.
Click to show internal directories.
Click to hide internal directories.