services

package
v0.0.0-...-7b97167 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2020 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckContract

func CheckContract(rawAddress string) bool

CheckContract to check the authentication from the contract

func CheckMultiFactor

func CheckMultiFactor(email string, conn *sql.DB, ctx cont.Context) (bool, error)

CheckMultiFactor check if the user has one second auth factor and it's value

func DeployContract

func DeployContract(userAddress string) (string, *contracts.Contrato3)

DeployContract function to deploy one contract into the blockchain

func DoRegisterService

func DoRegisterService(w http.ResponseWriter, r *http.Request) models.ResponseRegister

DoRegisterService one service that insert one user on the DB

func GenerateSaltService

func GenerateSaltService() []byte

GenerateSaltService one service that generate one rand salt

func GetAuthentication

func GetAuthentication(instance *contracts.Contrato3) bool

GetAuthentication get the autherithation value for the customer contract

func GetExpirationTime

func GetExpirationTime(instance *contracts.Contrato3) *big.Int

GetExpirationTime get the expiration time value for the customer contract

func GetTrustClientsService

func GetTrustClientsService() []models.TrustClients

GetTrustClientsService one service that gets all clients from the DB

func GetUsersService

func GetUsersService(w http.ResponseWriter)

GetUsersService one service that gets all users from the DB

func InsertMultiService

func InsertMultiService(auth models.User) int

InsertMultiService one service that insert one multifactor on the DB

func LoadContract

func LoadContract(rawAddress string) *contracts.Contrato3

LoadContract to load one contract from the blockchain

func LoginMultiService

func LoginMultiService(user models.User) int

LoginMultiService gets if login is true o false

func LoginService

func LoginService(user models.User) (int, []byte)

LoginService gets if login is true o false

func RefreshTokenService

func RefreshTokenService(user models.User) []byte

RefreshTokenService one service that uses the Login service to refresh the token one hour

func SetAuthentication

func SetAuthentication(instance *contracts.Contrato3, value bool, expirationTime *big.Int) (*types.Transaction, error)

SetAuthentication set autherithation value for the customer contract

func TokenResponse

func TokenResponse(user models.User) (int, []byte)

TokenResponse function to generate token response when you are log in

Types

This section is empty.

Jump to

Keyboard shortcuts

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