trust

package
v3.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2026 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

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) Add

func (r *Remotes) Add(dir string, remotes ...types.Remote) error

Add adds a new local cluster member record for the remotes.

func (*Remotes) Count

func (r *Remotes) Count() int

Count returns the number of remotes.

func (*Remotes) Load

func (r *Remotes) Load(dir string) error

Load reads any yaml files in the given directory and parses them into a set of Remotes.

func (*Remotes) RemoteAddresses

func (r *Remotes) RemoteAddresses() map[string]types.AddrPort

RemoteAddresses returns just the host:port addresses of the remotes.

func (*Remotes) RemoteByAddress

func (r *Remotes) RemoteByAddress(addrPort types.AddrPort) *types.Remote

RemoteByAddress returns a Remote matching the given host address (or nil if none are found).

func (*Remotes) RemoteByCertificateFingerprint

func (r *Remotes) RemoteByCertificateFingerprint(fingerprint string) *types.Remote

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

func (r *Remotes) RemotesByName() map[string]types.Remote

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 ...types.ClusterMember) error

Replace replaces the in-memory and locally stored remotes with the given list from the database.

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.

func (*Store) Refresh

func (ts *Store) Refresh() error

Refresh reloads the truststore and runs any associated hooks.

func (*Store) Remotes

func (ts *Store) Remotes() *Remotes

Remotes returns a thread-safe list of the remotes in the truststore, as watched by fsnotify.

Jump to

Keyboard shortcuts

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