https://github.com/fofapro/vulfocus-go
https://github.com/fofapro/vulfocus-go
golang vulfocus
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/fofapro/vulfocus-go
- Owner: fofapro
- License: apache-2.0
- Created: 2021-11-23T04:35:26.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-11-25T14:14:44.000Z (over 4 years ago)
- Last Synced: 2025-06-06T00:51:22.630Z (about 1 year ago)
- Topics: golang, vulfocus
- Language: Go
- Homepage:
- Size: 11.7 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vulfocus-go
[](https://github.com/fofapro/vulfocus-go/releases) [](https://github.com/fofapro/vulfocus-go/stargazers) [](https://github.com/fofapro/vulfocus-go/blob/master/LICENSE)
[中文文档](https://github.com/fofapro/vulfocus-go/blob/master/README_zh.md)
## Vulfocus API
[`Vulfocus API`](https://fofapro.github.io/vulfocus/#/VULFOCUSAPI) is the `RESUFul API` interface provided by [`Vulfocus`](http://vulfocus.io/) for development, allowing Developers integrate [`Vulfocus`](http://vulfocus.io) in their own projects.
## Vulfocus SDK
The `GO` version of `SDK` written based on the [`Vulfocus API`](https://fofapro.github.io/vulfocus/#/VULFOCUSAPI) makes it easy for `Golang` developers to quickly integrate [`Vulfocus`](http://vulfocus.io/) into their projects.
## Add dependency
```bash
go get github.com/fofapro/vulfocus-go
```
## Use
|field|description|
| ---- | ---- |
|`addr`|[`Vulfocus`](http://vulfocus.io/) URL|
|`username`|User login [`Vulfocus`](http://vulfocus.io/) userbox `username`|
|`licence`|Please go to the [`personal center`](http://vulfocus.fofa.so/#/profile/index) to view `API licence`|
### Pull Images
```go
package main
import (
"fmt"
"github.com/fofapro/vulfocus-go"
)
const (
addr = "http://vulfocus.fofa.so"
username = ""
licence = ""
)
func main() {
client := vulfocus.NewClient(addr, username, licence)
err, images := client.GetImages()
if err != nil {
return
}
fmt.Printf("get %d images", len(images))
if len(images) == 0 {
return
}
}
```
### Start
```go
package main
import (
"fmt"
"github.com/fofapro/vulfocus-go"
)
const (
addr = "http://vulfocus.fofa.so"
username = ""
licence = ""
)
func main() {
client := vulfocus.NewClient(addr, username, licence)
err, images := client.GetImages()
if err != nil {
return
}
fmt.Printf("get %d images", len(images))
if len(images) == 0 {
return
}
err, exposed := client.Start(images[0].Name)
if err != nil {
return
}
println(exposed.Host, exposed.Port)
}
```
### Stop
```go
package main
import (
"fmt"
"github.com/fofapro/vulfocus-go"
)
const (
addr = "http://vulfocus.fofa.so"
username = ""
licence = ""
)
func main() {
client := vulfocus.NewClient(addr, username, licence)
err, images := client.GetImages()
if err != nil {
return
}
fmt.Printf("get %d images", len(images))
if len(images) == 0 {
return
}
err = client.Stop(images[0].Name)
if err != nil {
return
}
}
```
### Delete
```go
package main
import (
"fmt"
"github.com/fofapro/vulfocus-go"
)
const (
addr = "http://vulfocus.fofa.so"
username = ""
licence = ""
)
func main() {
client := vulfocus.NewClient(addr, username, licence)
err, images := client.GetImages()
if err != nil {
return
}
fmt.Printf("get %d images", len(images))
if len(images) == 0 {
return
}
err = client.Delete(images[0].Name)
if err != nil {
return
}
}
```
## Update Log
2021-11-25
```
- Version release
```