From ba74e8803bed8b5e42df35be6b861c07d5d04239 Mon Sep 17 00:00:00 2001 From: Vinicius Fortuna Date: Tue, 29 Oct 2024 16:49:10 -0400 Subject: [PATCH] Remove unused Provider --- x/configurl/config.go | 10 ++-------- x/examples/fetch-psiphon/psiphon.config.json | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 8 deletions(-) create mode 100644 x/examples/fetch-psiphon/psiphon.config.json diff --git a/x/configurl/config.go b/x/configurl/config.go index 026811d0..adb1bf3e 100644 --- a/x/configurl/config.go +++ b/x/configurl/config.go @@ -28,12 +28,7 @@ type Config struct { BaseConfig *Config } -// Provider creates an instance from a config. -type Provider[ObjectType any] interface { - NewInstance(ctx context.Context, config *Config) (ObjectType, error) -} - -// BuildFunc is a convenience type for functions that create a instances of ObjectType given a [Config]. +// BuildFunc is a function that creates an instance of ObjectType given a [Config]. type BuildFunc[ObjectType any] func(ctx context.Context, config *Config) (ObjectType, error) // TypeRegistry registers config types. @@ -41,7 +36,7 @@ type TypeRegistry[ObjectType any] interface { RegisterType(subtype string, newInstance BuildFunc[ObjectType]) error } -// ExtensibleProvider is [Provider] implementation that can be extended via its [TypeRegistry] interface. +// ExtensibleProvider creates instances of ObjectType in a way that can be extended via its [TypeRegistry] interface. type ExtensibleProvider[ObjectType comparable] struct { // Instance to return when config is nil. BaseInstance ObjectType @@ -49,7 +44,6 @@ type ExtensibleProvider[ObjectType comparable] struct { } var ( - _ Provider[any] = (*ExtensibleProvider[any])(nil) _ BuildFunc[any] = (*ExtensibleProvider[any])(nil).NewInstance _ TypeRegistry[any] = (*ExtensibleProvider[any])(nil) ) diff --git a/x/examples/fetch-psiphon/psiphon.config.json b/x/examples/fetch-psiphon/psiphon.config.json new file mode 100644 index 00000000..8f54cacd --- /dev/null +++ b/x/examples/fetch-psiphon/psiphon.config.json @@ -0,0 +1,17 @@ +{ + "SponsorId" : "DB4A6B5E997A4E48", + "PropagationChannelId" : "60F2A5F62855A295", + + "ClientPlatform" : "outline", + "ClientVersion" : "1", + + "DisableLocalSocksProxy" : true, + "DisableLocalHTTPProxy" : true, + + "ObfuscatedServerListRootURLs" : [{"URL": "aHR0cHM6Ly9zMy5hbWF6b25hd3MuY29tL3BzaXBob24vd2ViL29jdmwtMG9iai1zMnZnL29zbA==", "OnlyAfterAttempts": 0, "SkipVerify": false}, {"URL": "aHR0cHM6Ly93d3cucmVzdWx0c3VuaXZlcnNhbHVubGltaXRlZGpoLmNvbS93ZWIvb2N2bC0wb2JqLXMydmcvb3Ns", "OnlyAfterAttempts": 2, "SkipVerify": true}, {"URL": "aHR0cHM6Ly93d3cuYnJhbmRpbmd1c2FnYW1lcmVwLmNvbS93ZWIvb2N2bC0wb2JqLXMydmcvb3Ns", "OnlyAfterAttempts": 2, "SkipVerify": true}, {"URL": "aHR0cHM6Ly93d3cuYmxvZ3NmbWNhbmNlcmNpdGl6ZW4uY29tL3dlYi9vY3ZsLTBvYmotczJ2Zy9vc2w=", "OnlyAfterAttempts": 2, "SkipVerify": true}], + "RemoteServerListURLs" : [{"URL": "aHR0cHM6Ly9zMy5hbWF6b25hd3MuY29tL3BzaXBob24vd2ViL29jdmwtMG9iai1zMnZnL3NlcnZlcl9saXN0X2NvbXByZXNzZWQ=", "OnlyAfterAttempts": 0, "SkipVerify": false}, {"URL": "aHR0cHM6Ly93d3cucmVzdWx0c3VuaXZlcnNhbHVubGltaXRlZGpoLmNvbS93ZWIvb2N2bC0wb2JqLXMydmcvc2VydmVyX2xpc3RfY29tcHJlc3NlZA==", "OnlyAfterAttempts": 2, "SkipVerify": true}, {"URL": "aHR0cHM6Ly93d3cuYnJhbmRpbmd1c2FnYW1lcmVwLmNvbS93ZWIvb2N2bC0wb2JqLXMydmcvc2VydmVyX2xpc3RfY29tcHJlc3NlZA==", "OnlyAfterAttempts": 2, "SkipVerify": true}, {"URL": "aHR0cHM6Ly93d3cuYmxvZ3NmbWNhbmNlcmNpdGl6ZW4uY29tL3dlYi9vY3ZsLTBvYmotczJ2Zy9zZXJ2ZXJfbGlzdF9jb21wcmVzc2Vk", "OnlyAfterAttempts": 2, "SkipVerify": true}], + "RemoteServerListSignaturePublicKey" : "MIICIDANBgkqhkiG9w0BAQEFAAOCAg0AMIICCAKCAgEAt7Ls+/39r+T6zNW7GiVpJfzq/xvL9SBH5rIFnk0RXYEYavax3WS6HOD35eTAqn8AniOwiH+DOkvgSKF2caqk/y1dfq47Pdymtwzp9ikpB1C5OfAysXzBiwVJlCdajBKvBZDerV1cMvRzCKvKwRmvDmHgphQQ7WfXIGbRbmmk6opMBh3roE42KcotLFtqp0RRwLtcBRNtCdsrVsjiI1Lqz/lH+T61sGjSjQ3CHMuZYSQJZo/KrvzgQXpkaCTdbObxHqb6/+i1qaVOfEsvjoiyzTxJADvSytVtcTjijhPEV6XskJVHE1Zgl+7rATr/pDQkw6DPCNBS1+Y6fy7GstZALQXwEDN/qhQI9kWkHijT8ns+i1vGg00Mk/6J75arLhqcodWsdeG/M/moWgqQAnlZAGVtJI1OgeF5fsPpXu4kctOfuZlGjVZXQNW34aOzm8r8S0eVZitPlbhcPiR4gT/aSMz/wd8lZlzZYsje/Jr8u/YtlwjjreZrGRmG8KMOzukV3lLmMppXFMvl4bxv6YFEmIuTsOhbLTwFgh7KYNjodLj/LsqRVfwz31PgWQFTEPICV7GCvgVlPRxnofqKSjgTWI4mxDhBpVcATvaoBl1L/6WLbFvBsoAUBItWwctO2xalKxF5szhGm8lccoc5MZr8kfE0uxMgsxz4er68iCID+rsCAQM=", + "ServerEntrySignaturePublicKey" : "sHuUVTWaRyh5pZwy4UguSgkwmBe0EHtJJkoF5WrxmvA=", + + "TargetApiProtocol" : "ssh" +}