 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrUnknownGroup = serrors.New("group not known to HPS") ErrNotReader = serrors.New("peer is not a reader of this group") )
Functions ¶
func NewSegReqHandler ¶
NewSegReqHandler returns a hidden path segment request handler
Types ¶
type DefaultFetcher ¶
type DefaultFetcher struct {
	// contains filtered or unexported fields
}
    DefaultFetcher fetches hidden path segments from database and remote HPS
func NewDefaultFetcher ¶
func NewDefaultFetcher(groupInfo *GroupInfo, msger infra.Messenger, db hiddenpathdb.HiddenPathDB) *DefaultFetcher
NewDefaultFetcher creates a new DefaultFetcher
type Fetcher ¶
type Fetcher interface {
	// Fetch fetches hidden path segments.
	// In case of local HPS the segments are fetched from the database,
	// otherwise segments are requested from a remote HPS
	Fetch(ctx context.Context,
		req *path_mgmt.HPSegReq, peer *snet.Addr) ([]*path_mgmt.HPSegRecs, error)
}
    Fetcher is a fetcher for hidden path segments
type GroupInfo ¶
type GroupInfo struct {
	// LocalIA is the local IA of the HPS.
	// In case a group contains this IA as Registry,
	// requests for that group can be resolved locally.
	LocalIA addr.IA
	// Groups contains all the groups known to a HPS
	Groups map[hiddenpath.GroupId]*hiddenpath.Group
}
    GroupInfo holds all information about hidden path groups needed by the HPS throughout its life cycle
func (*GroupInfo) CheckIds ¶
func (gi *GroupInfo) CheckIds(ids hiddenpath.GroupIdSet) error
CheckIds checks that the provided Ids are known to the HPS and that all Ids have at least one Registry.
func (*GroupInfo) GetRegistryMapping ¶
func (gi *GroupInfo) GetRegistryMapping(ids hiddenpath.GroupIdSet) ( map[addr.IA][]hiddenpath.GroupId, error)
GetRegistryMapping uses a greedy algorithm to approximate an optimal mapping from Registries to GroupIds such that all local Groups are mapped to the local Registry and the remaining Groups are mapped to a small number of remote Registries. The algorithm runs in O(Registries*Groups^2) and is at most ln(Groups)+1 times worse than an optimal solution.
       Directories
      ¶
      Directories
      ¶
    
    | Path | Synopsis | 
|---|---|
| Package mock_hpsegreq is a generated GoMock package. | Package mock_hpsegreq is a generated GoMock package. |