Skip to content

Instantly share code, notes, and snippets.

View radu-matei's full-sized avatar

Radu Matei radu-matei

View GitHub Profile
// WebhookData struct is the data sent from Docker Hub webhooks
type WebhookData struct {
PushData struct {
PushedAt int `json:"pushed_at"`
Images []string `json:"images"`
Tag string `json:"tag"`
Pusher string `json:"pusher"`
} `json:"push_data"`
CallbackURL string `json:"callback_url"`
Repository struct {
{
"callback_url": "https://registry.hub.docker.com/u/svendowideit/testhook/hook/2141b5bi5i5b02bec211i4eeih0242eg11000a/",
"push_data": {
"images": [
"27d47432a69bca5f2700e4dff7de0388ed65f9d3fb1ec645e2bc24c223dc1cc3",
"51a9c7c1f8bb2fa19bcd09789a34e63f35abb80044bc10196e304f6634cc582c",
"..."
],
"pushed_at": 1.417566161e+09,
"pusher": "trustedbuilder",
invocation_id:"71ce7295-741e-4d7b-9270-acca0a2a49ae"
function_id:"dbabbc49-22c0-422a-b34e-b8a6dd8b0078"
input_data:<name:"req"
data:<
http:<
method:"GET"
url:"/api/HttpTriggerGo"
headers:<
key:"accept"
value:"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
version: "3"
services:
redis:
image: redis
web:
image: radumatei/initial-scaleout
deploy:
mode: replicated
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.SignalR;
namespace signalr_mvc.Controllers
{
[Route("api/[controller]")]
using Microsoft.AspNetCore.SignalR;
namespace signalr_mvc
{
public class NotificationsHub : Hub
{
}
}
using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.SignalR.Client;
namespace console_client
{
class Program
{
private static HubConnection _connection;
static void Main(string[] args)
<!DOCTYPE html>
<html>
<head>
<title>Simple Chat</title>
</head>
<body>
<div class="container">
<input type="text" id="message" />
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
namespace signalr_aspnetcore
using Microsoft.AspNetCore.SignalR;
namespace signalr_aspnetcore
{
public class ChatHub : Hub
{
public void Send(string name, string message)
{
// Call the broadcastMessage method to update clients.
Clients.All.InvokeAsync("broadcastMessage", name, message);