sssp

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: 11 Imported by: 0

README

sssp

Golang SSSP Client

Ci codecov Go Report Card Go Reference MPLv2 License

Description

sssp is a Golang library and cmdline tool that implements the Sophos SSSP protocol.

Requirements

  • Golang 1.10.x or higher

Getting started

SSSP client

The sssp client can be installed as follows

$ go get github.com/baruwa-enterprise/sssp/cmd/ssspscan

Or by cloning the repo and then running

$ make build
$ ./bin/ssspscan
SSSP library

To install the library

go get github.com/baruwa-enterprise/sssp

You can then import it in your code

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

make test

License

MPL-2.0

Documentation

Overview

Package sssp implements the SSSP protocol SSSP - Golang SSSP protocol implementation

Index

Constants

This section is empty.

Variables

View Source
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 SSSP client.

func NewClient

func NewClient(ctx context.Context, network, address string, connTimeOut, ioTimeOut time.Duration, connRetries int) (c *Client, err error)

NewClient creates and returns a new instance of Client

func (*Client) Close

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

Close closes the connection to the server gracefully and frees up resources used by the connection

func (*Client) Dial

func (c *Client) Dial(ctx context.Context) (err error)

Dial setup clients network connection This is called automatically when you call NewClient It is provided to allow for reconnection if the underlying connection is dropped due to inactivity.

func (*Client) ScanDir

func (c *Client) ScanDir(p string, recurse bool) (r []*Response, err error)

ScanDir submits a directory for scanning

func (*Client) ScanFile

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

ScanFile submits a single file for scanning

func (*Client) ScanReader

func (c *Client) ScanReader(i io.Reader) (r *Response, err error)

ScanReader submits an io reader via a stream for scanning

func (*Client) ScanStream

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

ScanStream submits a single file via a stream for scanning

func (*Client) SetCmdTimeout

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

SetCmdTimeout sets the cmd timeout

func (*Client) SetConnSleep

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

SetConnSleep sets the connection retry sleep duration in seconds

type Command

type Command int

A Command represents a SSSP Command

const (
	// ScanFile represents the SCANFILE command
	ScanFile Command = iota + 1
	// ScanDir represents the SCANDIR command
	ScanDir
	// ScanDirr represents the SCANDIRR command
	ScanDirr
	// ScanData represents the SCANDATA command
	ScanData
	// Quit reprsents the BYE command
	Quit
)

func (Command) String

func (c Command) String() (s string)

type Response

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

Response represents the response from the server

Directories

Path Synopsis
cmd
ssspscan
Package main SSSP - Golang cmdline SSSP client Package main Sophie - Golang cmdline SSSP client
Package main SSSP - Golang cmdline SSSP client Package main Sophie - Golang cmdline SSSP client
Package main SSSP - Golang cmdline SSSP client
Package main SSSP - Golang cmdline SSSP client

Jump to

Keyboard shortcuts

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