app

package
v0.0.0-...-e7e1402 Latest Latest
Warning

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

Go to latest
Published: May 18, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_PORT                = "80"
	DEFAULT_CLASSIFIER_FILEPATH = "/tmp/spam47.gob"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

func New

func New() *App

func (*App) Check

func (a *App) Check(w http.ResponseWriter, r *http.Request)

func (*App) HeathCheck

func (a *App) HeathCheck(w http.ResponseWriter, _ *http.Request)

func (*App) Mux

func (a *App) Mux() http.Handler

func (*App) Run

func (a *App) Run() error

func (*App) Train

func (a *App) Train(w http.ResponseWriter, r *http.Request)

type CheckRequest

type CheckRequest struct {
	Message string `json:"message"`
	Lang    string `json:"lang,omitempty"`
}

type CheckResponse

type CheckResponse struct {
	Status string  `json:"status"`
	Score  float64 `json:"score"`
}

type TrainRequest

type TrainRequest struct {
	Message string `json:"message"`
	Type    string `json:"type"`
	Lang    string `json:"lang,omitempty"`
}

Jump to

Keyboard shortcuts

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