Documentation
¶
Index ¶
- type Remotes
- func (r *Remotes) Add(dir string, remotes ...types.Remote) error
- func (r *Remotes) Count() int
- func (r *Remotes) Load(dir string) error
- func (r *Remotes) RemoteAddresses() map[string]types.AddrPort
- func (r *Remotes) RemoteByAddress(addrPort types.AddrPort) *types.Remote
- func (r *Remotes) RemoteByCertificateFingerprint(fingerprint string) *types.Remote
- func (r *Remotes) RemoteCertificates() map[string]types.X509Certificate
- func (r *Remotes) RemoteCertificatesNative() map[string]x509.Certificate
- func (r *Remotes) RemoteClients(isNotification bool, serverCert *shared.CertInfo, publicKey *x509.Certificate) (types.Clients, error)
- func (r *Remotes) RemotesByName() map[string]types.Remote
- func (r *Remotes) Replace(dir string, newRemotes ...types.ClusterMember) error
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Remotes ¶
type Remotes struct {
// contains filtered or unexported fields
}
Remotes is a convenient alias as we will often deal with groups of yaml files.
func (*Remotes) Load ¶
Load reads any yaml files in the given directory and parses them into a set of Remotes.
func (*Remotes) RemoteAddresses ¶
RemoteAddresses returns just the host:port addresses of the remotes.
func (*Remotes) RemoteByAddress ¶
RemoteByAddress returns a Remote matching the given host address (or nil if none are found).
func (*Remotes) RemoteByCertificateFingerprint ¶
RemoteByCertificateFingerprint returns a remote whose certificate fingerprint matches the provided fingerprint.
func (*Remotes) RemoteCertificates ¶
func (r *Remotes) RemoteCertificates() map[string]types.X509Certificate
RemoteCertificates returns a map of remotes certificates by fingerprint.
func (*Remotes) RemoteCertificatesNative ¶
func (r *Remotes) RemoteCertificatesNative() map[string]x509.Certificate
RemoteCertificatesNative returns the Certificates map with values as native x509.Certificate type.
func (*Remotes) RemoteClients ¶
func (r *Remotes) RemoteClients(isNotification bool, serverCert *shared.CertInfo, publicKey *x509.Certificate) (types.Clients, error)
RemoteClients returns a set of clients for every remote, which can be concurrently queried.
func (*Remotes) RemotesByName ¶
RemotesByName returns a copy of the list of peers, keyed by each system's name.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store represents a directory of remotes watched by the fsnotify Watcher.
func Init ¶
func Init(watcher *sys.Watcher, onUpdate func(oldRemotes, newRemotes Remotes) error, dir string) (*Store, error)
Init initializes the remotes in the truststore, seeds the rand package for selecting remotes at random, and watches the truststore directory for updates.