pkg

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2020 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

App Application

func (*App) HomeController

func (a *App) HomeController(c echo.Context) error

HomeController Index controller TODO: Return usage instructions with this controller

func (*App) InitApp

func (a *App) InitApp(cfg AppConfig)

InitApp Initialize application

func (*App) InitFirebase added in v0.0.3

func (a *App) InitFirebase(f FirebaseAuth)

InitFirebase Initialize Firebase

func (*App) LoginController

func (a *App) LoginController(c echo.Context) error

LoginController Firebase login controller

func (*App) PredictController

func (a *App) PredictController(c echo.Context) error

PredictController Predict endpoint

func (*App) Run

func (a *App) Run()

Run application

type AppConfig added in v0.0.3

type AppConfig struct {
	Port string
}

AppConfig Struct for application Config

type FirebaseAuth added in v0.0.3

type FirebaseAuth interface {
	AuthUser(request LoginBody) (LoginResp, error)
	VerifyUser(request VerifyTokenBody) (VerifyTokenResp, error)
	IsUserActive(response VerifyTokenResp) (bool, error)
}

type FirebaseAuthClient added in v0.0.3

type FirebaseAuthClient struct {
	Config FirebaseConfig
}

func (FirebaseAuthClient) AuthUser added in v0.0.3

func (f FirebaseAuthClient) AuthUser(request LoginBody) (LoginResp, error)

func (FirebaseAuthClient) IsUserActive added in v0.0.3

func (f FirebaseAuthClient) IsUserActive(response VerifyTokenResp) (bool, error)

func (FirebaseAuthClient) VerifyUser added in v0.0.3

func (f FirebaseAuthClient) VerifyUser(request VerifyTokenBody) (VerifyTokenResp, error)

type FirebaseAuthMock added in v0.0.3

type FirebaseAuthMock struct {
}

func (FirebaseAuthMock) AuthUser added in v0.0.3

func (f FirebaseAuthMock) AuthUser(request LoginBody) (LoginResp, error)

func (FirebaseAuthMock) IsUserActive added in v0.0.3

func (f FirebaseAuthMock) IsUserActive(response VerifyTokenResp) (bool, error)

func (FirebaseAuthMock) VerifyUser added in v0.0.3

func (f FirebaseAuthMock) VerifyUser(request VerifyTokenBody) (VerifyTokenResp, error)

type FirebaseConfig added in v0.0.3

type FirebaseConfig struct {
	FbApiAddr string
	FbVerAddr string
	FbApiKey  string
}

FirebaseConfig Struct for Firebase config

type FirebaseError

type FirebaseError struct {
	Error struct {
		Errors  []interface{} `json:"errors"`
		Code    int           `json:"code"`
		Message string        `json:"message"`
	}
}

FirebaseError Firebase REST API Error structure

type LoginBody

type LoginBody struct {
	Email             string `json:"email"`
	Password          string `json:"password"`
	ReturnSecureToken string `json:"returnSecureToken"`
}

LoginBody Firebase Rest API Login request body

type LoginResp

type LoginResp struct {
	Kind         string
	LocalId      string
	Email        string
	DisplayName  string
	IdToken      string
	Registered   bool
	RefreshToken string
	ExpiresIn    string
}

LoginResp Firebase REST API Login response body (if successful)

type RegressionModel

type RegressionModel struct {
}

RegressionModel Regression model Implement your regression model here

func (RegressionModel) Predict

func (r RegressionModel) Predict(x []float64) (float64, error)

Predict Hardcoded - arbitrary predict function

func (RegressionModel) PredictProbability

func (r RegressionModel) PredictProbability(_ []float64) (float64, error)

PredictProbability Not used for RegressionModel

func (RegressionModel) ReadModel

func (r RegressionModel) ReadModel() error

ReadModel Not used for RegressionModel

type VerifyTokenBody

type VerifyTokenBody struct {
	IdToken string `json:"idToken"`
}

VerifyTokenBody Firebase Rest API Verify token request body

type VerifyTokenResp

type VerifyTokenResp struct {
	Kind  string
	Users []struct {
		LocalId           string
		Email             string
		PasswordHash      string
		EmailVerified     bool
		PasswordUpdatedAt int
		ProvidedUserInfo  []interface{}
		ValidSince        string
		Disabled          bool
		LastLoginAt       string
		CreatedAt         string
		LastRefreshAt     string
	}
}

VerifyTokenResp Firebase Rest API Verify token response body

Jump to

Keyboard shortcuts

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