Documentation
¶
Overview ¶
Package gofofa fofa client in Go
env settings: - FOFA_CLIENT_URL full fofa connnection string, format: <url>/?email=<email>&key=<key>&version=<v2> - FOFA_SERVER fofa server - FOFA_EMAIL fofa account email - FOFA_KEY fofa account key
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FofaURLFromEnv ¶
func FofaURLFromEnv() string
Types ¶
type AccountInfo ¶
type AccountInfo struct {
Error bool `json:"error"` // error or not
ErrMsg string `json:"errmsg"` // error string message
FCoin int `json:"fcoin"` // fcoin count
IsVIP bool `json:"isvip"` // is vip
VIPLevel int `json:"vip_level"` // vip level
}
AccountInfo fofa account info
func (AccountInfo) String ¶
func (ai AccountInfo) String() string
type Client ¶
type Client struct {
Server string // can set local server for debugging, format: <scheme>://<host>
APIVersion string // api version
Email string // fofa email
Key string // fofa key
Account AccountInfo // fofa account info
DeductMode DeductMode // 扣费提醒默认
// contains filtered or unexported fields
}
Client of fofa connection
func NewClient ¶
NewClient from fofa connection string to config and with env config merge configURL format: <url>/?email=<email>&key=<key>&version=<v2>&tlsdisabled=false&debuglevel=0
func (*Client) AccountInfo ¶
func (c *Client) AccountInfo() (ac AccountInfo, err error)
AccountInfo fetch account info from fofa
func (*Client) HostSearch ¶
HostSearch search fofa host data query fofa query string size data size: -1 means all,0 means just data total info, >0 means actual size fields field of fofa host struct
type DeductMode ¶
type DeductMode int // 扣费模式
const ( DeductModeFree DeductMode = 0 // 不自动扣费 DeductModeFCoin = 1 // 自动扣除F币 )
func ParseDeductMode ¶
func ParseDeductMode(v string) DeductMode