Documentation ¶
Overview ¶
Package avast Golang Avast client Avast - Golang Avast client
Index ¶
- Constants
- Variables
- type Client
- func (c *Client) CheckURL(u string) (r bool, err error)
- func (c *Client) Close() (err error)
- func (c *Client) GetExclude() (r string, err error)
- func (c *Client) GetFlags() (f string, err error)
- func (c *Client) GetPack() (p string, err error)
- func (c *Client) GetSensitivity() (f string, err error)
- func (c *Client) Scan(p string) (r []*Response, err error)
- func (c *Client) SetCmdTimeout(t time.Duration)
- func (c *Client) SetConnRetries(s int)
- func (c *Client) SetConnSleep(s time.Duration)
- func (c *Client) SetConnTimeout(t time.Duration)
- func (c *Client) SetExclude(p string) (err error)
- func (c *Client) SetFlags(o Flag, v bool) (err error)
- func (c *Client) SetPack(o PackOption, v bool) (err error)
- func (c *Client) SetSensitivity(o SensiOption, v bool) (err error)
- func (c *Client) Vps() (v int, err error)
- type Command
- type Flag
- type PackOption
- type Response
- type SensiOption
Constants ¶
const ( // DefaultTimeout is the default connection timeout DefaultTimeout = 15 * time.Second // DefaultCmdTimeout is the default IO timeout DefaultCmdTimeout = 1 * time.Minute // DefaultSleep is the default sleep period DefaultSleep = 1 * time.Second // AvastSock is the default socket location AvastSock = "/var/run/avast/scan.sock" )
Variables ¶
var ( // ZeroTime holds the zero value of time ZeroTime time.Time )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
A Client represents an Avast client.
func NewClient ¶
func NewClient(ctx context.Context, address string, connTimeOut, ioTimeOut time.Duration) (c *Client, err error)
NewClient creates and returns a new instance of Client
func (*Client) GetExclude ¶
GetExclude returns excluded path from scans
func (*Client) GetSensitivity ¶
GetSensitivity returns scan sensitivity options
func (*Client) SetCmdTimeout ¶
SetCmdTimeout sets the cmd timeout
func (*Client) SetConnRetries ¶
SetConnRetries sets the number of times connection is retried
func (*Client) SetConnSleep ¶
SetConnSleep sets the connection retry sleep duration in seconds
func (*Client) SetConnTimeout ¶
SetConnTimeout sets the connection timeout
func (*Client) SetExclude ¶
SetExclude returns excluded path from scans
func (*Client) SetPack ¶
func (c *Client) SetPack(o PackOption, v bool) (err error)
SetPack sets packer options
func (*Client) SetSensitivity ¶
func (c *Client) SetSensitivity(o SensiOption, v bool) (err error)
SetSensitivity sets scan sensitivity
type Command ¶
type Command int
A Command represents an Avast Command
const ( // Scan sends the SCAN request Scan Command = iota + 1 // Vps sends the VPS request Vps // Pack sends the PACK request Pack // Flags sends the FLAGS request Flags // Sensitivity sends the SENSITIVITY request Sensitivity // Exclude sends the EXCLUDE request Exclude // CheckURL sends the CHECKURL request CheckURL // Quit sends the QUIT request Quit )
type PackOption ¶
type PackOption int
A PackOption represents Avast PACK options
const ( // Mime represents mime option Mime PackOption = iota + 1 // Zip represents zip pack option Zip // Arj represents arj pack option Arj // Rar represents rar pack option Rar // Cab represents cab pack option Cab // Tar represents tar pack option Tar // Gz represents gz pack option Gz // Bzip2 represents bzip2 pack option Bzip2 // Ace represents ace pack option Ace // Arc represents arc pack option Arc // Zoo represents zoo pack option Zoo // Lharc represents lharc pack option Lharc // Chm represents chm pack option Chm // Cpio represents cpio pack option Cpio // Rpm represents rpm pack option Rpm // Szip represents 7zip pack option Szip // Iso represents iso pack option Iso // Tnef represents tnef pack option Tnef // Dbx represents dbx pack option Dbx // Sys represents sys pack option Sys // Ole represents ole pack option Ole // Exec represents exec pack option Exec // WinExec represents winexec pack option WinExec // Install represents install option Install // Dmg represents dmg pack option Dmg )
func (PackOption) Disable ¶
func (p PackOption) Disable() (s string)
Disable returns disabled option string
func (PackOption) Enable ¶
func (p PackOption) Enable() (s string)
Enable returns enabled option string
func (PackOption) String ¶
func (p PackOption) String() (s string)
type Response ¶
type Response struct { Filename string ArchiveItem string Signature string Status string Infected bool Raw string }
Response represents the response from the server
type SensiOption ¶
type SensiOption int
SensiOption represents Avast Sensitivity options
const ( // Worm represents worm Worm SensiOption = iota + 1 // Trojan represents trojan Trojan // Adware represents adware Adware // Spyware represents spyware Spyware // Dropper represents dropper Dropper // Kit represents kit Kit // Joke represents joke Joke // Dangerous represents dangerous Dangerous // Dialer represents dialer Dialer // Rootkit represents rootkit Rootkit // Exploit represents exploit Exploit // Pup represents pup Pup // Suspicious represents suspicious Suspicious // Pube represents pube Pube )
func (SensiOption) Disable ¶
func (so SensiOption) Disable() (s string)
Disable returns disabled option string
func (SensiOption) Enable ¶
func (so SensiOption) Enable() (s string)
Enable returns enabled option string
func (SensiOption) String ¶
func (so SensiOption) String() (s string)
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
avastscan
Package main Golang Avast client Avast - Golang Avast cmdline client Package main Golang Avast client Avast - Golang Avast cmdline client
|
Package main Golang Avast client Avast - Golang Avast cmdline client Package main Golang Avast client Avast - Golang Avast cmdline client |
Package main Golang Avast client Avast - Golang Avast test program
|
Package main Golang Avast client Avast - Golang Avast test program |