From c12c8f337436b0d2e68b2665bb4a184c64313d2a Mon Sep 17 00:00:00 2001 From: case0sh Date: Fri, 6 Oct 2023 10:06:25 +0200 Subject: [PATCH] fix formatting --- services/frontend/pkg/config/config.go | 4 +- .../idp/pkg/backends/cs3/bootstrap/cs3.go | 3 +- .../idp/pkg/backends/cs3/identifier/cs3.go | 20 +- services/idp/pkg/config/config.go | 1 - .../idp/pkg/config/defaults/defaultconfig.go | 1 - services/idp/pkg/service/v0/service.go | 2 +- services/ocdav/pkg/config/config.go | 1 - .../pkg/config/defaults/defaultconfig.go | 14 +- services/policies/pkg/config/config.go | 26 +-- .../pkg/config/defaults/defaultconfig.go | 1 - services/proxy/pkg/proxy/policy/selector.go | 91 ++++---- .../thumbnails/pkg/preprocessor/fontloader.go | 1 + .../pkg/preprocessor/textanalyzer_test.go | 194 +++++++++--------- .../pkg/service/grpc/v0/decorators/base.go | 44 ++-- services/webdav/pkg/prop/prop.go | 7 +- 15 files changed, 208 insertions(+), 202 deletions(-) diff --git a/services/frontend/pkg/config/config.go b/services/frontend/pkg/config/config.go index c8796e5f5eb..c8dbb8d81a0 100644 --- a/services/frontend/pkg/config/config.go +++ b/services/frontend/pkg/config/config.go @@ -20,8 +20,8 @@ type Config struct { TransferSecret string `yaml:"transfer_secret" env:"OCIS_TRANSFER_SECRET" desc:"Transfer secret for signing file up- and download requests."` - TokenManager *TokenManager `yaml:"token_manager"` - Reva *shared.Reva `yaml:"reva"` + TokenManager *TokenManager `yaml:"token_manager"` + Reva *shared.Reva `yaml:"reva"` SkipUserGroupsInToken bool `yaml:"skip_user_groups_in_token" env:"FRONTEND_SKIP_USER_GROUPS_IN_TOKEN" desc:"Disables the loading of user's group memberships from the reva access token."` diff --git a/services/idp/pkg/backends/cs3/bootstrap/cs3.go b/services/idp/pkg/backends/cs3/bootstrap/cs3.go index 3773ebd80e1..6eb1af132c8 100644 --- a/services/idp/pkg/backends/cs3/bootstrap/cs3.go +++ b/services/idp/pkg/backends/cs3/bootstrap/cs3.go @@ -19,13 +19,12 @@ package bootstrap import ( "fmt" - "os" - "github.com/libregraph/lico/bootstrap" "github.com/libregraph/lico/identifier" "github.com/libregraph/lico/identity" "github.com/libregraph/lico/identity/managers" cs3 "github.com/owncloud/ocis/v2/services/idp/pkg/backends/cs3/identifier" + "os" ) // Identity managers. diff --git a/services/idp/pkg/backends/cs3/identifier/cs3.go b/services/idp/pkg/backends/cs3/identifier/cs3.go index baea030aff5..3bb26a73e5d 100644 --- a/services/idp/pkg/backends/cs3/identifier/cs3.go +++ b/services/idp/pkg/backends/cs3/identifier/cs3.go @@ -33,10 +33,10 @@ var cs3SpportedScopes = []string{ type CS3Backend struct { supportedScopes []string - logger logrus.FieldLogger - tlsConfig *tls.Config - gatewayURI string - insecure bool + logger logrus.FieldLogger + tlsConfig *tls.Config + gatewayURI string + insecure bool sessions cmap.ConcurrentMap @@ -58,10 +58,10 @@ func NewCS3Backend( b := &CS3Backend{ supportedScopes: supportedScopes, - logger: c.Logger, - tlsConfig: tlsConfig, - gatewayURI: gatewayURI, - insecure: insecure, + logger: c.Logger, + tlsConfig: tlsConfig, + gatewayURI: gatewayURI, + insecure: insecure, sessions: cmap.New(), } @@ -154,8 +154,8 @@ func (b *CS3Backend) ResolveUserByUsername(ctx context.Context, username string) client := cs3gateway.NewGatewayAPIClient(l) res, err := client.Authenticate(ctx, &cs3gateway.AuthenticateRequest{ - Type: "machine", - ClientId: "username:" + username, + Type: "machine", + ClientId: "username:" + username, }) if err != nil { return nil, fmt.Errorf("cs3 backend machine authenticate rpc error: %v", err) diff --git a/services/idp/pkg/config/config.go b/services/idp/pkg/config/config.go index 764783af845..c75f24e33d3 100644 --- a/services/idp/pkg/config/config.go +++ b/services/idp/pkg/config/config.go @@ -20,7 +20,6 @@ type Config struct { Reva *shared.Reva `yaml:"reva"` - Asset Asset `yaml:"asset"` IDP Settings `yaml:"idp"` Clients []Client `yaml:"clients"` diff --git a/services/idp/pkg/config/defaults/defaultconfig.go b/services/idp/pkg/config/defaults/defaultconfig.go index b3556673326..264b8c29ce6 100644 --- a/services/idp/pkg/config/defaults/defaultconfig.go +++ b/services/idp/pkg/config/defaults/defaultconfig.go @@ -159,7 +159,6 @@ func EnsureDefaults(cfg *config.Config) { cfg.Reva = structs.CopyOrZeroValue(cfg.Commons.Reva) } - } // Sanitize sanitizes the configuration diff --git a/services/idp/pkg/service/v0/service.go b/services/idp/pkg/service/v0/service.go index 01f442c929b..a8e7b14e9f9 100644 --- a/services/idp/pkg/service/v0/service.go +++ b/services/idp/pkg/service/v0/service.go @@ -154,7 +154,7 @@ func createTemporaryClientsConfig(filePath, ocisURL string, clients []config.Cli // Init cs3 backend vars which are currently not accessible via idp api func initCS3EnvVars(cs3Addr string) error { defaults := map[string]string{ - "CS3_GATEWAY": cs3Addr, + "CS3_GATEWAY": cs3Addr, } for k, v := range defaults { diff --git a/services/ocdav/pkg/config/config.go b/services/ocdav/pkg/config/config.go index cc724fb326b..61b6118e2cc 100644 --- a/services/ocdav/pkg/config/config.go +++ b/services/ocdav/pkg/config/config.go @@ -31,7 +31,6 @@ type Config struct { // Timeout in seconds when making requests to the gateway Timeout int64 `yaml:"gateway_request_timeout" env:"OCDAV_GATEWAY_REQUEST_TIMEOUT" desc:"Request timeout in seconds for requests from the oCDAV service to the GATEWAY service."` - Context context.Context `yaml:"-"` Status Status `yaml:"-"` diff --git a/services/ocdav/pkg/config/defaults/defaultconfig.go b/services/ocdav/pkg/config/defaults/defaultconfig.go index 0c79dfb1b37..f8def03d8d5 100644 --- a/services/ocdav/pkg/config/defaults/defaultconfig.go +++ b/services/ocdav/pkg/config/defaults/defaultconfig.go @@ -77,13 +77,13 @@ func DefaultConfig() *config.Config { Service: config.Service{ Name: "ocdav", }, - Reva: shared.DefaultRevaConfig(), - WebdavNamespace: "/users/{{.Id.OpaqueId}}", - FilesNamespace: "/users/{{.Id.OpaqueId}}", - SharesNamespace: "/Shares", - PublicURL: "https://localhost:9200", - Insecure: false, - Timeout: 84300, + Reva: shared.DefaultRevaConfig(), + WebdavNamespace: "/users/{{.Id.OpaqueId}}", + FilesNamespace: "/users/{{.Id.OpaqueId}}", + SharesNamespace: "/Shares", + PublicURL: "https://localhost:9200", + Insecure: false, + Timeout: 84300, Status: config.Status{ Version: version.Legacy, VersionString: version.LegacyString, diff --git a/services/policies/pkg/config/config.go b/services/policies/pkg/config/config.go index 11f0fd25f97..d8a1c4ac331 100644 --- a/services/policies/pkg/config/config.go +++ b/services/policies/pkg/config/config.go @@ -9,19 +9,19 @@ import ( // Config combines all available configuration parts. type Config struct { - Commons *shared.Commons `yaml:"-"` // don't use this directly as configuration for a service - GRPC GRPC `yaml:"grpc"` - Service Service `yaml:"-"` - Debug Debug `yaml:"debug"` - TokenManager *TokenManager `yaml:"token_manager"` - Events Events `yaml:"events"` - Reva *shared.Reva `yaml:"reva"` - GRPCClientTLS *shared.GRPCClientTLS `yaml:"grpc_client_tls"` - Context context.Context `yaml:"-"` - Log *Log `yaml:"log"` - Engine Engine `yaml:"engine"` - Postprocessing Postprocessing `yaml:"postprocessing"` - Tracing *Tracing `yaml:"tracing"` + Commons *shared.Commons `yaml:"-"` // don't use this directly as configuration for a service + GRPC GRPC `yaml:"grpc"` + Service Service `yaml:"-"` + Debug Debug `yaml:"debug"` + TokenManager *TokenManager `yaml:"token_manager"` + Events Events `yaml:"events"` + Reva *shared.Reva `yaml:"reva"` + GRPCClientTLS *shared.GRPCClientTLS `yaml:"grpc_client_tls"` + Context context.Context `yaml:"-"` + Log *Log `yaml:"log"` + Engine Engine `yaml:"engine"` + Postprocessing Postprocessing `yaml:"postprocessing"` + Tracing *Tracing `yaml:"tracing"` } // Service defines the available service configuration. diff --git a/services/policies/pkg/config/defaults/defaultconfig.go b/services/policies/pkg/config/defaults/defaultconfig.go index da2efedc12d..91ba7eeefc4 100644 --- a/services/policies/pkg/config/defaults/defaultconfig.go +++ b/services/policies/pkg/config/defaults/defaultconfig.go @@ -53,7 +53,6 @@ func EnsureDefaults(cfg *config.Config) { cfg.TokenManager = &config.TokenManager{} } - if cfg.Reva == nil && cfg.Commons != nil && cfg.Commons.Reva != nil { cfg.Reva = &shared.Reva{ Address: cfg.Commons.Reva.Address, diff --git a/services/proxy/pkg/proxy/policy/selector.go b/services/proxy/pkg/proxy/policy/selector.go index 05cf5d3a4ce..bd69aa237b6 100644 --- a/services/proxy/pkg/proxy/policy/selector.go +++ b/services/proxy/pkg/proxy/policy/selector.go @@ -27,28 +27,29 @@ const ( // Selector is a function which selects a proxy-policy based on the request. // // A policy is a random name which identifies a set of proxy-routes: -//{ -// "policies": [ -// { -// "name": "us-east-1", -// "routes": [ -// { -// "endpoint": "/", -// "backend": "https://backend.us.example.com:8080/app" -// } -// ] -// }, -// { -// "name": "eu-ams-1", -// "routes": [ -// { -// "endpoint": "/", -// "backend": "https://backend.eu.example.com:8080/app" -// } -// ] -// } -// ] -//} +// +// { +// "policies": [ +// { +// "name": "us-east-1", +// "routes": [ +// { +// "endpoint": "/", +// "backend": "https://backend.us.example.com:8080/app" +// } +// ] +// }, +// { +// "name": "eu-ams-1", +// "routes": [ +// { +// "endpoint": "/", +// "backend": "https://backend.eu.example.com:8080/app" +// } +// ] +// } +// ] +// } type Selector func(r *http.Request) (string, error) // LoadSelector constructs a specific policy-selector from a given configuration @@ -97,9 +98,9 @@ func LoadSelector(cfg *config.PolicySelector) (Selector, error) { // // Configuration: // -// "policy_selector": { -// "static": {"policy" : "ocis"} -// }, +// "policy_selector": { +// "static": {"policy" : "ocis"} +// }, func NewStaticSelector(cfg *config.StaticSelectorConf) Selector { return func(r *http.Request) (s string, err error) { return cfg.Policy, nil @@ -108,12 +109,13 @@ func NewStaticSelector(cfg *config.StaticSelectorConf) Selector { // NewClaimsSelector selects the policy based on the "ocis.routing.policy" claim // The policy for corner cases is configurable: -// "policy_selector": { -// "migration": { -// "default_policy" : "ocis", -// "unauthenticated_policy": "oc10" -// } -// }, +// +// "policy_selector": { +// "migration": { +// "default_policy" : "ocis", +// "unauthenticated_policy": "oc10" +// } +// }, // // This selector can be used in migration-scenarios where some users have already migrated from ownCloud10 to OCIS and func NewClaimsSelector(cfg *config.ClaimsSelectorConf) Selector { @@ -154,19 +156,20 @@ func NewClaimsSelector(cfg *config.ClaimsSelectorConf) Selector { // NewRegexSelector selects the policy based on a user property // The policy for each case is configurable: -// "policy_selector": { -// "regex": { -// "matches_policies": [ -// {"priority": 10, "property": "mail", "match": "marie@example.org", "policy": "ocis"}, -// {"priority": 20, "property": "mail", "match": "[^@]+@example.org", "policy": "oc10"}, -// {"priority": 30, "property": "username", "match": "(einstein|feynman)", "policy": "ocis"}, -// {"priority": 40, "property": "username", "match": ".+", "policy": "oc10"}, -// {"priority": 50, "property": "id", "match": "4c510ada-c86b-4815-8820-42cdf82c3d51", "policy": "ocis"}, -// {"priority": 60, "property": "id", "match": "f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c", "policy": "oc10"} -// ], -// "unauthenticated_policy": "oc10" -// } -// }, +// +// "policy_selector": { +// "regex": { +// "matches_policies": [ +// {"priority": 10, "property": "mail", "match": "marie@example.org", "policy": "ocis"}, +// {"priority": 20, "property": "mail", "match": "[^@]+@example.org", "policy": "oc10"}, +// {"priority": 30, "property": "username", "match": "(einstein|feynman)", "policy": "ocis"}, +// {"priority": 40, "property": "username", "match": ".+", "policy": "oc10"}, +// {"priority": 50, "property": "id", "match": "4c510ada-c86b-4815-8820-42cdf82c3d51", "policy": "ocis"}, +// {"priority": 60, "property": "id", "match": "f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c", "policy": "oc10"} +// ], +// "unauthenticated_policy": "oc10" +// } +// }, // // This selector can be used in migration-scenarios where some users have already migrated from ownCloud10 to OCIS and func NewRegexSelector(cfg *config.RegexSelectorConf) Selector { diff --git a/services/thumbnails/pkg/preprocessor/fontloader.go b/services/thumbnails/pkg/preprocessor/fontloader.go index eb5a60789d2..672e62593cb 100644 --- a/services/thumbnails/pkg/preprocessor/fontloader.go +++ b/services/thumbnails/pkg/preprocessor/fontloader.go @@ -51,6 +51,7 @@ type FontLoader struct { // Note that only the fonts described in the fontMapFile will be used. // // The fontMapFile has the following structure +// // { // "fontMap": { // "Han": "packaged/myFont-CJK.otf", diff --git a/services/thumbnails/pkg/preprocessor/textanalyzer_test.go b/services/thumbnails/pkg/preprocessor/textanalyzer_test.go index 91f98024779..3efeea930c3 100644 --- a/services/thumbnails/pkg/preprocessor/textanalyzer_test.go +++ b/services/thumbnails/pkg/preprocessor/textanalyzer_test.go @@ -47,7 +47,7 @@ func TestAnalyzeString(t *testing.T) { opts: defaultOpts, eOut: TextAnalysis{ ScriptRanges: []ScriptRange{ - ScriptRange{Low: 0, High: 10, Spaces: []int{5}, TargetScript: "Latin", RuneCount: 11}, + {Low: 0, High: 10, Spaces: []int{5}, TargetScript: "Latin", RuneCount: 11}, }, RuneCount: map[string]int{ "Latin": 11, @@ -60,7 +60,7 @@ func TestAnalyzeString(t *testing.T) { opts: defaultOpts, eOut: TextAnalysis{ ScriptRanges: []ScriptRange{ - ScriptRange{Low: 0, High: 12, Spaces: []int{8, 12}, TargetScript: "Latin", RuneCount: 13}, + {Low: 0, High: 12, Spaces: []int{8, 12}, TargetScript: "Latin", RuneCount: 13}, }, RuneCount: map[string]int{ "Latin": 13, @@ -73,7 +73,7 @@ func TestAnalyzeString(t *testing.T) { opts: defaultOpts, eOut: TextAnalysis{ ScriptRanges: []ScriptRange{ - ScriptRange{Low: 0, High: 45, Spaces: []int{5, 11, 16, 21, 25, 30, 34}, TargetScript: "Latin", RuneCount: 44}, + {Low: 0, High: 45, Spaces: []int{5, 11, 16, 21, 25, 30, 34}, TargetScript: "Latin", RuneCount: 44}, }, RuneCount: map[string]int{ "Latin": 44, @@ -86,7 +86,7 @@ func TestAnalyzeString(t *testing.T) { opts: defaultOpts, eOut: TextAnalysis{ ScriptRanges: []ScriptRange{ - ScriptRange{Low: 0, High: 14, Spaces: []int{5, 10}, TargetScript: "Latin", RuneCount: 12}, + {Low: 0, High: 14, Spaces: []int{5, 10}, TargetScript: "Latin", RuneCount: 12}, }, RuneCount: map[string]int{ "Latin": 12, @@ -99,7 +99,7 @@ func TestAnalyzeString(t *testing.T) { opts: defaultOpts, eOut: TextAnalysis{ ScriptRanges: []ScriptRange{ - ScriptRange{Low: 0, High: 15, Spaces: []int{6}, TargetScript: "Hangul", RuneCount: 6}, + {Low: 0, High: 15, Spaces: []int{6}, TargetScript: "Hangul", RuneCount: 6}, }, RuneCount: map[string]int{ "Hangul": 6, @@ -112,7 +112,7 @@ func TestAnalyzeString(t *testing.T) { opts: defaultOpts, eOut: TextAnalysis{ ScriptRanges: []ScriptRange{ - ScriptRange{Low: 0, High: 20, Spaces: []int{}, TargetScript: "Hiragana", RuneCount: 7}, + {Low: 0, High: 20, Spaces: []int{}, TargetScript: "Hiragana", RuneCount: 7}, }, RuneCount: map[string]int{ "Hiragana": 7, @@ -125,7 +125,7 @@ func TestAnalyzeString(t *testing.T) { opts: defaultOpts, eOut: TextAnalysis{ ScriptRanges: []ScriptRange{ - ScriptRange{Low: 0, High: 14, Spaces: []int{}, TargetScript: "Katakana", RuneCount: 5}, + {Low: 0, High: 14, Spaces: []int{}, TargetScript: "Katakana", RuneCount: 5}, }, RuneCount: map[string]int{ "Katakana": 5, @@ -138,7 +138,7 @@ func TestAnalyzeString(t *testing.T) { opts: defaultOpts, eOut: TextAnalysis{ ScriptRanges: []ScriptRange{ - ScriptRange{Low: 0, High: 26, Spaces: []int{}, TargetScript: "Hiragana", RuneCount: 9}, + {Low: 0, High: 26, Spaces: []int{}, TargetScript: "Hiragana", RuneCount: 9}, }, RuneCount: map[string]int{ "Hiragana": 9, @@ -151,7 +151,7 @@ func TestAnalyzeString(t *testing.T) { opts: defaultOpts, eOut: TextAnalysis{ ScriptRanges: []ScriptRange{ - ScriptRange{Low: 0, High: 35, Spaces: []int{}, TargetScript: "Hiragana", RuneCount: 12}, + {Low: 0, High: 35, Spaces: []int{}, TargetScript: "Hiragana", RuneCount: 12}, }, RuneCount: map[string]int{ "Hiragana": 12, @@ -164,7 +164,7 @@ func TestAnalyzeString(t *testing.T) { opts: defaultOpts, eOut: TextAnalysis{ ScriptRanges: []ScriptRange{ - ScriptRange{Low: 0, High: 36, Spaces: []int{27}, TargetScript: "Hiragana", RuneCount: 13}, + {Low: 0, High: 36, Spaces: []int{27}, TargetScript: "Hiragana", RuneCount: 13}, }, RuneCount: map[string]int{ "Hiragana": 13, @@ -177,7 +177,7 @@ func TestAnalyzeString(t *testing.T) { opts: defaultOpts, eOut: TextAnalysis{ ScriptRanges: []ScriptRange{ - ScriptRange{Low: 0, High: 45, Spaces: []int{21}, TargetScript: "Devanagari", RuneCount: 16}, + {Low: 0, High: 45, Spaces: []int{21}, TargetScript: "Devanagari", RuneCount: 16}, }, RuneCount: map[string]int{ "Devanagari": 16, @@ -190,9 +190,9 @@ func TestAnalyzeString(t *testing.T) { opts: defaultOpts, eOut: TextAnalysis{ ScriptRanges: []ScriptRange{ - ScriptRange{Low: 0, High: 5, Spaces: []int{5}, TargetScript: "Latin", RuneCount: 6}, - ScriptRange{Low: 6, High: 12, Spaces: []int{12}, TargetScript: "Hangul", RuneCount: 3}, - ScriptRange{Low: 13, High: 24, Spaces: []int{19}, TargetScript: "Han", RuneCount: 5}, // 🚀 and ! are "Common" script and will be merged with "Han" + {Low: 0, High: 5, Spaces: []int{5}, TargetScript: "Latin", RuneCount: 6}, + {Low: 6, High: 12, Spaces: []int{12}, TargetScript: "Hangul", RuneCount: 3}, + {Low: 13, High: 24, Spaces: []int{19}, TargetScript: "Han", RuneCount: 5}, // 🚀 and ! are "Common" script and will be merged with "Han" }, RuneCount: map[string]int{ "Latin": 6, @@ -207,7 +207,7 @@ func TestAnalyzeString(t *testing.T) { opts: defaultOpts, eOut: TextAnalysis{ ScriptRanges: []ScriptRange{ - ScriptRange{Low: 0, High: 5, Spaces: []int{}, TargetScript: "Latin", RuneCount: 5}, + {Low: 0, High: 5, Spaces: []int{}, TargetScript: "Latin", RuneCount: 5}, }, RuneCount: map[string]int{ "Latin": 5, @@ -220,7 +220,7 @@ func TestAnalyzeString(t *testing.T) { opts: defaultOpts, eOut: TextAnalysis{ ScriptRanges: []ScriptRange{ - ScriptRange{Low: 0, High: 5, Spaces: []int{2}, TargetScript: "Latin", RuneCount: 4}, + {Low: 0, High: 5, Spaces: []int{2}, TargetScript: "Latin", RuneCount: 4}, }, RuneCount: map[string]int{ "Latin": 4, @@ -233,7 +233,7 @@ func TestAnalyzeString(t *testing.T) { opts: defaultOpts, eOut: TextAnalysis{ ScriptRanges: []ScriptRange{ - ScriptRange{Low: 0, High: 28, Spaces: []int{14}, TargetScript: "_unknown", RuneCount: 15}, + {Low: 0, High: 28, Spaces: []int{14}, TargetScript: "_unknown", RuneCount: 15}, }, RuneCount: map[string]int{ "_unknown": 15, @@ -246,8 +246,8 @@ func TestAnalyzeString(t *testing.T) { opts: defaultOpts, eOut: TextAnalysis{ ScriptRanges: []ScriptRange{ - ScriptRange{Low: 0, High: 5, Spaces: []int{5}, TargetScript: "Latin", RuneCount: 6}, - ScriptRange{Low: 6, High: 19, Spaces: []int{}, TargetScript: "_unknown", RuneCount: 7}, + {Low: 0, High: 5, Spaces: []int{5}, TargetScript: "Latin", RuneCount: 6}, + {Low: 6, High: 19, Spaces: []int{}, TargetScript: "_unknown", RuneCount: 7}, }, RuneCount: map[string]int{ "Latin": 6, @@ -261,7 +261,7 @@ func TestAnalyzeString(t *testing.T) { opts: defaultOpts, eOut: TextAnalysis{ ScriptRanges: []ScriptRange{ - ScriptRange{Low: 0, High: 16, Spaces: []int{0, 6, 16}, TargetScript: "Latin", RuneCount: 17}, + {Low: 0, High: 16, Spaces: []int{0, 6, 16}, TargetScript: "Latin", RuneCount: 17}, }, RuneCount: map[string]int{ "Latin": 17, @@ -304,9 +304,9 @@ func TestAnalyzeStringRaw(t *testing.T) { input: inputs[0], eOut: TextAnalysis{ ScriptRanges: []ScriptRange{ - ScriptRange{Low: 0, High: 4, Spaces: []int{}, TargetScript: "Latin", RuneCount: 5}, - ScriptRange{Low: 5, High: 5, Spaces: []int{5}, TargetScript: "Common", RuneCount: 1}, - ScriptRange{Low: 6, High: 10, Spaces: []int{}, TargetScript: "Latin", RuneCount: 5}, + {Low: 0, High: 4, Spaces: []int{}, TargetScript: "Latin", RuneCount: 5}, + {Low: 5, High: 5, Spaces: []int{5}, TargetScript: "Common", RuneCount: 1}, + {Low: 6, High: 10, Spaces: []int{}, TargetScript: "Latin", RuneCount: 5}, }, RuneCount: map[string]int{ "Latin": 10, @@ -319,10 +319,10 @@ func TestAnalyzeStringRaw(t *testing.T) { input: inputs[1], eOut: TextAnalysis{ ScriptRanges: []ScriptRange{ - ScriptRange{Low: 0, High: 7, Spaces: []int{}, TargetScript: "Latin", RuneCount: 8}, - ScriptRange{Low: 8, High: 8, Spaces: []int{8}, TargetScript: "Common", RuneCount: 1}, - ScriptRange{Low: 9, High: 11, Spaces: []int{}, TargetScript: "Latin", RuneCount: 3}, - ScriptRange{Low: 12, High: 12, Spaces: []int{12}, TargetScript: "Common", RuneCount: 1}, + {Low: 0, High: 7, Spaces: []int{}, TargetScript: "Latin", RuneCount: 8}, + {Low: 8, High: 8, Spaces: []int{8}, TargetScript: "Common", RuneCount: 1}, + {Low: 9, High: 11, Spaces: []int{}, TargetScript: "Latin", RuneCount: 3}, + {Low: 12, High: 12, Spaces: []int{12}, TargetScript: "Common", RuneCount: 1}, }, RuneCount: map[string]int{ "Latin": 11, @@ -335,16 +335,16 @@ func TestAnalyzeStringRaw(t *testing.T) { input: inputs[2], eOut: TextAnalysis{ ScriptRanges: []ScriptRange{ - ScriptRange{Low: 0, High: 4, Spaces: []int{}, TargetScript: "Latin", RuneCount: 5}, - ScriptRange{Low: 5, High: 5, Spaces: []int{5}, TargetScript: "Common", RuneCount: 1}, - ScriptRange{Low: 6, High: 9, Spaces: []int{}, TargetScript: "Latin", RuneCount: 4}, - ScriptRange{Low: 10, High: 21, Spaces: []int{11, 16, 21}, TargetScript: "Common", RuneCount: 11}, // £ takes 2 bytes - ScriptRange{Low: 22, High: 24, Spaces: []int{}, TargetScript: "Latin", RuneCount: 3}, - ScriptRange{Low: 25, High: 30, Spaces: []int{25, 30}, TargetScript: "Common", RuneCount: 5}, // ¥ takes 2 bytes - ScriptRange{Low: 31, High: 33, Spaces: []int{}, TargetScript: "Latin", RuneCount: 3}, - ScriptRange{Low: 34, High: 34, Spaces: []int{34}, TargetScript: "Common", RuneCount: 1}, - ScriptRange{Low: 35, High: 44, Spaces: []int{}, TargetScript: "Latin", RuneCount: 10}, - ScriptRange{Low: 45, High: 45, Spaces: []int{}, TargetScript: "Common", RuneCount: 1}, + {Low: 0, High: 4, Spaces: []int{}, TargetScript: "Latin", RuneCount: 5}, + {Low: 5, High: 5, Spaces: []int{5}, TargetScript: "Common", RuneCount: 1}, + {Low: 6, High: 9, Spaces: []int{}, TargetScript: "Latin", RuneCount: 4}, + {Low: 10, High: 21, Spaces: []int{11, 16, 21}, TargetScript: "Common", RuneCount: 11}, // £ takes 2 bytes + {Low: 22, High: 24, Spaces: []int{}, TargetScript: "Latin", RuneCount: 3}, + {Low: 25, High: 30, Spaces: []int{25, 30}, TargetScript: "Common", RuneCount: 5}, // ¥ takes 2 bytes + {Low: 31, High: 33, Spaces: []int{}, TargetScript: "Latin", RuneCount: 3}, + {Low: 34, High: 34, Spaces: []int{34}, TargetScript: "Common", RuneCount: 1}, + {Low: 35, High: 44, Spaces: []int{}, TargetScript: "Latin", RuneCount: 10}, + {Low: 45, High: 45, Spaces: []int{}, TargetScript: "Common", RuneCount: 1}, }, RuneCount: map[string]int{ "Latin": 25, @@ -357,10 +357,10 @@ func TestAnalyzeStringRaw(t *testing.T) { input: inputs[3], eOut: TextAnalysis{ ScriptRanges: []ScriptRange{ - ScriptRange{Low: 0, High: 4, Spaces: []int{}, TargetScript: "Latin", RuneCount: 5}, - ScriptRange{Low: 5, High: 5, Spaces: []int{5}, TargetScript: "Common", RuneCount: 1}, - ScriptRange{Low: 6, High: 9, Spaces: []int{}, TargetScript: "Latin", RuneCount: 4}, - ScriptRange{Low: 10, High: 14, Spaces: []int{10}, TargetScript: "Common", RuneCount: 2}, + {Low: 0, High: 4, Spaces: []int{}, TargetScript: "Latin", RuneCount: 5}, + {Low: 5, High: 5, Spaces: []int{5}, TargetScript: "Common", RuneCount: 1}, + {Low: 6, High: 9, Spaces: []int{}, TargetScript: "Latin", RuneCount: 4}, + {Low: 10, High: 14, Spaces: []int{10}, TargetScript: "Common", RuneCount: 2}, }, RuneCount: map[string]int{ "Latin": 9, @@ -373,9 +373,9 @@ func TestAnalyzeStringRaw(t *testing.T) { input: inputs[4], eOut: TextAnalysis{ ScriptRanges: []ScriptRange{ - ScriptRange{Low: 0, High: 5, Spaces: []int{}, TargetScript: "Hangul", RuneCount: 2}, - ScriptRange{Low: 6, High: 6, Spaces: []int{6}, TargetScript: "Common", RuneCount: 1}, - ScriptRange{Low: 7, High: 15, Spaces: []int{}, TargetScript: "Hangul", RuneCount: 3}, + {Low: 0, High: 5, Spaces: []int{}, TargetScript: "Hangul", RuneCount: 2}, + {Low: 6, High: 6, Spaces: []int{6}, TargetScript: "Common", RuneCount: 1}, + {Low: 7, High: 15, Spaces: []int{}, TargetScript: "Hangul", RuneCount: 3}, }, RuneCount: map[string]int{ "Hangul": 5, @@ -388,9 +388,9 @@ func TestAnalyzeStringRaw(t *testing.T) { input: inputs[5], eOut: TextAnalysis{ ScriptRanges: []ScriptRange{ - ScriptRange{Low: 0, High: 8, Spaces: []int{}, TargetScript: "Han", RuneCount: 3}, - ScriptRange{Low: 9, High: 11, Spaces: []int{}, TargetScript: "Hiragana", RuneCount: 1}, - ScriptRange{Low: 12, High: 20, Spaces: []int{}, TargetScript: "Han", RuneCount: 3}, + {Low: 0, High: 8, Spaces: []int{}, TargetScript: "Han", RuneCount: 3}, + {Low: 9, High: 11, Spaces: []int{}, TargetScript: "Hiragana", RuneCount: 1}, + {Low: 12, High: 20, Spaces: []int{}, TargetScript: "Han", RuneCount: 3}, }, RuneCount: map[string]int{ "Hiragana": 1, @@ -403,10 +403,10 @@ func TestAnalyzeStringRaw(t *testing.T) { input: inputs[6], eOut: TextAnalysis{ ScriptRanges: []ScriptRange{ - ScriptRange{Low: 0, High: 2, Spaces: []int{}, TargetScript: "Katakana", RuneCount: 1}, - ScriptRange{Low: 3, High: 5, Spaces: []int{}, TargetScript: "Common", RuneCount: 1}, // ー U+30FC (KATAKANA-HIRAGANA PROLONGED SOUND MARK) seems to be counted as Common - ScriptRange{Low: 6, High: 11, Spaces: []int{}, TargetScript: "Katakana", RuneCount: 2}, - ScriptRange{Low: 12, High: 14, Spaces: []int{}, TargetScript: "Han", RuneCount: 1}, + {Low: 0, High: 2, Spaces: []int{}, TargetScript: "Katakana", RuneCount: 1}, + {Low: 3, High: 5, Spaces: []int{}, TargetScript: "Common", RuneCount: 1}, // ー U+30FC (KATAKANA-HIRAGANA PROLONGED SOUND MARK) seems to be counted as Common + {Low: 6, High: 11, Spaces: []int{}, TargetScript: "Katakana", RuneCount: 2}, + {Low: 12, High: 14, Spaces: []int{}, TargetScript: "Han", RuneCount: 1}, }, RuneCount: map[string]int{ "Katakana": 3, @@ -420,10 +420,10 @@ func TestAnalyzeStringRaw(t *testing.T) { input: inputs[7], eOut: TextAnalysis{ ScriptRanges: []ScriptRange{ - ScriptRange{Low: 0, High: 2, Spaces: []int{}, TargetScript: "Han", RuneCount: 1}, - ScriptRange{Low: 3, High: 5, Spaces: []int{}, TargetScript: "Hiragana", RuneCount: 1}, - ScriptRange{Low: 6, High: 20, Spaces: []int{}, TargetScript: "Katakana", RuneCount: 5}, - ScriptRange{Low: 21, High: 26, Spaces: []int{}, TargetScript: "Hiragana", RuneCount: 2}, + {Low: 0, High: 2, Spaces: []int{}, TargetScript: "Han", RuneCount: 1}, + {Low: 3, High: 5, Spaces: []int{}, TargetScript: "Hiragana", RuneCount: 1}, + {Low: 6, High: 20, Spaces: []int{}, TargetScript: "Katakana", RuneCount: 5}, + {Low: 21, High: 26, Spaces: []int{}, TargetScript: "Hiragana", RuneCount: 2}, }, RuneCount: map[string]int{ "Han": 1, @@ -437,12 +437,12 @@ func TestAnalyzeStringRaw(t *testing.T) { input: inputs[8], eOut: TextAnalysis{ ScriptRanges: []ScriptRange{ - ScriptRange{Low: 0, High: 5, Spaces: []int{}, TargetScript: "Katakana", RuneCount: 2}, - ScriptRange{Low: 6, High: 8, Spaces: []int{}, TargetScript: "Common", RuneCount: 1}, - ScriptRange{Low: 9, High: 11, Spaces: []int{}, TargetScript: "Han", RuneCount: 1}, - ScriptRange{Low: 12, High: 14, Spaces: []int{}, TargetScript: "Hiragana", RuneCount: 1}, - ScriptRange{Low: 15, High: 29, Spaces: []int{}, TargetScript: "Katakana", RuneCount: 5}, - ScriptRange{Low: 30, High: 35, Spaces: []int{}, TargetScript: "Hiragana", RuneCount: 2}, + {Low: 0, High: 5, Spaces: []int{}, TargetScript: "Katakana", RuneCount: 2}, + {Low: 6, High: 8, Spaces: []int{}, TargetScript: "Common", RuneCount: 1}, + {Low: 9, High: 11, Spaces: []int{}, TargetScript: "Han", RuneCount: 1}, + {Low: 12, High: 14, Spaces: []int{}, TargetScript: "Hiragana", RuneCount: 1}, + {Low: 15, High: 29, Spaces: []int{}, TargetScript: "Katakana", RuneCount: 5}, + {Low: 30, High: 35, Spaces: []int{}, TargetScript: "Hiragana", RuneCount: 2}, }, RuneCount: map[string]int{ "Han": 1, @@ -457,13 +457,13 @@ func TestAnalyzeStringRaw(t *testing.T) { input: inputs[9], eOut: TextAnalysis{ ScriptRanges: []ScriptRange{ - ScriptRange{Low: 0, High: 2, Spaces: []int{}, TargetScript: "Han", RuneCount: 1}, - ScriptRange{Low: 3, High: 5, Spaces: []int{}, TargetScript: "Hiragana", RuneCount: 1}, - ScriptRange{Low: 6, High: 20, Spaces: []int{}, TargetScript: "Katakana", RuneCount: 5}, - ScriptRange{Low: 21, High: 26, Spaces: []int{}, TargetScript: "Hiragana", RuneCount: 2}, - ScriptRange{Low: 27, High: 27, Spaces: []int{27}, TargetScript: "Common", RuneCount: 1}, - ScriptRange{Low: 28, High: 33, Spaces: []int{}, TargetScript: "Katakana", RuneCount: 2}, - ScriptRange{Low: 34, High: 36, Spaces: []int{}, TargetScript: "Common", RuneCount: 1}, + {Low: 0, High: 2, Spaces: []int{}, TargetScript: "Han", RuneCount: 1}, + {Low: 3, High: 5, Spaces: []int{}, TargetScript: "Hiragana", RuneCount: 1}, + {Low: 6, High: 20, Spaces: []int{}, TargetScript: "Katakana", RuneCount: 5}, + {Low: 21, High: 26, Spaces: []int{}, TargetScript: "Hiragana", RuneCount: 2}, + {Low: 27, High: 27, Spaces: []int{27}, TargetScript: "Common", RuneCount: 1}, + {Low: 28, High: 33, Spaces: []int{}, TargetScript: "Katakana", RuneCount: 2}, + {Low: 34, High: 36, Spaces: []int{}, TargetScript: "Common", RuneCount: 1}, }, RuneCount: map[string]int{ "Han": 1, @@ -478,9 +478,9 @@ func TestAnalyzeStringRaw(t *testing.T) { input: inputs[10], eOut: TextAnalysis{ ScriptRanges: []ScriptRange{ - ScriptRange{Low: 0, High: 20, Spaces: []int{}, TargetScript: "Devanagari", RuneCount: 7}, - ScriptRange{Low: 21, High: 21, Spaces: []int{21}, TargetScript: "Common", RuneCount: 1}, - ScriptRange{Low: 22, High: 45, Spaces: []int{}, TargetScript: "Devanagari", RuneCount: 8}, + {Low: 0, High: 20, Spaces: []int{}, TargetScript: "Devanagari", RuneCount: 7}, + {Low: 21, High: 21, Spaces: []int{21}, TargetScript: "Common", RuneCount: 1}, + {Low: 22, High: 45, Spaces: []int{}, TargetScript: "Devanagari", RuneCount: 8}, }, RuneCount: map[string]int{ "Devanagari": 15, @@ -493,12 +493,12 @@ func TestAnalyzeStringRaw(t *testing.T) { input: inputs[11], eOut: TextAnalysis{ ScriptRanges: []ScriptRange{ - ScriptRange{Low: 0, High: 4, Spaces: []int{}, TargetScript: "Latin", RuneCount: 5}, - ScriptRange{Low: 5, High: 5, Spaces: []int{5}, TargetScript: "Common", RuneCount: 1}, - ScriptRange{Low: 6, High: 11, Spaces: []int{}, TargetScript: "Hangul", RuneCount: 2}, - ScriptRange{Low: 12, High: 12, Spaces: []int{12}, TargetScript: "Common", RuneCount: 1}, - ScriptRange{Low: 13, High: 18, Spaces: []int{}, TargetScript: "Han", RuneCount: 2}, - ScriptRange{Low: 19, High: 24, Spaces: []int{19}, TargetScript: "Common", RuneCount: 3}, + {Low: 0, High: 4, Spaces: []int{}, TargetScript: "Latin", RuneCount: 5}, + {Low: 5, High: 5, Spaces: []int{5}, TargetScript: "Common", RuneCount: 1}, + {Low: 6, High: 11, Spaces: []int{}, TargetScript: "Hangul", RuneCount: 2}, + {Low: 12, High: 12, Spaces: []int{12}, TargetScript: "Common", RuneCount: 1}, + {Low: 13, High: 18, Spaces: []int{}, TargetScript: "Han", RuneCount: 2}, + {Low: 19, High: 24, Spaces: []int{19}, TargetScript: "Common", RuneCount: 3}, }, RuneCount: map[string]int{ "Latin": 5, @@ -513,11 +513,11 @@ func TestAnalyzeStringRaw(t *testing.T) { input: inputs[12], eOut: TextAnalysis{ ScriptRanges: []ScriptRange{ - ScriptRange{Low: 0, High: 0, Spaces: []int{}, TargetScript: "Common", RuneCount: 1}, - ScriptRange{Low: 1, High: 1, Spaces: []int{}, TargetScript: "Latin", RuneCount: 1}, - ScriptRange{Low: 2, High: 3, Spaces: []int{}, TargetScript: "Inherited", RuneCount: 1}, - ScriptRange{Low: 4, High: 4, Spaces: []int{}, TargetScript: "Latin", RuneCount: 1}, - ScriptRange{Low: 5, High: 5, Spaces: []int{}, TargetScript: "Common", RuneCount: 1}, + {Low: 0, High: 0, Spaces: []int{}, TargetScript: "Common", RuneCount: 1}, + {Low: 1, High: 1, Spaces: []int{}, TargetScript: "Latin", RuneCount: 1}, + {Low: 2, High: 3, Spaces: []int{}, TargetScript: "Inherited", RuneCount: 1}, + {Low: 4, High: 4, Spaces: []int{}, TargetScript: "Latin", RuneCount: 1}, + {Low: 5, High: 5, Spaces: []int{}, TargetScript: "Common", RuneCount: 1}, }, RuneCount: map[string]int{ "Latin": 2, @@ -531,10 +531,10 @@ func TestAnalyzeStringRaw(t *testing.T) { input: inputs[13], // ä and a + ¨ eOut: TextAnalysis{ ScriptRanges: []ScriptRange{ - ScriptRange{Low: 0, High: 1, Spaces: []int{}, TargetScript: "Latin", RuneCount: 1}, - ScriptRange{Low: 2, High: 2, Spaces: []int{2}, TargetScript: "Common", RuneCount: 1}, - ScriptRange{Low: 3, High: 3, Spaces: []int{}, TargetScript: "Latin", RuneCount: 1}, - ScriptRange{Low: 4, High: 5, Spaces: []int{}, TargetScript: "Inherited", RuneCount: 1}, + {Low: 0, High: 1, Spaces: []int{}, TargetScript: "Latin", RuneCount: 1}, + {Low: 2, High: 2, Spaces: []int{2}, TargetScript: "Common", RuneCount: 1}, + {Low: 3, High: 3, Spaces: []int{}, TargetScript: "Latin", RuneCount: 1}, + {Low: 4, High: 5, Spaces: []int{}, TargetScript: "Inherited", RuneCount: 1}, }, RuneCount: map[string]int{ "Latin": 2, @@ -548,9 +548,9 @@ func TestAnalyzeStringRaw(t *testing.T) { input: inputs[14], // cyrillic script isn't part of our default eOut: TextAnalysis{ ScriptRanges: []ScriptRange{ - ScriptRange{Low: 0, High: 13, Spaces: []int{}, TargetScript: "_unknown", RuneCount: 7}, - ScriptRange{Low: 14, High: 14, Spaces: []int{14}, TargetScript: "Common", RuneCount: 1}, - ScriptRange{Low: 15, High: 28, Spaces: []int{}, TargetScript: "_unknown", RuneCount: 7}, + {Low: 0, High: 13, Spaces: []int{}, TargetScript: "_unknown", RuneCount: 7}, + {Low: 14, High: 14, Spaces: []int{14}, TargetScript: "Common", RuneCount: 1}, + {Low: 15, High: 28, Spaces: []int{}, TargetScript: "_unknown", RuneCount: 7}, }, RuneCount: map[string]int{ "_unknown": 14, @@ -563,9 +563,9 @@ func TestAnalyzeStringRaw(t *testing.T) { input: inputs[15], // latin + cyrillic (cyrillic script isn't part of our default) eOut: TextAnalysis{ ScriptRanges: []ScriptRange{ - ScriptRange{Low: 0, High: 4, Spaces: []int{}, TargetScript: "Latin", RuneCount: 5}, - ScriptRange{Low: 5, High: 5, Spaces: []int{5}, TargetScript: "Common", RuneCount: 1}, - ScriptRange{Low: 6, High: 19, Spaces: []int{}, TargetScript: "_unknown", RuneCount: 7}, + {Low: 0, High: 4, Spaces: []int{}, TargetScript: "Latin", RuneCount: 5}, + {Low: 5, High: 5, Spaces: []int{5}, TargetScript: "Common", RuneCount: 1}, + {Low: 6, High: 19, Spaces: []int{}, TargetScript: "_unknown", RuneCount: 7}, }, RuneCount: map[string]int{ "Latin": 5, @@ -579,11 +579,11 @@ func TestAnalyzeStringRaw(t *testing.T) { input: inputs[16], eOut: TextAnalysis{ ScriptRanges: []ScriptRange{ - ScriptRange{Low: 0, High: 0, Spaces: []int{0}, TargetScript: "Common", RuneCount: 1}, - ScriptRange{Low: 1, High: 5, Spaces: []int{}, TargetScript: "Latin", RuneCount: 5}, - ScriptRange{Low: 6, High: 6, Spaces: []int{6}, TargetScript: "Common", RuneCount: 1}, - ScriptRange{Low: 7, High: 15, Spaces: []int{}, TargetScript: "Latin", RuneCount: 9}, - ScriptRange{Low: 16, High: 16, Spaces: []int{16}, TargetScript: "Common", RuneCount: 1}, + {Low: 0, High: 0, Spaces: []int{0}, TargetScript: "Common", RuneCount: 1}, + {Low: 1, High: 5, Spaces: []int{}, TargetScript: "Latin", RuneCount: 5}, + {Low: 6, High: 6, Spaces: []int{6}, TargetScript: "Common", RuneCount: 1}, + {Low: 7, High: 15, Spaces: []int{}, TargetScript: "Latin", RuneCount: 9}, + {Low: 16, High: 16, Spaces: []int{16}, TargetScript: "Common", RuneCount: 1}, }, RuneCount: map[string]int{ "Latin": 14, diff --git a/services/thumbnails/pkg/service/grpc/v0/decorators/base.go b/services/thumbnails/pkg/service/grpc/v0/decorators/base.go index 040d2f922a6..c43d393dec0 100644 --- a/services/thumbnails/pkg/service/grpc/v0/decorators/base.go +++ b/services/thumbnails/pkg/service/grpc/v0/decorators/base.go @@ -22,20 +22,22 @@ type DecoratedService interface { // // Expected implementations will be like: // ``` -// type MyDecorator struct { -// Decorator -// myCustomOpts *opts -// additionalSrv *srv -// } -// -// func NewMyDecorator(next DecoratedService, customOpts *customOpts) DecoratedService { -// ..... -// return MyDecorator{ -// Decorator: Decorator{next: next}, -// myCustomOpts: opts, -// additionalSrv: srv, -// } -// } +// +// type MyDecorator struct { +// Decorator +// myCustomOpts *opts +// additionalSrv *srv +// } +// +// func NewMyDecorator(next DecoratedService, customOpts *customOpts) DecoratedService { +// ..... +// return MyDecorator{ +// Decorator: Decorator{next: next}, +// myCustomOpts: opts, +// additionalSrv: srv, +// } +// } +// // ``` type Decorator struct { next DecoratedService @@ -47,12 +49,14 @@ type Decorator struct { // Your custom decorator is expected to overwrite this function, // but it MUST call the underlying decoratedService at some point // ``` -// func (d MyDecorator) GetThumbnail(ctx context.Context, req *thumbnailssvc.GetThumbnailRequest, resp *thumbnailssvc.GetThumbnailResponse) error { -// doSomething() -// err := d.next.GetThumbnail(ctx, req, resp) -// doAnotherThing() -// return err -// } +// +// func (d MyDecorator) GetThumbnail(ctx context.Context, req *thumbnailssvc.GetThumbnailRequest, resp *thumbnailssvc.GetThumbnailResponse) error { +// doSomething() +// err := d.next.GetThumbnail(ctx, req, resp) +// doAnotherThing() +// return err +// } +// // ``` func (deco Decorator) GetThumbnail(ctx context.Context, req *thumbnailssvc.GetThumbnailRequest, resp *thumbnailssvc.GetThumbnailResponse) error { return deco.next.GetThumbnail(ctx, req, resp) diff --git a/services/webdav/pkg/prop/prop.go b/services/webdav/pkg/prop/prop.go index b34ce19fe81..e61b68ddc11 100644 --- a/services/webdav/pkg/prop/prop.go +++ b/services/webdav/pkg/prop/prop.go @@ -97,9 +97,12 @@ func Next(d *xml.Decoder) (xml.Token, error) { } // ActiveLock holds active lock xml data -// http://www.webdav.org/specs/rfc4918.html#ELEMENT_activelock +// +// http://www.webdav.org/specs/rfc4918.html#ELEMENT_activelock +// // +// +// locktoken?, lockroot)> type ActiveLock struct { XMLName xml.Name `xml:"activelock"` Exclusive *struct{} `xml:"lockscope>exclusive,omitempty"`