This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func updateAzureContainer(resourceGroupName, containerGroupName string, webhookData WebhookData) error { | |
| containerGroupsClient, err := getContainerGroupsClient() | |
| if err != nil { | |
| return fmt.Errorf("cannot get container groups client: %v", err) | |
| } | |
| containerGroup, err := containerGroupsClient.Get(resourceGroupName, containerGroupName) | |
| if err != nil { | |
| return fmt.Errorf("cannot get container group: %v", err) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func getContainerGroupsClient() (containerinstance.ContainerGroupsClient, error) { | |
| var containerGroupsClient containerinstance.ContainerGroupsClient | |
| oAuthConfig, err := adal.NewOAuthConfig(defaultActiveDirectoryEndpoint, tenantID) | |
| if err != nil { | |
| return containerGroupsClient, fmt.Errorf("cannot get oAuth configuration: %v", err) | |
| } | |
| token, err := adal.NewServicePrincipalToken(*oAuthConfig, clientID, clientSecret, defaultResourceManagerEndpoint) | |
| if err != nil { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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 { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "callback_url": "https://registry.hub.docker.com/u/svendowideit/testhook/hook/2141b5bi5i5b02bec211i4eeih0242eg11000a/", | |
| "push_data": { | |
| "images": [ | |
| "27d47432a69bca5f2700e4dff7de0388ed65f9d3fb1ec645e2bc24c223dc1cc3", | |
| "51a9c7c1f8bb2fa19bcd09789a34e63f35abb80044bc10196e304f6634cc582c", | |
| "..." | |
| ], | |
| "pushed_at": 1.417566161e+09, | |
| "pusher": "trustedbuilder", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: "3" | |
| services: | |
| redis: | |
| image: redis | |
| web: | |
| image: radumatei/initial-scaleout | |
| deploy: | |
| mode: replicated |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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]")] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Microsoft.AspNetCore.SignalR; | |
| namespace signalr_mvc | |
| { | |
| public class NotificationsHub : Hub | |
| { | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Simple Chat</title> | |
| </head> | |
| <body> | |
| <div class="container"> | |
| <input type="text" id="message" /> |