Documentation ¶
Index ¶
- type Location
- type Remote
- type Remotes
- func (r *Remotes) Add(dir string, remotes ...Remote) error
- func (r *Remotes) Addresses() map[string]types.AddrPort
- func (r *Remotes) Certificates() map[string]types.X509Certificate
- func (r *Remotes) CertificatesNative() map[string]x509.Certificate
- func (r *Remotes) Cluster(isNotification bool, serverCert *shared.CertInfo, publicKey *x509.Certificate) (client.Cluster, error)
- func (r *Remotes) Count() int
- func (r *Remotes) Load(dir string) error
- func (r *Remotes) RemoteByAddress(addrPort types.AddrPort) *Remote
- func (r *Remotes) RemoteByCertificateFingerprint(fingerprint string) *Remote
- func (r *Remotes) RemotesByName() map[string]Remote
- func (r *Remotes) Replace(dir string, newRemotes ...internalTypes.ClusterMember) error
- func (r *Remotes) SelectRandom() *Remote
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Remote ¶
type Remote struct { Location `yaml:",inline"` Certificate types.X509Certificate `yaml:"certificate"` }
Remote represents a yaml file with credentials to be read by the daemon.
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) Certificates ¶
func (r *Remotes) Certificates() map[string]types.X509Certificate
Certificates returns a map of remotes certificates by fingerprint.
func (*Remotes) CertificatesNative ¶
func (r *Remotes) CertificatesNative() map[string]x509.Certificate
CertificatesNative returns the Certificates map with values as native x509.Certificate type.
func (*Remotes) Cluster ¶
func (r *Remotes) Cluster(isNotification bool, serverCert *shared.CertInfo, publicKey *x509.Certificate) (client.Cluster, error)
Cluster returns a set of clients for every remote, which can be concurrently queried.
func (*Remotes) Load ¶
Load reads any yaml files in the given directory and parses them into a set of 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) RemotesByName ¶
RemotesByName returns a copy of the list of peers, keyed by each system's name.
func (*Remotes) Replace ¶
func (r *Remotes) Replace(dir string, newRemotes ...internalTypes.ClusterMember) error
Replace replaces the in-memory and locally stored remotes with the given list from the database.
func (*Remotes) SelectRandom ¶
SelectRandom returns a random remote.
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.