mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-24 00:15:29 +00:00
Generate clients (#206)
This commit is contained in:
6
examples/emoji/print/curl/printTextIncludingEmoji.sh
Executable file
6
examples/emoji/print/curl/printTextIncludingEmoji.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
curl "https://api.m3o.com/v1/emoji/Print" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: Bearer $MICRO_API_TOKEN" \
|
||||
-d '{
|
||||
"text": "let's grab a :beer:"
|
||||
}'
|
||||
17
examples/emoji/print/go/printTextIncludingEmoji.go
Executable file
17
examples/emoji/print/go/printTextIncludingEmoji.go
Executable file
@@ -0,0 +1,17 @@
|
||||
package example
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/micro/services/clients/go/emoji"
|
||||
"os"
|
||||
)
|
||||
|
||||
// Print text and renders the emojis with aliases e.g
|
||||
// let's grab a :beer: becomes let's grab a 🍺
|
||||
func PrintTextIncludingEmoji() {
|
||||
emojiService := emoji.NewEmojiService(os.Getenv("MICRO_API_TOKEN"))
|
||||
rsp, err := emojiService.Print(&emoji.PrintRequest{
|
||||
Text: "let's grab a :beer:",
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
13
examples/emoji/print/node/printTextIncludingEmoji.js
Executable file
13
examples/emoji/print/node/printTextIncludingEmoji.js
Executable file
@@ -0,0 +1,13 @@
|
||||
import * as emoji from "m3o/emoji";
|
||||
|
||||
// Print text and renders the emojis with aliases e.g
|
||||
// let's grab a :beer: becomes let's grab a 🍺
|
||||
async function PrintTextIncludingEmoji() {
|
||||
let emojiService = new emoji.EmojiService(process.env.MICRO_API_TOKEN);
|
||||
let rsp = await emojiService.print({
|
||||
text: "let's grab a :beer:",
|
||||
});
|
||||
console.log(rsp);
|
||||
}
|
||||
|
||||
await PrintTextIncludingEmoji();
|
||||
Reference in New Issue
Block a user