Documentation ¶
Index ¶
- Variables
- type Config
- type DB
- type Service
- func (service *Service) Close() error
- func (service *Service) Request(ctx context.Context, satelliteID storj.NodeID)
- func (service *Service) Run(ctx context.Context) (err error)
- func (service *Service) RunOnce(ctx context.Context) (err error)
- func (service *Service) VerifyVoucher(ctx context.Context, satellite storj.NodeID, voucher *pb.Voucher) (err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrVerify is returned when voucher fields are not valid. ErrVerify = errs.Class("verification") )
View Source
var ( // VoucherError represents errors with vouchers VoucherError = errs.Class("voucher") )
Functions ¶
This section is empty.
Types ¶
type Config ¶ added in v0.14.0
type Config struct {
Interval time.Duration `help:"interval between voucher service iterations" default:"168h0m0s"`
}
Config defines configuration for requesting vouchers.
type DB ¶
type DB interface { // Put inserts or updates a voucher from a satellite Put(context.Context, *pb.Voucher) error // GetValid returns one valid voucher from the list of approved satellites GetValid(context.Context, []storj.NodeID) (*pb.Voucher, error) // NeedVoucher returns true if a voucher from a particular satellite is expired, about to expire, or does not exist NeedVoucher(context.Context, storj.NodeID, time.Duration) (bool, error) }
DB implements storing and retrieving vouchers
type Service ¶ added in v0.14.0
Service is a service for requesting vouchers
func NewService ¶ added in v0.14.0
func NewService(log *zap.Logger, kad *kademlia.Kademlia, transport transport.Client, vouchersdb DB, trust *trust.Pool, interval, expirationBuffer time.Duration) *Service
NewService creates a new voucher service
Click to show internal directories.
Click to hide internal directories.