malicious

package
v0.0.0-...-770125b Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API interface {
	// So we can terminates the communication when the program ends
	io.Closer
	// Check takes a key (string) and value (interface{}) and stores it in the database.
	// If an error occurred this will be returned.
	Check(ctx context.Context, done chan<- APIResp, url string)
}

API is an interface that defines the actions a database should be able to execute.

func Factory

func Factory(apiName string) (API, error)

Factory is a factory function that creates an api based on the apiName param. apiName wether "sb", "dummy" or "". Otherwise, it will return an NotImplementedAPIError

type APIResp

type APIResp struct {
	Valid bool
	Err   error
}

APIResp allows to communicate API response through channel

type CreateAPIError

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

CreateAPIError contains a reason as to why the api couldn't be created.

func (*CreateAPIError) Error

func (err *CreateAPIError) Error() string

type DownError

type DownError struct{}

DownError indicates that the api is not reachable.

func (*DownError) Error

func (err *DownError) Error() string

type NotImplementedAPIError

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

NotImplementedAPIError is an error returned when this api mode does not exist.

func (*NotImplementedAPIError) Error

func (err *NotImplementedAPIError) Error() string

type OperationError

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

OperationError indicates the operation could not be performed.

func (*OperationError) Error

func (err *OperationError) Error() string

Jump to

Keyboard shortcuts

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