Documentation ¶
Overview ¶
Package lockss assists with LOCKSS related configuration settings.
The plan is to export this package at some point for external project use, but only once the API has settled.
Index ¶
Constants ¶
const ( // DefaultConfigFile represents the path to the local LOCKSS configuration // file. This is not the properties or parameters file, but is instead the // configuration file that the LOCKSS daemon reads at startup to determine // core operational parameters. // // Among other settings, this file specifies the LOCKSS_PROPS_URL value // which the daemon uses to retrieve the LOCKSS Properties (Parameters) // file for further configuration. This path is hard-coded in LOCKSS v1 // tooling, so this path should be fairly stable. DefaultConfigFile string = "/etc/lockss/config.dat" // PropertiesURLVarName is the name of the configuration file variable that we // will use to retrieve the LOCKSS Properties (Parameters) URL. PropertiesURLVarName string = "LOCKSS_PROPS_URL" // ConfigFileCommentChar is the character used to indicate that a line is // commented out in the local LOCKSS configuration file. ConfigFileCommentChar string = "#" // PropertiesGroupName is the group defined in the local LOCKSS daemon // configuration file that the node is a member of. Membership in this // group is required in order to receive certain settings, including // collections of peer nodes. Not all LOCKSS networks will filter settings // based on this group. PropertiesGroupName string = "LOCKSS_TEST_GROUP" )
const DefaultConfigLoadURLTimeout = 7 * time.Second
DefaultConfigLoadURLTimeout specifies the default timeout for retrieving the LOCKSS properties/configuration file from the LOCKSS network configuration server.
Variables ¶
This section is empty.
Functions ¶
func DisableLogging ¶
func DisableLogging()
DisableLogging reapplies default package-level logging settings of muting all logging output.
func EnableLogging ¶
func EnableLogging()
EnableLogging enables logging output from this package. Output is muted by default unless explicitly requested (by calling this function).
Types ¶
type Config ¶
type Config struct { // IDInitialV3Peers is the list of V3 peers for this LOCKSS node. This // field also provides a user-facing API surface for peer nodes. IDInitialV3Peers IDInitialV3Peers // contains filtered or unexported fields }
Config represents the values retrieved from provided LOCKSS configuration files. Due to the large number of possible parameters, we only pull in the settings that we actually require for our use.
func New ¶
New attempts to automatically provide an initialized configuration using the default path to the local LOCKSS node configuration file. Any error that occurs is returned.
func NewFromFile ¶
NewFromFile attempts to provide an initialized configuration using a user-specified path to a local LOCKSS Properties (Parameters) XML file. Any error that occurs is returned. This function is usually reserved for testing purposes as live nodes will read their configuration using a provided URL.
func NewFromURL ¶
NewFromURL attempts to provide an initialized configuration using a user-specified URL to a LOCKSS Properties (Parameters) XML file. Any error that occurs is returned.
func NewFromURLWithContext ¶
NewFromURLWithContext attempts to provide an initialized configuration using a user-specified context and a URL to a LOCKSS Properties (Parameters) XML file. Any error that occurs is returned.
func (Config) LocalConfigFile ¶
LocalConfigFile is the local copy of the configuration file required for the LOCKSS daemon to operate. This file can be thought of as the "bootstrap" configuration file which enables the daemon to startup and retrieve further configuration settings from the network property/configuration server.
func (Config) PreservationGroup ¶ added in v0.1.2
PreservationGroup is the group defined in the local LOCKSS daemon configuration file that the node is a member of. Membership in this group is required in order to receive certain settings, including collections of peer nodes. Not all LOCKSS networks will filter settings based on this group.
type IDInitialV3Peers ¶
type IDInitialV3Peers struct {
// contains filtered or unexported fields
}
IDInitialV3Peers represents the initial list of V3 peers for a LOCKSS node.
func (IDInitialV3Peers) List ¶
func (l IDInitialV3Peers) List() ([]V3Peer, error)
List returns a slice of initial peers.
type Proxy ¶
type Proxy struct { NoManifestIndexResponses string Port int AuditPort int Access ProxyAccess }
Proxy represents the parent proxy element containing settings related to the content proxy support in LOCKSS
type ProxyAccess ¶
ProxyAccess represents access control settings for the content proxy support in LOCKSS
type V3Peer ¶
type V3Peer struct { // Protocol represents the network type (for example, "tcp", "udp") Protocol string // IPAddress is the IP Address of the LOCKSS node/peer that this node will // try to communicate with IPAddress string // LCAPPort is the LCAP (Library Content Audit Protocol) TCP port used to // make connections to remote LOCKSS nodes for content voting, polling and // repairing purposes. LCAPPort int }
V3Peer represents a peer LOCKSS node in the network. This type implements the net.Addr interface (https://golang.org/pkg/net/#Addr).