synapse

package
v0.0.1-alpha Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2019 License: GPL-3.0, GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBuiltInTorrentFsPrefix = "BUILT-IN TORRENT FS ERROR"

	ErrInputFileNotExistFlag = "[ " + ErrBuiltInTorrentFsPrefix + " ] input file not exist"
	ErrModelFileNotExistFlag = "[ " + ErrBuiltInTorrentFsPrefix + " ] model file not exist"

	ErrInputFileNotExist = errors.New(ErrInputFileNotExistFlag)
	ErrModelFileNotExist = errors.New(ErrModelFileNotExistFlag)

	ErrFatal = errors.New("fatal")
)
View Source
var (
	Model_V1 = "model-v1"
)

Functions

func ArgMax

func ArgMax(res []byte) uint64

func CheckBuiltInTorrentFsError added in v1.0.0

func CheckBuiltInTorrentFsError(err error) bool

If infered by local, check struct error is enough. Else infered by remote, must be checked by error's text

func CheckMetaHash

func CheckMetaHash(version string, infoHash string) error

func ProcessImage

func ProcessImage(data []byte) error

func RLPHashString added in v1.0.0

func RLPHashString(x interface{}) string

func ReadImage

func ReadImage(inputFilePath string) ([]byte, error)

Types

type Config

type Config struct {
	StorageDir string
	IsNotCache bool
}

type Synapse

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

func Engine

func Engine() *Synapse

func New

func New(config Config) *Synapse

func (*Synapse) Close

func (s *Synapse) Close()

func (*Synapse) InferByInfoHash

func (s *Synapse) InferByInfoHash(modelInfoHash, inputInfoHash string) ([]byte, error)

func (*Synapse) InferByInputContent

func (s *Synapse) InferByInputContent(modelInfoHash string, inputContent []byte) ([]byte, error)

func (*Synapse) RemoteInferByInfoHash

func (s *Synapse) RemoteInferByInfoHash(modelInfoHash, inputInfoHash, uri string) ([]byte, error)

func (*Synapse) RemoteInferByInputContent

func (s *Synapse) RemoteInferByInputContent(modelInfoHash, uri string, inputContent []byte) ([]byte, error)

func (*Synapse) VerifyInput

func (s *Synapse) VerifyInput(inputInfoHash string) error

func (*Synapse) VerifyModel

func (s *Synapse) VerifyModel(modelInfoHash string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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