Exemplo n.º 1
0
        /// <summary>
        /// Instantiate the object.
        /// </summary>
        /// <param name="kvpbase">Kvpbase settings.</param>
        public StorageSettings(KvpbaseSettings kvpbase)
        {
            if (kvpbase == null)
            {
                throw new ArgumentNullException(nameof(kvpbase));
            }

            Kvpbase = kvpbase;
        }
Exemplo n.º 2
0
        static void InitializeClient()
        {
            switch (_StorageType)
            {
            case StorageType.AwsS3:
                Console.WriteLine("For S3-compatible storage, endpoint should be of the form http://[hostname]:[port]/");
                string endpoint = InputString("Endpoint   :", null, true);

                if (String.IsNullOrEmpty(endpoint))
                {
                    _AwsSettings = new AwsSettings(
                        InputString("Access key :", null, false),
                        InputString("Secret key :", null, false),
                        InputString("Region     :", "USWest1", false),
                        InputString("Bucket     :", null, false)
                        );
                }
                else
                {
                    _AwsSettings = new AwsSettings(
                        endpoint,
                        InputBoolean("SSL        :", true),
                        InputString("Access key :", null, false),
                        InputString("Secret key :", null, false),
                        InputString("Region     :", "USWest1", false),
                        InputString("Bucket     :", null, false)
                        );
                }
                _Blobs = new Blobs(_AwsSettings);
                break;

            case StorageType.Azure:
                _AzureSettings = new AzureSettings(
                    InputString("Account name :", null, false),
                    InputString("Access key   :", null, false),
                    InputString("Endpoint URL :", null, false),
                    InputString("Container    :", null, false));
                _Blobs = new Blobs(_AzureSettings);
                break;

            case StorageType.Disk:
                _DiskSettings = new DiskSettings(
                    InputString("Directory :", null, false));
                _Blobs = new Blobs(_DiskSettings);
                break;

            case StorageType.Kvpbase:
                _KvpbaseSettings = new KvpbaseSettings(
                    InputString("Endpoint URL :", null, false),
                    InputString("User GUID    :", null, false),
                    InputString("Container    :", null, true),
                    InputString("API key      :", null, false));
                _Blobs = new Blobs(_KvpbaseSettings);
                break;
            }
        }
Exemplo n.º 3
0
 private void InitializeBlobs()
 {
     _KvpbaseSettings = new KvpbaseSettings(Endpoint, UserGuid, Container, ApiKey);
     _Blobs           = new Blobs(_KvpbaseSettings);
 }