Documentation ¶
Index ¶
Constants ¶
View Source
const NormalProtocol = "https"
NormalProtocol represents the normal protocol
View Source
const TorProtocol = "tor"
TorProtocol represents the tor protocol
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Builder ¶
type Builder interface { Create() Builder WithID(id *uuid.UUID) Builder WithSyncDuration(syncDuration time.Duration) Builder WithList(list []Peer) Builder LastSyncTime(lastSyncTime time.Time) Builder Now() (Peers, error) }
Builder represents a peers builder
type Content ¶
type Content interface { String() string IsNormal() bool Normal() Server IsTor() bool Tor() Server }
Content represents a peer content
type Peer ¶
Peer represents a peer
func CreatePeerForTests ¶
func CreatePeerForTests() Peer
CreatePeerForTests creates a new peer instance for tests
type PeerBuilder ¶
type PeerBuilder interface { Create() PeerBuilder WithOriginal(original Peer) PeerBuilder WithServer(server string) PeerBuilder CreatedOn(createdOn time.Time) PeerBuilder LastUpdatedOn(lastUpdatedOn time.Time) PeerBuilder Now() (Peer, error) }
PeerBuilder represents a peers builder
func NewPeerBuilder ¶
func NewPeerBuilder() PeerBuilder
NewPeerBuilder creates a new peer builder instance
type Peers ¶
type Peers interface { ID() *uuid.UUID SyncInterval() time.Duration All() []Peer Add(ins Peer) error Merge(ins Peers) Delete(ins Peer) error HasLastSync() bool LastSync() *time.Time }
Peers represents a peer list
func CreatePeersForTests ¶
func CreatePeersForTests() Peers
CreatePeersForTests creates a new peers instance for tests
Click to show internal directories.
Click to hide internal directories.