Commit from m3o/m3o action

This commit is contained in:
m3o-actions
2022-02-21 12:04:55 +00:00
parent 6c61a79774
commit cf4338a959
25 changed files with 1227 additions and 1227 deletions

View File

@@ -4,6 +4,34 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/ping/api](http
Endpoints:
## Tcp
Ping a TCP port is open
[https://m3o.com/ping/api#Tcp](https://m3o.com/ping/api#Tcp)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/ping"
)
// Ping a TCP port is open
func DialAtcpAddress() {
pingService := ping.NewPingService(os.Getenv("M3O_API_TOKEN"))
rsp, err := pingService.Tcp(&ping.TcpRequest{
Address: "google.com:80",
})
fmt.Println(rsp, err)
}
```
## Url
Ping a HTTP URL
@@ -60,31 +88,3 @@ func PingAnIp() {
}
```
## Tcp
Ping a TCP port is open
[https://m3o.com/ping/api#Tcp](https://m3o.com/ping/api#Tcp)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/ping"
)
// Ping a TCP port is open
func DialAtcpAddress() {
pingService := ping.NewPingService(os.Getenv("M3O_API_TOKEN"))
rsp, err := pingService.Tcp(&ping.TcpRequest{
Address: "google.com:80",
})
fmt.Println(rsp, err)
}
```