2fc4d61610
* implement contact.checkin method * add batching to update uptime checks * rm batching * rm other unneeded things * fix lint * fix unit test * changes per CR comments * couple more CR changes * add identity check into grpcOpt * fix lint * why do you fix the test * revert test change * stop contact chore for repair test * put node in cache * comment out contact chore. See what happens * Revert "comment out contact chore. See what happens" This reverts commit 2e45008e36a50e0a842ae455ac83de77093d4daa. * try stopping contact earlier * stop contact chore in uplink_test * replace self on chore with *RoutingTable for access to latest node info * Revert "stop contact chore in uplink_test" This reverts commit 302db70f4071112d1b9f7ee0279225ea12757723. * Revert "try stopping contact earlier" This reverts commit 806cc3b82f9d598899dafd83da9315a1cb0cb43c. * Revert "stop contact chore for repair test" This reverts commit dd34de1cfdfc09b972186c9ab9a4f1e822446b79.
37 lines
809 B
Go
37 lines
809 B
Go
// Copyright (C) 2019 Storj Labs, Inc.
|
|
// See LICENSE for copying information.
|
|
|
|
package contact
|
|
|
|
import (
|
|
"github.com/zeebo/errs"
|
|
"go.uber.org/zap"
|
|
"gopkg.in/spacemonkeygo/monkit.v2"
|
|
|
|
"storj.io/storj/pkg/transport"
|
|
"storj.io/storj/satellite/overlay"
|
|
)
|
|
|
|
// Error is the default error class for contact package
|
|
var Error = errs.Class("contact")
|
|
|
|
var mon = monkit.Package()
|
|
|
|
// Service is the contact service between storage nodes and satellites
|
|
//
|
|
// architecture: Service
|
|
type Service struct {
|
|
log *zap.Logger
|
|
overlay *overlay.Service
|
|
transport transport.Client
|
|
}
|
|
|
|
// NewService creates a new contact service
|
|
func NewService(log *zap.Logger, overlay *overlay.Service, transport transport.Client) *Service {
|
|
return &Service{
|
|
log: log,
|
|
overlay: overlay,
|
|
transport: transport,
|
|
}
|
|
}
|