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
- uses: yanzay/[email protected] | |
if: always() | |
with: | |
chat: ${{ secrets.chat }} | |
token: ${{ secrets.token }} | |
status: ${{ job.status }} |
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
name: 'Notify Telegram' | |
description: 'Get build notification to Telegram messenger' | |
author: 'yanzay' | |
inputs: | |
chat: | |
description: 'Chat to send: chat id or @channel_name' | |
required: true | |
token: | |
description: 'Telegram Bot token' | |
required: true |
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
package main | |
import ( | |
"fmt" | |
"log" | |
"net/http" | |
"os" | |
"strings" | |
"github.com/yanzay/tbot/v2" |
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
FROM alpine:3.10 | |
COPY LICENSE README.md / | |
COPY entrypoint.sh /entrypoint.sh | |
ENTRYPOINT ["/entrypoint.sh"] |
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
name: 'Container Action Template' | |
description: 'Get started with Container actions' | |
author: 'GitHub' | |
inputs: | |
myInput: | |
description: 'Input to use' | |
default: 'world' | |
runs: | |
using: 'docker' | |
image: 'Dockerfile' |
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
package main | |
import ( | |
"flag" | |
"fmt" | |
"io" | |
"log" | |
"net" | |
"os" | |
) |
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
$ # launch server | |
$ go run main.go -l -p 1304 | |
$ # in separate terminal launch client | |
$ go run main.go localhost 1304 |
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 startClient(addr string) { | |
conn, err := net.Dial("tcp", addr) | |
if err != nil { | |
fmt.Printf("Can't connect to server: %s\n", err) | |
return | |
} | |
_, err = io.Copy(conn, os.Stdin) | |
if err != nil { | |
fmt.Printf("Connection error: %s\n", 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 main() { | |
flag.Parse() | |
if *listen { | |
startServer() | |
return | |
} | |
if len(flag.Args()) < 2 { | |
fmt.Println("Hostname and port required") | |
return | |
} |
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
$ # launch our server | |
$ go run main.go -l -p 1304 | |
$ # in separate terminal window connect to the server using standard netcat utility | |
$ nc localhost 1304 |
NewerOlder