fsecure

package module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 10, 2021 License: MPL-2.0 Imports: 10 Imported by: 0

README

fsecure

Golang Fsecure Client

Build Status codecov Go Report Card Go Reference MPLv2 License

Description

fsecure is a Golang library and cmdline tool that implements the Fsecure client protocol.

Requirements

  • Golang 1.10.x or higher

Getting started

Fsecure client

The fsecure client can be installed as follows

$ go get github.com/baruwa-enterprise/fsecure/cmd/fsecurescan

Or by cloning the repo and then running

$ make build
$ ./bin/fsecurescan
Fsecure library

To install the library

go get github.com/baruwa-enterprise/fsecure

You can then import it in your code

import "github.com/baruwa-enterprise/fsecure"
Testing

make test

License

MPL-2.0

Documentation

Overview

Package fsecure Golang F-Secure client Library Fsecure - Golang F-Secure client Library

Package fsecure Golang F-Secure client Library Fsecure - Golang F-Secure client Library

Index

Constants

View Source
const (
	// FsavSock is the default socket location
	FsavSock = "/tmp/.fsav-0"
)

Variables

View Source
var (
	// ZeroTime holds the zero value of time
	ZeroTime time.Time
)

Functions

This section is empty.

Types

type BoolField

type BoolField bool

BoolField local adaptation of bool

func (BoolField) String

func (b BoolField) String() (s string)

type Client

type Client struct {

	// Config holds the fsav config options
	Config *Config
	// contains filtered or unexported fields
}

A Client represents a Fsecure 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) Close

func (c *Client) Close()

Close closes the server connection

func (*Client) Scan

func (c *Client) Scan(p string) (r *Response, err error)

Scan a file

func (*Client) SetCmdTimeout

func (c *Client) SetCmdTimeout(t time.Duration)

SetCmdTimeout sets the cmd timeout

func (*Client) SetConnRetries

func (c *Client) SetConnRetries(s int)

SetConnRetries sets the number of times connection is retried

func (*Client) SetConnSleep

func (c *Client) SetConnSleep(s time.Duration)

SetConnSleep sets the connection retry sleep duration in seconds

func (*Client) SetOptions

func (c *Client) SetOptions() (err error)

SetOptions sets the fsav config options on the server

type Config

type Config struct {
	Mime        BoolField
	RiskWare    BoolField
	StopOnFirst BoolField
	Timeout     IntField
	Archive     BoolField
}

Config holds Fsecure fsav options

func NewConfig

func NewConfig() (c *Config)

NewConfig returns a new config object

type IntField

type IntField int

IntField local adaptation of int

func (IntField) String

func (i IntField) String() (s string)

type Response

type Response struct {
	Filename    string
	ArchiveItem string
	Signature   string
	Status      string
	Infected    bool
	Raw         string
}

Response is the response from the server

Directories

Path Synopsis
cmd
fsecurescan
Package fprot Golang F-Prot client Fprot - Golang F-Prot client Package main Golang F-Secure client Fsecure - Golang F-Secure client
Package fprot Golang F-Prot client Fprot - Golang F-Prot client Package main Golang F-Secure client Fsecure - Golang F-Secure client
Package main Golang F-Secure client Library example program Fsecure - Golang F-Secure client Library example program
Package main Golang F-Secure client Library example program Fsecure - Golang F-Secure client Library example program

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL