Documentation
¶
Overview ¶
Package atv functions to read, write and manipulate ATV files containing a mGuard configuration.
Index ¶
- Variables
- type AccessModifier
- type File
- func (file *File) Dupe() *File
- func (file *File) GetAccess(name string) (*AccessModifier, error)
- func (file *File) GetPragma(name string) (*string, error)
- func (file *File) GetRowIDs() ([]RowID, error)
- func (file *File) GetRowReferences() ([]RowRef, error)
- func (file *File) GetSetting(settingName string) (string, error)
- func (file *File) GetUUID(name string) (*UUID, error)
- func (file *File) GetVersion() (Version, error)
- func (file *File) Merge(other *File) (*File, error)
- func (file *File) MergeSelectively(other *File, config *MergeConfiguration) (*File, error)
- func (file *File) Migrate(targetVersion Version) (*File, error)
- func (file *File) RemoveAccess(name string) error
- func (file *File) RemoveUUID(name string) error
- func (file *File) SetAccess(name string, access AccessModifier) error
- func (file *File) SetPragma(name string, value string) error
- func (file *File) SetUUID(name string, uuid UUID) error
- func (file *File) SetVersion(version Version) error
- func (file *File) String() string
- func (file *File) ToFile(path string) error
- func (file *File) ToWriter(writer io.Writer) error
- type MergeConfiguration
- type RowID
- type RowRef
- type UUID
- type Version
Constants ¶
This section is empty.
Variables ¶
var ErrNilReceiver = fmt.Errorf("The receiver is nil")
ErrNilReceiver is an error that is issued if a function is called with a nil receiver.
Functions ¶
This section is empty.
Types ¶
type AccessModifier ¶ added in v0.3.0
type AccessModifier int
AccessModifier influences the access of a setting in an ATV document.
const ( // MustNotOverwrite indicates that a setting must not be overwritten. MustNotOverwrite AccessModifier = iota // MayOverwrite indicates that a setting may be overwritten. MayOverwrite // MustOverwrite indicates that a setting must be overwritten. MustOverwrite // MayAppend indicates that a setting can be extended by appending additional rows (table values only). MayAppend // DefaultAccessModifier is the access modifier that applys, if no access modifier is specified (for internal use only). DefaultAccessModifier )
func ParseAccessModifier ¶ added in v0.3.0
func ParseAccessModifier(s string) (AccessModifier, error)
ParseAccessModifier parses the specified string as an access modifier.
func (AccessModifier) String ¶ added in v0.3.0
func (access AccessModifier) String() string
String returns the string representation of the access modifier.
type File ¶ added in v0.3.0
type File struct {
// contains filtered or unexported fields
}
File represents a mGuard configuration file.
func FromReader ¶ added in v0.3.0
FromReader reads an ATV document from the specified io.Reader.
func (*File) GetAccess ¶ added in v0.3.0
func (file *File) GetAccess(name string) (*AccessModifier, error)
GetAccess gets the access modifier of the setting with the specified name.
func (*File) GetPragma ¶ added in v0.3.0
GetPragma returns the value of the pragma with the specified name.
func (*File) GetRowReferences ¶ added in v0.3.0
GetRowReferences returns all row references recursively.
func (*File) GetSetting ¶ added in v0.3.0
GetSetting gets the setting with the specified name.
func (*File) GetUUID ¶ added in v0.3.0
GetUUID gets the UUID of the setting with the specified name.
func (*File) GetVersion ¶ added in v0.3.0
GetVersion gets the version of the document.
func (*File) Merge ¶ added in v0.3.0
Merge merges all settings from the specified ATV document into the current one.
func (*File) MergeSelectively ¶ added in v0.4.0
func (file *File) MergeSelectively(other *File, config *MergeConfiguration) (*File, error)
MergeSelectively merges the specified settings from the specified ATV document into the current one.
func (*File) Migrate ¶ added in v0.3.0
Migrate migrates the ATV file to the specified version (upwards only).
func (*File) RemoveAccess ¶ added in v0.3.0
RemoveAccess removes the access modifier of the setting with the specified name.
func (*File) RemoveUUID ¶ added in v0.3.0
RemoveUUID removes the UUID of the setting with the specified name.
func (*File) SetAccess ¶ added in v0.3.0
func (file *File) SetAccess(name string, access AccessModifier) error
SetAccess sets the access modifier of the setting with the specified name.
func (*File) SetPragma ¶ added in v0.3.0
SetPragma sets the value of the pragma with the specified name.
func (*File) SetUUID ¶ added in v0.3.0
SetUUID sets the UUID of the setting with the specified name.
func (*File) SetVersion ¶ added in v0.3.0
SetVersion sets the version of the document. This should only be done after a migration step to keep the document structure and the version number consistent.
func (*File) String ¶ added in v0.3.0
String returns a properly formatted string representation of the ATV document.
type MergeConfiguration ¶ added in v0.4.0
type MergeConfiguration struct {
// contains filtered or unexported fields
}
MergeConfiguration defines which settings should be merged from one ATV document into another.
func LoadMergeConfiguration ¶ added in v0.4.0
func LoadMergeConfiguration(path string) (*MergeConfiguration, error)
LoadMergeConfiguration loads a merge configuration file.
func (*MergeConfiguration) ShouldMergeSetting ¶ added in v0.4.0
func (cfg *MergeConfiguration) ShouldMergeSetting(path documentSettingPath) bool
ShouldMergeSetting indicates whether the specified setting should be merged.
type Version ¶ added in v0.3.0
Version represents the version of an ATV document.
Source Files
¶
- AccessModifier.go
- Errors.go
- File.go
- MergeConfiguration.go
- Version.go
- dictionary.go
- document.go
- documentLexer.go
- documentNode.go
- documentPragma.go
- documentSetting.go
- documentSettingPath.go
- documentSettingPaths.go
- documentSimpleValue.go
- documentTableRow.go
- documentTableValue.go
- documentValueWithMetadata.go
- helpers.go
- init.go
- migrationProvider.go
- migration_7.5.0_to_7.6.0.go
- migration_7.6.0_to_7.6.1.go
- migration_7.6.1_to_7.6.2.go
- migration_7.6.2_to_8.0.1.go
- migration_8.0.1_to_8.0.2.go
- migration_8.0.2_to_8.1.0.go
- migration_8.1.0_to_8.1.1.go
- migration_8.1.1_to_8.1.2.go
- migration_8.1.2_to_8.1.3.go
- migration_8.1.3_to_8.1.4.go
- migration_8.1.4_to_8.1.5.go
- migration_8.1.5_to_8.1.6.go
- migration_8.1.6_to_8.1.7.go
- migration_8.1.7_to_8.1.8.go
- migration_8.1.8_to_8.3.0.go
- migration_8.3.0_to_8.3.1.go
- migration_8.3.1_to_8.4.0.go
- migration_8.4.0_to_8.4.1.go
- migration_8.4.1_to_8.4.2.go
- migration_8.4.2_to_8.5.0.go
- migration_8.5.0_to_8.5.1.go
- migration_8.5.1_to_8.5.2.go
- migration_8.5.2_to_8.5.3.go
- migration_8.5.3_to_8.6.0.go
- migration_8.6.0_to_8.6.1.go
- migration_8.6.1_to_8.7.0.go
- migration_8.7.0_to_8.7.1.go
- migration_8.7.1_to_8.8.0.go
- migration_8.8.0_to_8.8.1.go