utils

package
v0.0.0-...-dfd46d2 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateJWTforUser

func GenerateJWTforUser(user models.User) (string, error)

GenerateJWTforUser generates token for regular user

func IsJWTValid

func IsJWTValid(token string) bool

IsJWTValid verifies JWT and checks that it has not expired.

func OpenDBConnection

func OpenDBConnection() (*sql.DB, error)

OpenDBConnection configures and opens database connection to PostgreSQL database

func PQToTNError

func PQToTNError(err *pq.Error) *models.TNError

PQToTNError converts Postgres error to local TNError

Types

type GRPC

type GRPC struct {
	Server *grpc.Server
	// contains filtered or unexported fields
}

GRPC is a utility for creating GRPC server.

func NewGRPC

func NewGRPC(port string) *GRPC

NewGRPC creates an instance of GRPC with given port

func (*GRPC) Start

func (g *GRPC) Start() error

Start will start the GRPC server at given port

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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