pubaccessportals

package
v1.5.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 23, 2021 License: MIT Imports: 10 Imported by: 0

README

Public Access Portals

The Public Access Portals module manages a list of known Public Access portals and whether they are public or not.

Subsystems

The following subsystems help the Public Access Portals module execute its responsibilities:

Persistence Subsystem

Key Files

The Persistence subsystem is responsible for the disk interaction and ensuring safe and performant ACID operations. An append only structure is used with a length of fsync'd bytes encoded in the metadata.

Inbound Complexities

  • callInitPersist initializes the persistence file
    • The Pubaccess Portals Subsystem's New method uses callInitPersist
  • callUpdateAndAppend updates the pubaccess portal list and appends the information to the persistence file
    • The Pubaccess Portals Subsytem's Update method uses callUpdateAndAppend
Pubaccess Portals Subsystem

Key Files

The Pubaccess Portals subsystem contains the structure of the Pubaccess Portals List and is used to create a new Pubaccess Portals List and return information about the Portals.

Exports

  • Portals returns the list of known Pubaccess portals and whether they are public
  • New creates and returns a new Pubaccess Portals List
  • Update updates the Portals List

Outbound Complexities

  • New calls the Persistence Subsystem's callInitPersist method
  • Update calls the Persistence Subsystem's callUpdateAndAppend method

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrSkynetPortalsValidation is the error returned when validation of
	// changes to the Pubaccess portals list fails.
	ErrSkynetPortalsValidation = errors.New("could not validate additions and removals")
)

Functions

This section is empty.

Types

type SkynetPortals

type SkynetPortals struct {
	// contains filtered or unexported fields
}

SkynetPortals manages a list of known public access portals by persisting the list to disk.

func New

func New(persistDir string) (*SkynetPortals, error)

New returns an initialized SkynetPortals.

func (*SkynetPortals) Close

func (sp *SkynetPortals) Close() error

Close closes and frees associated resources.

func (*SkynetPortals) Portals

func (sp *SkynetPortals) Portals() []modules.SkynetPortal

Portals returns the list of known public access portals.

func (*SkynetPortals) UpdatePortals

func (sp *SkynetPortals) UpdatePortals(additions []modules.SkynetPortal, removals []modules.NetAddress) error

UpdatePortals updates the list of known public access portals.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL