From 4d4d8a137657c4ff6d181ada3c3cd2df1d42e44e Mon Sep 17 00:00:00 2001 From: Myzel394 <50424412+Myzel394@users.noreply.github.com> Date: Wed, 7 Aug 2024 22:34:33 +0200 Subject: [PATCH] chore: Add more documentation --- .../filesystems/mountoptions/adfs.go | 10 ++++- .../filesystems/mountoptions/affs.go | 43 +++++++++++-------- .../filesystems/mountoptions/debugfs.go | 10 ++++- 3 files changed, 42 insertions(+), 21 deletions(-) diff --git a/common-documentation/filesystems/mountoptions/adfs.go b/common-documentation/filesystems/mountoptions/adfs.go index 7b4a489..cccb4b2 100644 --- a/common-documentation/filesystems/mountoptions/adfs.go +++ b/common-documentation/filesystems/mountoptions/adfs.go @@ -6,11 +6,15 @@ var AdfsDocumentationAssignable = map[docvalues.EnumString]docvalues.Value{ docvalues.CreateEnumStringWithDoc( "uid", "Set the owner of the files in the filesystem (default: uid=0).", - ): docvalues.PositiveNumbeValue(), + ): docvalues.UIDValue{ + EnforceUsingExisting: true, + }, docvalues.CreateEnumStringWithDoc( "gid", "Set the group of the files in the filesystem (default: gid=0).", - ): docvalues.PositiveNumbeValue(), + ): docvalues.GIDValue{ + EnforceUsingExisting: true, + }, docvalues.CreateEnumStringWithDoc( "ownmask", "Set the permission mask for ADFS 'owner' permissions (default: 0700).", @@ -20,3 +24,5 @@ var AdfsDocumentationAssignable = map[docvalues.EnumString]docvalues.Value{ "Set the permission mask for ADFS 'other' permissions (default: 0077).", ): docvalues.StringValue{}, } + +var AdfsDocumentationEnums = []docvalues.EnumString{} diff --git a/common-documentation/filesystems/mountoptions/affs.go b/common-documentation/filesystems/mountoptions/affs.go index 5731a12..1a0f6e6 100644 --- a/common-documentation/filesystems/mountoptions/affs.go +++ b/common-documentation/filesystems/mountoptions/affs.go @@ -2,39 +2,33 @@ package commondocumentation import docvalues "config-lsp/doc-values" +var prefixMaxLength = uint32(30) + var AffsDocumentationAssignable = map[docvalues.EnumString]docvalues.Value{ docvalues.CreateEnumStringWithDoc( "uid", "Set the owner and group of the root of the filesystem (default: uid=gid=0, but with option uid or gid without specified value, the UID and GID of the current process are taken).", - ): docvalues.NumberValue{Min: &zero}, + ): docvalues.UIDValue{ + EnforceUsingExisting: true, + }, docvalues.CreateEnumStringWithDoc( "gid", "Set the owner and group of the root of the filesystem (default: uid=gid=0, but with option uid or gid without specified value, the UID and GID of the current process are taken).", - ): docvalues.NumberValue{Min: &zero}, + ): docvalues.GIDValue{ + EnforceUsingExisting: true, + }, docvalues.CreateEnumStringWithDoc( "setuid", "Set the owner of all files.", - ): docvalues.NumberValue{Min: &zero}, + ): docvalues.StringValue{}, docvalues.CreateEnumStringWithDoc( "setgid", "Set the group of all files.", - ): docvalues.NumberValue{Min: &zero}, + ): docvalues.StringValue{}, docvalues.CreateEnumStringWithDoc( "mode", "Set the mode of all files to value & 0777 disregarding the original permissions. Add search permission to directories that have read permission. The value is given in octal.", ): docvalues.StringValue{}, - docvalues.CreateEnumStringWithDoc( - "protect", - "Do not allow any changes to the protection bits on the filesystem.", - ): docvalues.StringValue{}, - docvalues.CreateEnumStringWithDoc( - "usemp", - "Set UID and GID of the root of the filesystem to the UID and GID of the mount point upon the first sync or umount, and then clear this option. Strange...", - ): docvalues.StringValue{}, - docvalues.CreateEnumStringWithDoc( - "verbose", - "Print an informational message for each successful mount.", - ): docvalues.StringValue{}, docvalues.CreateEnumStringWithDoc( "prefix", "Prefix used before volume name, when following a link.", @@ -42,7 +36,7 @@ var AffsDocumentationAssignable = map[docvalues.EnumString]docvalues.Value{ docvalues.CreateEnumStringWithDoc( "volume", "Prefix (of length at most 30) used before '/' when following a symbolic link.", - ): docvalues.StringValue{}, + ): docvalues.StringValue{MaxLength: &prefixMaxLength}, docvalues.CreateEnumStringWithDoc( "reserved", "(Default: 2.) Number of unused blocks at the start of the device.", @@ -80,3 +74,18 @@ var AffsDocumentationAssignable = map[docvalues.EnumString]docvalues.Value{ "These options are accepted but ignored. (However, quota utilities may react to such strings in /etc/fstab.)", ): docvalues.StringValue{}, } + +var AffsDocumentationEnums = []docvalues.EnumString{ + docvalues.CreateEnumStringWithDoc( + "protect", + "Do not allow any changes to the protection bits on the filesystem.", + ), + docvalues.CreateEnumStringWithDoc( + "usemp", + "Set UID and GID of the root of the filesystem to the UID and GID of the mount point upon the first sync or umount, and then clear this option. Strange...", + ), + docvalues.CreateEnumStringWithDoc( + "verbose", + "Print an informational message for each successful mount.", + ), +} diff --git a/common-documentation/filesystems/mountoptions/debugfs.go b/common-documentation/filesystems/mountoptions/debugfs.go index b698fc6..c425e8f 100644 --- a/common-documentation/filesystems/mountoptions/debugfs.go +++ b/common-documentation/filesystems/mountoptions/debugfs.go @@ -6,13 +6,19 @@ var DebugfsDocumentationAssignable = map[docvalues.EnumString]docvalues.Value{ docvalues.CreateEnumStringWithDoc( "uid", "Set the owner of the mountpoint.", - ): docvalues.NumberValue{Min: &zero}, + ): docvalues.UIDValue{ + EnforceUsingExisting: true, + }, docvalues.CreateEnumStringWithDoc( "gid", "Set the group of the mountpoint.", - ): docvalues.NumberValue{Min: &zero}, + ): docvalues.GIDValue{ + EnforceUsingExisting: true, + }, docvalues.CreateEnumStringWithDoc( "mode", "Sets the mode of the mountpoint.", ): docvalues.StringValue{}, } + +var DebugfsDocumentationEnums = []docvalues.EnumString{}