Пример #1
0
 // Single Threaded only
 static void Add(ConnectionFamily family, string connectionString)
 {
     Model.Connections.Add(new ConnectionInfo()
     {
         Family           = family,
         ConnectionString = connectionString.Trim(),
         Exception        = null,
         IsOk             = false,
         OkTime           = 0m,
         Version          = null,
     });
 }
Пример #2
0
        public static bool IsHavy(this ConnectionFamily family)
        {
            var havy = new ConnectionFamily[]
            {
                ConnectionFamily.MSSQL,
                ConnectionFamily.MongoDB,
                ConnectionFamily.MySQL,
                ConnectionFamily.Postgres,
                ConnectionFamily.RabbitMQ,
                ConnectionFamily.Cassandra,
            };

            return(havy.Any(x => x == family));
        }
Пример #3
0
        public static string GetVersion(ConnectionFamily family, string connectionString)
        {
            connectionString = connectionString.Trim();
            switch (family)
            {
            case ConnectionFamily.MySQL:
                return(GoMySQL(connectionString));

            case ConnectionFamily.Redis:
                return(GoRedis(connectionString));

            case ConnectionFamily.MSSQL:
                return(GoMSSQL(connectionString));

            case ConnectionFamily.Oracle:
                return(GoOracle(connectionString));

            case ConnectionFamily.MongoDB:
                return(GoMongoDB(connectionString));

            case ConnectionFamily.Postgres:
                return(GoPostgreSQL(connectionString));

            case ConnectionFamily.RabbitMQ:
                return(GoRabbitMQ(connectionString));

            case ConnectionFamily.Cassandra:
                return(GoCassandra(connectionString));

            case ConnectionFamily.Ping:
                return(GoPing(connectionString));

            case ConnectionFamily.HttpLegacy:
                return(GoHttpsLegacy(connectionString));

            case ConnectionFamily.Http:
                return(GoHttps(connectionString));

            case ConnectionFamily.Tcp:
                return(GoTcp(connectionString));

            case ConnectionFamily.Memcached:
                return(GoMemcached(connectionString));

            default:
                throw new ArgumentOutOfRangeException($"Family {family} is not valid argument");
            }
        }