config

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package config contains internal structures and methods relating to managing a client's configuration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

A Manager stores and manages the current configuration of the client. It exports a view of the current configuration and is safe for concurrent access.

func StartManager

func StartManager(cfg *config.Configuration, configChanges chan<- *fspb.ClientInfoData, c stats.ConfigManagerCollector) (*Manager, error)

StartManager attempts to create a Manager from the provided client configuration.

The labels parameter defines what client labels the client should report to the server. TODO(b/297019580): Consider defining and consuming a more specific `ConfigManagerCollector` interface here, containing only the methods that Manager actually cares about.

func (*Manager) AddRevokedSerials

func (m *Manager) AddRevokedSerials(revoked [][]byte)

AddRevokedSerials takes a list of revoked certificate serial numbers and adds them to the configuration's list.

func (*Manager) ChainRevoked

func (m *Manager) ChainRevoked(chain []*x509.Certificate) bool

ChainRevoked returns true if any certificate in provided slice has been revoked.

func (*Manager) ClientID

func (m *Manager) ClientID() common.ClientID

ClientID returns the current client identifier.

func (*Manager) CommunicatorConfig

func (m *Manager) CommunicatorConfig() *clpb.CommunicatorConfig

CommunicatorConfig returns the communicator configuration that the client is configured to use.

func (*Manager) Configuration

func (m *Manager) Configuration() *config.Configuration

Configuration returns the configuration struct used to create this client.

func (*Manager) CurrentState

func (m *Manager) CurrentState() *clpb.ClientState

CurrentState returns the client's current dynamic state.

func (*Manager) Labels

func (m *Manager) Labels() []*fspb.Label

Labels returns the labels built into this client.

func (*Manager) RecordRunningService

func (m *Manager) RecordRunningService(name string, sig []byte)

RecordRunningService adds name to the list of services which this client is currently running. This list will be included when sending a ClientInfo record to the server. The optional parameter sig should be set when the configuration was signed to emake it clear to the server which instance of the service is running.

func (*Manager) Rekey

func (m *Manager) Rekey() (err error)

Rekey creates a new private key and identity for the client.

func (*Manager) SendConfigUpdate

func (m *Manager) SendConfigUpdate()

SendConfigUpdate causes a ClientInfo message capturing the current configuration to be sent to the server.

func (*Manager) SequencingNonce

func (m *Manager) SequencingNonce() uint64

SequencingNonce returns the most recent sequencing nonce known to the client.

func (*Manager) SetSequencingNonce

func (m *Manager) SetSequencingNonce(n uint64)

SetSequencingNonce sets the sequencing nonce received from the server.

func (*Manager) Stop

func (m *Manager) Stop()

Stop shuts down the Manager, in particular it will stop sychronizing to the writeback file.

func (*Manager) Sync

func (m *Manager) Sync() error

Sync writes the current dynamic state to the writeback location. This saves the current state, so changing data (e.g. the deduplication nonces) is persisted across restarts.

Jump to

Keyboard shortcuts

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