sophie

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

README

sophie

Golang Sophie Client

Ci codecov Go Report Card Go Reference MPLv2 License

Description

sophie is a Golang library and cmdline tool that implements the Sophie client protocol.

Requirements

  • Golang 1.10.x or higher

Getting started

Sophie client

The sophie client can be installed as follows

$ go get github.com/baruwa-enterprise/sophie/cmd/sophiescan

Or by cloning the repo and then running

$ make build
$ ./bin/sophiescan
Sophie library

To install the library

go get github.com/baruwa-enterprise/sophie

You can then import it in your code

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

make test

License

MPL-2.0

Documentation

Overview

Package sophie implements the sophie protocol Sophie - Golang Sophie protocol implementation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

A Client represents a Sophie client.

func NewClient

func NewClient(network, address string) (c *Client, err error)

NewClient returns a new Sophie client.

func (*Client) Scan

func (c *Client) Scan(ctx context.Context, p string) (r *Response, err error)

Scan a file or directory

func (*Client) ScanReader

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

ScanReader scans an io.reader

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) SetConnTimeout

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

SetConnTimeout sets the connection timeout

type Response

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

Response is the response from the server

Directories

Path Synopsis
cmd
sophiescan
Package main Sophie - Golang cmdline sophie client Package main Sophie - Golang cmdline sophie client
Package main Sophie - Golang cmdline sophie client Package main Sophie - Golang cmdline sophie client

Jump to

Keyboard shortcuts

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