Documentation
¶
Index ¶
Constants ¶
const ( ProfilesDirName = "signature_profiles" RecentFilesName = "recent.json" )
Names of the files kept next to config.json.
Variables ¶
This section is empty.
Functions ¶
func Dir ¶ added in v1.0.1
Dir returns the folder that holds config.json, the signature profiles and the recent files: lankir under the user config dir, which on Linux follows XDG_CONFIG_HOME. Lankir 1.0 kept the profiles and recent files in ~/.config/lankir whatever XDG_CONFIG_HOME said; when Dir is elsewhere and has none of them yet, they are copied over. The originals stay.
Types ¶
type Config ¶
type Config struct {
// Appearance settings
Theme string `json:"theme"`
AccentColor string `json:"accentColor"`
// Viewer settings
DefaultZoom int `json:"defaultZoom"`
ShowLeftSidebar bool `json:"showLeftSidebar"`
ShowRightSidebar bool `json:"showRightSidebar"`
DefaultViewMode string `json:"defaultViewMode"` // "single" or "scroll"
// File settings
RecentFilesLength int `json:"recentFilesLength"`
AutosaveInterval int `json:"autosaveInterval"`
// Certificate settings
CertificateStores []string `json:"certificateStores"`
TokenLibraries []string `json:"tokenLibraries"`
// Signing settings
TSAURL string `json:"tsaUrl"`
SignatureLocationLookup bool `json:"signatureLocationLookup"`
// CheckRevocationOnline asks the OCSP/CRL servers a signer's certificate
// names whether it was revoked, when verifying signatures.
CheckRevocationOnline bool `json:"checkRevocationOnline"`
LastCertificateFingerprint string `json:"lastCertificateFingerprint"`
LastSignatureProfileID string `json:"lastSignatureProfileId"`
// Advanced settings
DebugMode bool `json:"debugMode"`
HardwareAccel bool `json:"hardwareAccel"`
}
Config holds all application settings persisted to disk.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service provides thread-safe access to application configuration.
func NewService ¶
NewService creates a config service using the default config directory.
func NewServiceWithDir ¶
NewServiceWithDir creates a config service using a custom directory.
func (*Service) SetLastSigning ¶ added in v1.0.0
SetLastSigning saves the certificate and profile of the last signature. It changes only those two fields of config.json as it is on disk, so settings another window saved since Load are kept.