public static void AddRpc(this IServiceCollection services, Action <RpcServerConfiguration> configure)
        {
            var configuration = new RpcServerConfiguration();

            configure(configuration);
            services.AddSingleton(new RpcService(configuration));
        }
Exemple #2
0
        internal static string GetFunctionName(string route, RpcServerConfiguration configuration)
        {
            route = RemoveLeadingSlash(route);
            var tokens = route.Split('/');

            return(tokens[2]);
        }
Exemple #3
0
        internal static bool IsValidRpcRoute(string route, RpcServerConfiguration configuration)
        {
            if (route == null)
            {
                return(false);
            }

            route = RemoveLeadingSlash(route);
            if (!route.StartsWith(configuration.FunctionNamePrefix))
            {
                return(false);
            }

            var tokens = route.Split('/');

            if (tokens.Length < 3)
            {
                return(false);
            }

            return(true);
        }
 public FunctionsAnalyzer(RpcServerConfiguration rpcServerConfiguration)
 {
     this.rpcServerConfiguration = rpcServerConfiguration;
 }
 public static void AddRpc(this IServiceCollection services, RpcServerConfiguration configuration = null)
 {
     services.AddSingleton(new RpcService(configuration ?? new RpcServerConfiguration()));
 }
Exemple #6
0
 internal RpcService(RpcServerConfiguration configuration)
 {
     Configuration = configuration;
     AnalyzeFunctions();
 }
Exemple #7
0
 internal RpcService()
 {
     Configuration = new RpcServerConfiguration();
     AnalyzeFunctions();
 }